This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: static-after-extern tests vs. mips explicit relocs


"Joseph S. Myers" <jsm28@cam.ac.uk> writes:
> Moving tests into gcc.dg changes them from testing multiple optimization
> options to testing just one.  Could we have a system by which a subset of
> gcc.dg get run across multiple optimization options (added on to any
> special options specified for that test)?  (gcc.dg/noncompile already does
> run with multiple options.)

How about the patch below?  It adds a gcc.dg/torture directory with a
very similar harness to noncompile.exp.  Tested in the same way as before.

Richard


(Full changelog, but the patch is just the gcc.dg/torture stuff.
Everything else is the same as before.)

	* gcc.c-torture/execute/builtins: New directory.
	* gcc.c-torture/execute/string-opt-{3,4,16,17,18,19}.c: Move into
	gcc.c-torture/execute/builtins.
	* gcc.c-torture/execute/string-opt-asm-{1,2}.c: Likewise.
	* gcc.c-torture/execute/builtin-noret-{1,2}.c: Move to...
	* gcc.dg/torture: ...this new directory.  Turn into link-only tests.
	* gcc.dg/no-builtin-1.c: Move into gcc.c-torture/execute/builtins.

*** /dev/null	Thu Apr 11 15:25:15 2002
--- testsuite/gcc.dg/torture/builtin-noret-1.c	Sat May 10 16:18:06 2003
***************
*** 0 ****
--- 1,72 ----
+ /* Test for builtin noreturn attributes.  */
+ /* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+ /* { dg-do link } */
+ 
+ extern void abort (void);
+ extern void exit (int);
+ extern void _exit (int);
+ extern void _Exit (int);
+ 
+ extern void tabort (void);
+ extern void texit (void);
+ extern void t_exit (void);
+ extern void t_Exit (void);
+ 
+ extern void link_failure (void);
+ 
+ int
+ main (void)
+ {
+   volatile int i = 0;
+   if (i)
+     tabort ();
+   if (i)
+     texit ();
+   if (i)
+     t_exit ();
+   if (i)
+     t_Exit ();
+   exit (0);
+ }
+ 
+ void
+ tabort (void)
+ {
+   abort ();
+   link_failure ();
+ }
+ 
+ void
+ texit (void)
+ {
+   exit (1);
+   link_failure ();
+ }
+ 
+ void
+ t_exit (void)
+ {
+   _exit (1);
+   link_failure ();
+ }
+ 
+ /* Some non-Unix libcs might not have _exit.  */
+ void
+ _exit (int i)
+ {
+   abort ();
+ }
+ 
+ void
+ t_Exit (void)
+ {
+   _Exit (1);
+   link_failure ();
+ }
+ 
+ /* Some libcs might not have _Exit.  */
+ void
+ _Exit (int i)
+ {
+   abort ();
+ }
*** /dev/null	Thu Apr 11 15:25:15 2002
--- testsuite/gcc.dg/torture/builtin-noret-2.c	Sat May 10 16:18:14 2003
***************
*** 0 ****
--- 1,72 ----
+ /* Test for builtin noreturn attributes when the visible declarations
+    are function-local.  Modified from builtin-noret-1.c by Zack Weinberg
+    <zack@codesourcery.com>.  */
+ /* { dg-do link } */
+ 
+ extern void tabort (void);
+ extern void texit (void);
+ extern void t_exit (void);
+ extern void t_Exit (void);
+ 
+ extern void link_failure (void);
+ 
+ int
+ main (void)
+ {
+   volatile int i = 0;
+   if (i)
+     tabort ();
+   if (i)
+     texit ();
+   if (i)
+     t_exit ();
+   if (i)
+     t_Exit ();
+   exit (0);
+ }
+ 
+ void
+ tabort (void)
+ {
+   extern void abort (void);
+   abort ();
+   link_failure ();
+ }
+ 
+ void
+ texit (void)
+ {
+   extern void exit (int);
+   exit (1);
+   link_failure ();
+ }
+ 
+ void
+ t_exit (void)
+ {
+   extern void _exit (int);
+   _exit (1);
+   link_failure ();
+ }
+ 
+ /* Some non-Unix libcs might not have _exit.  */
+ void
+ _exit (int i)
+ {
+   abort ();
+ }
+ 
+ void
+ t_Exit (void)
+ {
+   extern void _Exit (int);
+   _Exit (1);
+   link_failure ();
+ }
+ 
+ /* Some libcs might not have _Exit.  */
+ void
+ _Exit (int i)
+ {
+   abort ();
+ }
*** /dev/null	Thu Apr 11 15:25:15 2002
--- testsuite/gcc.dg/torture/dg-torture.exp	Sat May 10 16:36:47 2003
***************
*** 0 ****
--- 1,7 ----
+ # This harness is for tests that should be run at all optimisation levels.
+ 
+ load_lib gcc-dg.exp
+ 
+ dg-init
+ gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] ""
+ dg-finish


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]