public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Migrating gcc.c-torture
@ 2014-07-23 23:52 Bernd Schmidt
  2014-07-24  0:00 ` Andrew Pinski
  2014-07-24  6:45 ` Thomas Schwinge
  0 siblings, 2 replies; 16+ messages in thread
From: Bernd Schmidt @ 2014-07-23 23:52 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 1610 bytes --]

This is an idea I discussed with a few folks at the Cauldron, and since 
they made supportive noises, I decided to work on it. The problem I'm 
trying to solve is that for ptx, I'll have to mark a lot of testcases as 
unsupported (uses of things such as indirect jumps, alloca, and 
sometimes K&R-style function definitions). In c-torture/execute, we 
can't use dg-require-effective-target directives, and using .x files 
feels a little antiquated. So I've started to work on a little shell 
script which migrates files out of c-torture/{compile,execute} and into 
gcc.dg/torture, or c-c++-common/torture if the test seems to work for 
C++ as well.

Below is the current script, which produced no new failures on my latest 
run of testing on x86_64-linux. Some tests remain in c-torture (mostly 
because of warnings), but their number can be somewhat reduced by 
applying a preliminary patch first. This fixes up warnings in some 
testcases when doing so does not appear to affect what they are testing 
for. We can decide later what to do with the remaining tests (such as 
adding dg-warning as appropriate).

One thing to note is that this script will migrate most of the limits 
tests to c-c++-common, increasing runtime of the testsuite a bit.

Comments, objections? Ok to apply the preliminary patch?

Any other targets I should add to the list of compilers that are run 
before deciding where to move the test? Does anyone want to see the full 
patch in the final submission (git doesn't seem to produce something 
nice for the renames unfortunately) or just the script and generated 
ChangeLog?


Bernd

[-- Attachment #2: torture.sh --]
[-- Type: application/x-shellscript, Size: 5038 bytes --]

[-- Attachment #3: preliminary.diff --]
[-- Type: text/x-patch, Size: 27533 bytes --]

	* gcc.c-torture/compile/20000211-1.c (emacs_doprnt_1): Cast return
	value of an undeclared function to the type used in the assignment.
	* gcc.c-torture/compile/20000802-1.c (memcpy): Declare.
	* gcc.c-torture/compile/20020701-1.c (atoi, strchr, strcmp, strlen):
	Wrap in extern "C" for C++.
	(strlen, memcpy): Declare.
	* gcc.c-torture/compile/20021230-1.c (r, t): Declare as
	__INT32_TYPE__.
	* gcc.c-torture/compile/20030219-1.c (clobber_register): Use
	intermediate __UINTPTR_TYPE__ when casting integer to pointer.
	* gcc.c-torture/compile/20060202-1.c (sarray_get_safe): Likewise.
	* gcc.c-torture/compile/pr37878.c (foo): Likewise.
	* gcc.c-torture/compile/20060109-1.c (cb_ident): Declare as
	returning void.
	* gcc.c-torture/compile/20070905-1.c (baz): Cast away volatile
	on second arg when calling f1.
	* gcc.c-torture/compile/20120524-1.c (memcpy): Declare.
	* gcc.c-torture/compile/920428-1.c (x): Use intermediate
	__INTPTR_TYPE__ when casting pointer to integer.
	* gcc.c-torture/compile/920501-21.c (bar): Likewise.
	* gcc.c-torture/compile/pr37387.c (FuncMakeConsequencesPres):
	Likewise.
	* gcc.c-torture/compile/pr60556.c (f): Likewise.
	* gcc.c-torture/compile/920428-2.c (sprintf, fwrite): Remove
	unused declarations.
	* gcc.c-torture/compile/pr46934.c (caller): Use __UINT32_TYPE__
	for argument.
	* gcc.c-torture/compile/pr53058.c (a, b, c): Declare as
	__INT32_TYPE__.
	* gcc.c-torture/compile/pr56984.c (foo): Use __INT32_TYPE__
	for argument.
	* gcc.c-torture/compile/simd-5.c (printf): Declare.
	* gcc.c-torture/execute/20001111-1.c (foo): Use intermediate
	__INTPTR_TYPE__ when casting integer to pointer.
	* gcc.c-torture/execute/20011121-1.c (main): Use intermediate
	__INTPTR_TYPE__ when casting pointer to integer.
	* gcc.c-torture/execute/20030811-1.c (test1, test2, test3,
	test4): Likewise.
	* gcc.c-torture/execute/920428-1.c (x): Likewise.
	* gcc.c-torture/execute/960116-1.c (p): Likewise.
	* gcc.c-torture/execute/loop-2c.c (g, main): Likewise.
	* gcc.c-torture/execute/loop-2d.c (f, main): Likewise.
	* gcc.c-torture/execute/20021120-3.c: Include <stdio.h>.
	* gcc.c-torture/execute/20030606-1.c: Include <string.h>.
	* gcc.c-torture/execute/20031012-1.c: Include <string.h>.
	(memset): Don't declare.
	* gcc.c-torture/execute/20040411-1.c: Include <string.h>.
	* gcc.c-torture/execute/20040423-1.c: Include <string.h>.
	* gcc.c-torture/execute/20121108-1.c (strtoul1): Change second
	arg type to const char **.
	(string_to_ip): Change type of e to constr char *.
	* gcc.c-torture/execute/950221.c (strcpy): Declare.
	* gcc.c-torture/execute/980506-3.c (memset, strlen): Declare.
	* gcc.c-torture/execute/980526-2.c (getname): Use intermediate
	__UINTPTR_TYPE__ when casting pointers to integers.
	* gcc.c-torture/execute/990628-1.c: Include <string.h>.
	* gcc.c-torture/execute/cbrt.c (cbrtl_): Renamed from cbrtl.  All
	callers changed.


diff --git a/gcc/testsuite/gcc.c-torture/compile/20000211-1.c b/gcc/testsuite/gcc.c-torture/compile/20000211-1.c
index 7a7c8c0..b593b1b 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20000211-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20000211-1.c
@@ -84,15 +84,15 @@ emacs_doprnt_1 (Lisp_Object stream, const  Bufbyte *format_nonreloc,
 		Lisp_Object format_reloc, Bytecount format_length,
 		int nargs,
 		const  Lisp_Object *largs)
 {
   int i;
   printf_spec_dynarr *specs = 0;
   format_nonreloc = (( ((  struct Lisp_String  *) ((void *)((((     format_reloc     ) & ((1UL << ((4   * 8 )  - 4 ) ) - 1UL) ) ) | 0x40000000 )) )   )->_data + 0)  ;
   format_length = (( ((  struct Lisp_String  *) ((void *)((((     format_reloc     ) & ((1UL << ((4   * 8 )  - 4 ) ) - 1UL) ) ) | 0x40000000 )) )   )->_size)  ;
-  specs = parse_doprnt_spec (format_nonreloc, format_length);
+  specs = (printf_spec_dynarr *)parse_doprnt_spec (format_nonreloc, format_length);
   for (i = 0; i < (( specs )->cur) ; i++)
     {
       char ch;
       doprnt_1 (stream, (Bufbyte *) &ch, 1, 0, -1, 0, 0);
     }
 }
diff --git a/gcc/testsuite/gcc.c-torture/compile/20000802-1.c b/gcc/testsuite/gcc.c-torture/compile/20000802-1.c
index 0b2f1d6..b4c6ed8 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20000802-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20000802-1.c
@@ -3,13 +3,19 @@ struct foo {
   char b;
   char c;
 };
 
 struct foo bs;
 int x;
 char y[3];
 
+extern
+#ifdef __cplusplus
+"C"
+#endif
+void *memcpy (void *, const void *, __SIZE_TYPE__);
+
 void bar(void)
 {
     memcpy(bs.a, y, 3);
     bs.a[1] = ((x ? &bs.b : &bs.c) - (char *)&bs) - 2;
 }
diff --git a/gcc/testsuite/gcc.c-torture/compile/20020701-1.c b/gcc/testsuite/gcc.c-torture/compile/20020701-1.c
index 1258cec..dbd0ebf 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20020701-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20020701-1.c
@@ -1,19 +1,26 @@
 /* PR target/7177
    Problem with cris-axis-elf: ICE in global.
    Origin: hp@axis.com.  */
 
 typedef __SIZE_TYPE__ size_t;
 void f1 (void *);
 char *f2 (const char *);
-int atoi (const char *);
-char *strchr (const char *, int);
-int strcmp (const char *, const char *);
-size_t strlen (const char *);
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern int atoi (const char *);
+extern char *strchr (const char *, int);
+extern int strcmp (const char *, const char *);
+extern size_t strlen (const char *);
+extern void *memcpy (void *, const void *, __SIZE_TYPE__);
+#ifdef __cplusplus
+}
+#endif
 typedef enum { A, B, C } t1;
 extern const char _v[];
 
 static t1
 f (const char* p1, const char* p2, char p3)
 {
   char *v1;
   char *v2;
diff --git a/gcc/testsuite/gcc.c-torture/compile/20021230-1.c b/gcc/testsuite/gcc.c-torture/compile/20021230-1.c
index 45ab51f..540eddb 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20021230-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20021230-1.c
@@ -1,8 +1,8 @@
 /* SH has special handling for combined and/shift sequences.  Make
    sure that it behaves properly when one input is in the MACL register.  */
-int r, t;
+__INT32_TYPE__ r, t;
 
 static void initRGB()
 {
   t = ((r*255/3) & 0xff) << 16;
 }
diff --git a/gcc/testsuite/gcc.c-torture/compile/20030219-1.c b/gcc/testsuite/gcc.c-torture/compile/20030219-1.c
index ecc943f..7bb9a81 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20030219-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20030219-1.c
@@ -1,6 +1,6 @@
 int global_one;
 
 void clobber_register()
 {
-  *(volatile unsigned char *)(0xE0000000 * global_one) = 0x00;
+  *(volatile unsigned char *)(__UINTPTR_TYPE__)(0xE0000000 * global_one) = 0x00;
 }
diff --git a/gcc/testsuite/gcc.c-torture/compile/20060109-1.c b/gcc/testsuite/gcc.c-torture/compile/20060109-1.c
index 9ef9c2f..69a3248 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20060109-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20060109-1.c
@@ -16,17 +16,17 @@ struct cpp_callbacks
   void (*ident) (cpp_reader *, unsigned int, const cpp_string *);
 };
 static void cb_ident (cpp_reader *, unsigned int, const cpp_string *);
 init_c_lex (void)
 {
   struct cpp_callbacks *cb;
   cb->ident = cb_ident;
 }
-cb_ident (cpp_reader * pfile __attribute__ ((__unused__)), unsigned int
+void cb_ident (cpp_reader * pfile __attribute__ ((__unused__)), unsigned int
 line
           __attribute__ ((__unused__)), const cpp_string * str
           __attribute__ ((__unused__)))
 {
   {
     cpp_string cstr = {
     };
     if (cpp_interpret_string (pfile, str, 1, &cstr, 0))
diff --git a/gcc/testsuite/gcc.c-torture/compile/20060202-1.c b/gcc/testsuite/gcc.c-torture/compile/20060202-1.c
index d16e7b7..aebc3b3 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20060202-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20060202-1.c
@@ -34,17 +34,17 @@ soffset_decode (sidx indx)
   union sofftype x;
   x.idx = indx;
   return x.off.eoffset + (x.off.boffset * (1 << 5));
 }
 static __inline__ void *
 sarray_get_safe (struct sarray *array, sidx indx)
 {
   if (soffset_decode (indx) < array->capacity)
-    return (void *)sarray_get (array, indx);
+    return (void *)(__INTPTR_TYPE__)sarray_get (array, indx);
 }
 void *
 get_imp (Class class, SEL sel)
 {
   void *res = sarray_get_safe (class->dtable, (size_t) sel->sel_id);
   if (res == 0)
     {
 	{
diff --git a/gcc/testsuite/gcc.c-torture/compile/20070905-1.c b/gcc/testsuite/gcc.c-torture/compile/20070905-1.c
index 5953275..92c39b7 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20070905-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20070905-1.c
@@ -8,17 +8,17 @@ struct S
 void f1 (int, unsigned long *);
 int f2 (void);
 int f3 (int, unsigned long *);
 int f4 (int, unsigned long *);
 
 static inline __attribute__ ((always_inline))
 void baz (int x, volatile struct S *y)
 {
-  f1 (x, y->bits);
+  f1 (x, (unsigned long *)y->bits);
 }
 
 static int
 bar (int x, struct S *y)
 {
   int n;
   if (__builtin_constant_p (x) ? f3 (x, y->bits) : f4 (x, y->bits))
     baz (x, y);
diff --git a/gcc/testsuite/gcc.c-torture/compile/20120524-1.c b/gcc/testsuite/gcc.c-torture/compile/20120524-1.c
index 021756b..6ed83a8 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20120524-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20120524-1.c
@@ -1,4 +1,10 @@
-  char CJPAT_Packet[1508] = {};
+extern
+#ifdef __cplusplus
+"C"
+#endif
+void *memcpy (void *, const void *, __SIZE_TYPE__);
+
+char CJPAT_Packet[1508] = {};
 void build_packet(int port, char *packet) {
             memcpy(packet, CJPAT_Packet, sizeof(CJPAT_Packet)); 
 }
diff --git a/gcc/testsuite/gcc.c-torture/compile/920428-1.c b/gcc/testsuite/gcc.c-torture/compile/920428-1.c
index fdc478a..8ea1251 100644
--- a/gcc/testsuite/gcc.c-torture/compile/920428-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/920428-1.c
@@ -1 +1 @@
-x(){char*q;return(long)q>>8&0xff;}
+x(){char*q;return(long)(__INTPTR_TYPE__)q>>8&0xff;}
diff --git a/gcc/testsuite/gcc.c-torture/compile/920428-2.c b/gcc/testsuite/gcc.c-torture/compile/920428-2.c
index f313b32..886ffae 100644
--- a/gcc/testsuite/gcc.c-torture/compile/920428-2.c
+++ b/gcc/testsuite/gcc.c-torture/compile/920428-2.c
@@ -55,34 +55,32 @@ int rename(const char *from, const char *to);
 struct _iobuf *tmpfile(void);
 char *tmpnam(char *s);
 int setvbuf(struct _iobuf *iop, char *buf, int type, size_t size);
 int setbuf(struct _iobuf *stream, char *buf);
 int setbuffer(struct _iobuf *stream, char *buf, size_t size);
 int setlinebuf(struct _iobuf *stream);
 int fprintf(struct _iobuf *stream, const char *format, ...);
 int printf(const char *format, ...);
-char *sprintf(char *s, const char *format, ...);
 int vfprintf(struct _iobuf *stream, const char *format, va_list arg);
 int vprintf(const char *format, va_list arg);
 int vsprintf(char *s, const char *format, va_list arg);
 int fscanf(struct _iobuf *stream, const char *format, ...);
 int scanf(const char *format, ...);
 int sscanf(char *s, const char *format, ...);
 int fgetc(struct _iobuf *stream);
 int getw(struct _iobuf *stream);
 char *fgets(char *s, int n, struct _iobuf *stream);
 char *gets(char *s);
 int fputc(int c, struct _iobuf *stream);
 int putw(int w, struct _iobuf *stream);
 int fputs(const char *s, struct _iobuf *stream);
 int puts(const char *s);
 int ungetc(int c, struct _iobuf *stream);
 int fread(void *ptr, size_t size, size_t count, struct _iobuf *iop);
-int fwrite(const void *ptr, size_t size, size_t count, struct _iobuf *iop);
 int fseek(struct _iobuf *stream, long offset, int ptrname);
 long ftell(struct _iobuf *stream);
 void rewind(struct _iobuf *stream);
 int fgetpos(struct _iobuf *stream, long *pos);
 int fsetpos(struct _iobuf *stream, const long *pos);
 void perror(const char *s);
 typedef unsigned char byte;
 typedef unsigned char uchar;
diff --git a/gcc/testsuite/gcc.c-torture/compile/920501-21.c b/gcc/testsuite/gcc.c-torture/compile/920501-21.c
index 4a9f05a..044b36f 100644
--- a/gcc/testsuite/gcc.c-torture/compile/920501-21.c
+++ b/gcc/testsuite/gcc.c-torture/compile/920501-21.c
@@ -1,3 +1,3 @@
 typedef unsigned short t;
 struct foo{t d;};
-int bar(d)t d;{struct foo u;u.d=d;return(int)(&u);}
+int bar(d)t d;{struct foo u;u.d=d;return(int)(__INTPTR_TYPE__)(&u);}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr37387.c b/gcc/testsuite/gcc.c-torture/compile/pr37387.c
index d338933..a64bc32 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr37387.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr37387.c
@@ -1,11 +1,11 @@
 typedef long int Int;
 void FuncMakeConsequencesPres (long *objDefs1)
 {
-  long a = (long)objDefs1;
+  long a = (long)(__INTPTR_TYPE__)objDefs1;
   int c = a & 0x01;
   int b = 0;
   if (!  ( 13 <= ( c ? 0 : (((int) objDefs1 & 0x02) ? 0 : *objDefs1  ))
            && b <= 0))
     ErrorQuit ();
 }
 
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr37878.c b/gcc/testsuite/gcc.c-torture/compile/pr37878.c
index aa18e6d..bd0b356 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr37878.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr37878.c
@@ -1,9 +1,9 @@
 /* PR target/37878 */
 
 double y, z;
 void foo (long x)
 {
-  y = *(double *) ((long *) (x - 1) + 1);
-  z = *(double *) ((long *) (x - 1) + 1);
+  y = *(double *) ((long *) (__INTPTR_TYPE__) (x - 1) + 1);
+  z = *(double *) ((long *) (__INTPTR_TYPE__) (x - 1) + 1);
 }
 
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr46934.c b/gcc/testsuite/gcc.c-torture/compile/pr46934.c
index a9c0b68..b634e00 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr46934.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr46934.c
@@ -1,9 +1,9 @@
-int caller (unsigned int reg_type)
+int caller (__UINT32_TYPE__ reg_type)
 {
   switch (reg_type)
     {
     case 0x80000000:
       return (int)foo();
 
     case 0x80000003:
       return (int) bar();
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr53058.c b/gcc/testsuite/gcc.c-torture/compile/pr53058.c
index 90063c5..6bcd18e 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr53058.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr53058.c
@@ -1,11 +1,11 @@
 /* PR tree-optimization/53058 */
 
-int a, b, c;
+__INT32_TYPE__ a, b, c;
 
 void
 foo ()
 {
   c = b >> 16;
   if (c > 32767)
     c = 0;
   a = b;
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr56984.c b/gcc/testsuite/gcc.c-torture/compile/pr56984.c
index bd00bee..fe94635 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr56984.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr56984.c
@@ -1,9 +1,9 @@
 /* PR tree-optimization/56984 */
 
 int
-foo (int x)
+foo (__INT32_TYPE__ x)
 {
   if ((x >> 31) < -1)
     x++;
   return x;
 }
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr60556.c b/gcc/testsuite/gcc.c-torture/compile/pr60556.c
index c775432..c1565e1 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr60556.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr60556.c
@@ -1,8 +1,8 @@
 /* PR middle-end/60556 */
 
 int g (int);
 
 unsigned long long f (void)
 {
- return (unsigned long long)(long)&g;
+ return (unsigned long long)(__INTPTR_TYPE__)&g;
 }
diff --git a/gcc/testsuite/gcc.c-torture/compile/simd-5.c b/gcc/testsuite/gcc.c-torture/compile/simd-5.c
index 016cccd..837e647 100644
--- a/gcc/testsuite/gcc.c-torture/compile/simd-5.c
+++ b/gcc/testsuite/gcc.c-torture/compile/simd-5.c
@@ -1,10 +1,12 @@
 #define vector64 __attribute__((vector_size(8)))
 
+extern __SIZE_TYPE__ printf (const char *, ...);
+
 main(){
 
  vector64 int  c;
 vector64 int a = {1, -1};
 vector64 int b = {2, -2};
 c = -a + b*b*(-1LL);
 /* c is now {5, 3} */
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/20001111-1.c b/gcc/testsuite/gcc.c-torture/execute/20001111-1.c
index 85617c2..44e2697 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20001111-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20001111-1.c
@@ -11,17 +11,17 @@ foo (unsigned int offset)
   int x;
   char *data;
 
   i = u;
   if (i)
     return i * 0xce2f;
 
   buffer = next_buffer;
-  data = buffer * 0xce2f;
+  data = (char *)(__INTPTR_TYPE__)(buffer * 0xce2f);
   for (i = 0; i < 2; i++)
     bar ();
   buffer = next_buffer;
   return buffer * 0xce2f + offset;
 
 }
 
 void
diff --git a/gcc/testsuite/gcc.c-torture/execute/20011121-1.c b/gcc/testsuite/gcc.c-torture/execute/20011121-1.c
index 3e3d03a..c61984b 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20011121-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20011121-1.c
@@ -7,13 +7,13 @@ struct s
 
 struct s s1;
 
 int
 main()
 {
   struct s s2;
   s2.b[0] = 100;
-  __builtin_memcpy(&s2, &s1, ((unsigned int) &((struct s *)0)->b));
+  __builtin_memcpy(&s2, &s1, ((unsigned int) (__INTPTR_TYPE__) &((struct s *)0)->b));
   if (s2.b[0] != 100)
     abort();
   exit(0);
 }
diff --git a/gcc/testsuite/gcc.c-torture/execute/20021120-3.c b/gcc/testsuite/gcc.c-torture/execute/20021120-3.c
index e875f1f..d9a8060 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20021120-3.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20021120-3.c
@@ -1,11 +1,14 @@
 /* Test whether a partly call-clobbered register will be moved over a call.
    Although the original test case didn't use any GNUisms, it proved
    difficult to reduce without the named register extension.  */
+
+#include <stdio.h>
+
 #if __SH64__ == 32
 #define LOC asm ("r10")
 #else
 #define LOC
 #endif
 
 unsigned int foo (char *c, unsigned int x, unsigned int y)
 {
diff --git a/gcc/testsuite/gcc.c-torture/execute/20030606-1.c b/gcc/testsuite/gcc.c-torture/execute/20030606-1.c
index 51054d9..085685e 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20030606-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20030606-1.c
@@ -1,8 +1,9 @@
+#include <string.h>
 
 int * foo (int *x, int b)
 {
 
   *(x++) = 55;
   if (b)
     *(x++) = b;
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/20030811-1.c b/gcc/testsuite/gcc.c-torture/execute/20030811-1.c
index 2ac59c0..88ab8d1 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20030811-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20030811-1.c
@@ -4,32 +4,32 @@ void vararg (int i, ...)
 {
   (void) i;
 }
 
 int i0[0], i1;
 
 void test1 (void)
 {
-  int a = (int) (long long) __builtin_return_address (0);
+  int a = (int) (__INTPTR_TYPE__) __builtin_return_address (0);
   vararg (0, a);
 }
 
 void test2 (void)
 {
-  i0[0] = (int) (long long) __builtin_return_address (0);
+  i0[0] = (int) (__INTPTR_TYPE__) __builtin_return_address (0);
 }
 
 void test3 (void)
 {
-  i1 = (int) (long long) __builtin_return_address (0);
+  i1 = (int) (__INTPTR_TYPE__) __builtin_return_address (0);
 }
 
 void test4 (void)
 {
-  volatile long long a = (long long) __builtin_return_address (0);
+  volatile long long a = (long long)(__INTPTR_TYPE__) __builtin_return_address (0);
   i0[0] = (int) a;
 }
 
 int main (void)
 {
   return 0;
 }
diff --git a/gcc/testsuite/gcc.c-torture/execute/20031012-1.c b/gcc/testsuite/gcc.c-torture/execute/20031012-1.c
index a1f3de8..a7cdd38 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20031012-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20031012-1.c
@@ -6,17 +6,18 @@
 #if defined(STACK_SIZE) && STACK_SIZE < 16000
 #define ARRAY_SIZE (STACK_SIZE / 2)
 #define STRLEN	   (ARRAY_SIZE - 9)
 #else
 #define ARRAY_SIZE 15000
 #define STRLEN     13371
 #endif
 
-extern void *memset (void *, int, __SIZE_TYPE__);
+#include <string.h>
+
 extern void abort (void);
 
 static void foo ()
 {
     char a[ARRAY_SIZE];
 
     a[0]=0;
     memset( &a[0], 0xCD, STRLEN );
diff --git a/gcc/testsuite/gcc.c-torture/execute/20040411-1.c b/gcc/testsuite/gcc.c-torture/execute/20040411-1.c
index 8db4562..bcceb45 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20040411-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20040411-1.c
@@ -1,8 +1,10 @@
+#include <string.h>
+
 int
 sub1 (int i, int j)
 {
   typedef int c[i+2];
   int x[10], y[10];
 
   if (j == 2)
     {
diff --git a/gcc/testsuite/gcc.c-torture/execute/20040423-1.c b/gcc/testsuite/gcc.c-torture/execute/20040423-1.c
index ace797e..e69d3d0 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20040423-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20040423-1.c
@@ -1,8 +1,10 @@
+#include <string.h>
+
 int
 sub1 (int i, int j)
 {
   typedef struct
   {
    int  c[i+2];
   }c;
   int x[10], y[10];
diff --git a/gcc/testsuite/gcc.c-torture/execute/20121108-1.c b/gcc/testsuite/gcc.c-torture/execute/20121108-1.c
index 5ec889e..064cd0d 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20121108-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20121108-1.c
@@ -1,13 +1,13 @@
 char temp[] = "192.168.190.160";
 unsigned result = (((((192u<<8)|168u)<<8)|190u)<<8)|160u;
 
-int strtoul1(const char *a, char **b, int c) __attribute__((noinline, noclone));
-int strtoul1(const char *a, char **b, int c)
+int strtoul1(const char *a, const char **b, int c) __attribute__((noinline, noclone));
+int strtoul1(const char *a, const char **b, int c)
 {
   *b = a+3;
   if (a == temp)
     return 192;
   else if (a == temp+4)
     return 168;
   else if (a == temp+8)
     return 190;
@@ -15,17 +15,17 @@ int strtoul1(const char *a, char **b, int c)
     return 160;
   __builtin_abort();
 }
 
 int string_to_ip(const char *s) __attribute__((noinline,noclone));
 int string_to_ip(const char *s)
 {
         int addr;
-        char *e;
+        const char *e;
         int i;
 
         if (s == 0)
                 return(0);
 
         for (addr=0, i=0; i<4; ++i) {
                 int val = s ? strtoul1(s, &e, 10) : 0;
                 addr <<= 8;
diff --git a/gcc/testsuite/gcc.c-torture/execute/920428-1.c b/gcc/testsuite/gcc.c-torture/execute/920428-1.c
index 154af76..6094b6d 100644
--- a/gcc/testsuite/gcc.c-torture/execute/920428-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/920428-1.c
@@ -1,2 +1,11 @@
-x(const char*s){char a[1];const char*ss=s;a[*s++]|=1;return(int)ss+1==(int)s;}
-main(){if(x("")!=1)abort();exit(0);}
+x(const char*s)
+{
+  char a[1];
+  const char *ss=s;
+  a[*s++]|=1;
+  return (int)(__INTPTR_TYPE__)ss+1==(int)(__INTPTR_TYPE__)s;
+}
+main()
+{
+  if(x("")!=1)abort();exit(0);
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/950221-1.c b/gcc/testsuite/gcc.c-torture/execute/950221-1.c
index d67da5b..4d4b32d 100644
--- a/gcc/testsuite/gcc.c-torture/execute/950221-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/950221-1.c
@@ -1,8 +1,9 @@
+extern char *strcpy (char *, const char *);
 struct parsefile
 {
   long fd;
   char *buf;
 };
 struct parsefile basepf;
 struct parsefile *parsefile = &basepf;
 #ifdef STACK_SIZE
diff --git a/gcc/testsuite/gcc.c-torture/execute/960116-1.c b/gcc/testsuite/gcc.c-torture/execute/960116-1.c
index 6d7624c..0f6640d 100644
--- a/gcc/testsuite/gcc.c-torture/execute/960116-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/960116-1.c
@@ -1,12 +1,12 @@
 static inline
 p (int *p)
 {
-  return !((long) p & 1);
+  return !((long) (__INTPTR_TYPE__)p & 1);
 }
 
 int
 f (int *q)
 {
   if (p (q) && *q)
     return 1;
   return 0;
diff --git a/gcc/testsuite/gcc.c-torture/execute/980506-3.c b/gcc/testsuite/gcc.c-torture/execute/980506-3.c
index a943e9a..c596538 100644
--- a/gcc/testsuite/gcc.c-torture/execute/980506-3.c
+++ b/gcc/testsuite/gcc.c-torture/execute/980506-3.c
@@ -1,9 +1,11 @@
 unsigned char lookup_table [257];
+extern void *memset (void *, int, __SIZE_TYPE__);
+extern __SIZE_TYPE__ strlen (const char *);
 
 static int 
 build_lookup (pattern)
      unsigned char *pattern;
 {
   int m;
 
   m = strlen (pattern) - 1;
diff --git a/gcc/testsuite/gcc.c-torture/execute/980526-2.c b/gcc/testsuite/gcc.c-torture/execute/980526-2.c
index c17f4ea..566b640 100644
--- a/gcc/testsuite/gcc.c-torture/execute/980526-2.c
+++ b/gcc/testsuite/gcc.c-torture/execute/980526-2.c
@@ -20,26 +20,26 @@ void do_mknod(const char * filename, int mode, kdev_t dev)
 	else
 		abort();
 }
 
 
 char * getname(const char * filename)
 {
 	register unsigned int a1,a2,a3,a4,a5,a6,a7,a8,a9;
-	a1 = (unsigned int)(filename) *5 + 1;
-	a2 = (unsigned int)(filename) *6 + 2;
-	a3 = (unsigned int)(filename) *7 + 3;
-	a4 = (unsigned int)(filename) *8 + 4;
-	a5 = (unsigned int)(filename) *9 + 5;
-	a6 = (unsigned int)(filename) *10 + 5;
-	a7 = (unsigned int)(filename) *11 + 5;
-	a8 = (unsigned int)(filename) *12 + 5;
-	a9 = (unsigned int)(filename) *13 + 5;
-	return (char *)(a1*a2+a3*a4+a5*a6+a7*a8+a9);
+	a1 = (unsigned int)(__UINTPTR_TYPE__)(filename) *5 + 1;
+	a2 = (unsigned int)(__UINTPTR_TYPE__)(filename) *6 + 2;
+	a3 = (unsigned int)(__UINTPTR_TYPE__)(filename) *7 + 3;
+	a4 = (unsigned int)(__UINTPTR_TYPE__)(filename) *8 + 4;
+	a5 = (unsigned int)(__UINTPTR_TYPE__)(filename) *9 + 5;
+	a6 = (unsigned int)(__UINTPTR_TYPE__)(filename) *10 + 5;
+	a7 = (unsigned int)(__UINTPTR_TYPE__)(filename) *11 + 5;
+	a8 = (unsigned int)(__UINTPTR_TYPE__)(filename) *12 + 5;
+	a9 = (unsigned int)(__UINTPTR_TYPE__)(filename) *13 + 5;
+	return (char *)(__UINTPTR_TYPE__)(a1*a2+a3*a4+a5*a6+a7*a8+a9);
 }
 
 int sys_mknod(const char * filename, int mode, dev_t dev)
 {
 	int error;
 	char * tmp;
 
 	tmp = getname(filename);
diff --git a/gcc/testsuite/gcc.c-torture/execute/990628-1.c b/gcc/testsuite/gcc.c-torture/execute/990628-1.c
index e010510..129f5c9 100644
--- a/gcc/testsuite/gcc.c-torture/execute/990628-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/990628-1.c
@@ -1,9 +1,10 @@
 #include <stdlib.h>
+#include <string.h>
 
 struct {
     long sqlcode;
 } sqlca;
 
 
 struct data_record {
     int dummy;
diff --git a/gcc/testsuite/gcc.c-torture/execute/cbrt.c b/gcc/testsuite/gcc.c-torture/execute/cbrt.c
index 8659cc7..6ebceaf 100644
--- a/gcc/testsuite/gcc.c-torture/execute/cbrt.c
+++ b/gcc/testsuite/gcc.c-torture/execute/cbrt.c
@@ -17,17 +17,17 @@ static const unsigned long
 static const double
 	C =  5.42857142857142815906e-01, /* 19/35     = 0x3FE15F15, 0xF15F15F1 */
 	D = -7.05306122448979611050e-01, /* -864/1225 = 0xBFE691DE, 0x2532C834 */
 	E =  1.41428571428571436819e+00, /* 99/70     = 0x3FF6A0EA, 0x0EA0EA0F */
 	F =  1.60714285714285720630e+00, /* 45/28     = 0x3FF9B6DB, 0x6DB6DB6E */
 	G =  3.57142857142857150787e-01; /* 5/14      = 0x3FD6DB6D, 0xB6DB6DB7 */
 
 double
-cbrtl (double x)
+cbrtl_ (double x)
 {
   long hx;
   double r,s,w;
   double lt;
   unsigned sign;
   typedef unsigned unsigned32 __attribute__((mode(SI)));
   union {
     double t;
@@ -77,16 +77,16 @@ cbrtl (double x)
 
   lt = ut.t;
   lt -= (lt - (x/(lt*lt))) * 0.333333333333333333333;
   return lt;
 }
 
 main ()
 {
-  if ((int) (cbrtl (27.0) + 0.5) != 3)
+  if ((int) (cbrtl_ (27.0) + 0.5) != 3)
     abort ();
 
   exit (0);
 }
 #else
 main () { exit (0); }
 #endif
diff --git a/gcc/testsuite/gcc.c-torture/execute/loop-2c.c b/gcc/testsuite/gcc.c-torture/execute/loop-2c.c
index 9facf3b..5b37f91 100644
--- a/gcc/testsuite/gcc.c-torture/execute/loop-2c.c
+++ b/gcc/testsuite/gcc.c-torture/execute/loop-2c.c
@@ -5,19 +5,19 @@ __inline__ f (b, o)
   unsigned int i;
   int *p;
   for (p = &a[b], i = b; --i < ~0; )
     *--p = i * 3 + o;
 }
 
 g(int b)
 {
-  f (b, (int)a);
+  f (b, (int)(__INTPTR_TYPE__)a);
 }
 
 main ()
 {
   a[0] = a[1] = 0;
   g (2);
-  if (a[0] != (int)a || a[1] != (int)a + 3)
+  if (a[0] != (int)(__INTPTR_TYPE__)a || a[1] != (int)(__INTPTR_TYPE__)a + 3)
     abort ();
   exit (0);
 }
diff --git a/gcc/testsuite/gcc.c-torture/execute/loop-2d.c b/gcc/testsuite/gcc.c-torture/execute/loop-2d.c
index 19272bf..d49787f 100644
--- a/gcc/testsuite/gcc.c-torture/execute/loop-2d.c
+++ b/gcc/testsuite/gcc.c-torture/execute/loop-2d.c
@@ -1,18 +1,18 @@
 int a[2];
 
 f (b)
 {
   unsigned int i;
   int *p;
   for (p = &a[b], i = b; --i < ~0; )
-    *--p = i * 3 + (int)a;
+    *--p = i * 3 + (int)(__INTPTR_TYPE__)a;
 }
 
 main ()
 {
   a[0] = a[1] = 0;
   f (2);
-  if (a[0] != (int)a || a[1] != (int)a + 3)
+  if (a[0] != (int)(__INTPTR_TYPE__)a || a[1] != (int)(__INTPTR_TYPE__)a + 3)
     abort ();
   exit (0);
 }

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Migrating gcc.c-torture
  2014-07-23 23:52 Migrating gcc.c-torture Bernd Schmidt
@ 2014-07-24  0:00 ` Andrew Pinski
  2014-07-24  7:12   ` Jakub Jelinek
  2014-07-24  6:45 ` Thomas Schwinge
  1 sibling, 1 reply; 16+ messages in thread
From: Andrew Pinski @ 2014-07-24  0:00 UTC (permalink / raw)
  To: Bernd Schmidt; +Cc: GCC Patches

On Wed, Jul 23, 2014 at 4:47 PM, Bernd Schmidt <bernds@codesourcery.com> wrote:
> This is an idea I discussed with a few folks at the Cauldron, and since they
> made supportive noises, I decided to work on it. The problem I'm trying to
> solve is that for ptx, I'll have to mark a lot of testcases as unsupported
> (uses of things such as indirect jumps, alloca, and sometimes K&R-style
> function definitions). In c-torture/execute, we can't use
> dg-require-effective-target directives, and using .x files feels a little
> antiquated. So I've started to work on a little shell script which migrates
> files out of c-torture/{compile,execute} and into gcc.dg/torture, or
> c-c++-common/torture if the test seems to work for C++ as well.
>
> Below is the current script, which produced no new failures on my latest run
> of testing on x86_64-linux. Some tests remain in c-torture (mostly because
> of warnings), but their number can be somewhat reduced by applying a
> preliminary patch first. This fixes up warnings in some testcases when doing
> so does not appear to affect what they are testing for. We can decide later
> what to do with the remaining tests (such as adding dg-warning as
> appropriate).
>
> One thing to note is that this script will migrate most of the limits tests
> to c-c++-common, increasing runtime of the testsuite a bit.
>
> Comments, objections? Ok to apply the preliminary patch?

Yes, what if you don't move the tests but just change how the .exp to
use the same infrastructure as gcc.dg/torture instead?
I think changing the testcase in some cases is changing what is being
tested so a script doing it automatically is not a good thing.  Each
testcase should be audited instead.

Thanks,
Andrew Pinski

>
> Any other targets I should add to the list of compilers that are run before
> deciding where to move the test? Does anyone want to see the full patch in
> the final submission (git doesn't seem to produce something nice for the
> renames unfortunately) or just the script and generated ChangeLog?
>
>
> Bernd

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Migrating gcc.c-torture
  2014-07-23 23:52 Migrating gcc.c-torture Bernd Schmidt
  2014-07-24  0:00 ` Andrew Pinski
@ 2014-07-24  6:45 ` Thomas Schwinge
  2014-07-24  7:49   ` Andreas Schwab
  1 sibling, 1 reply; 16+ messages in thread
From: Thomas Schwinge @ 2014-07-24  6:45 UTC (permalink / raw)
  To: Bernd Schmidt; +Cc: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 290 bytes --]

Hi!

On Thu, 24 Jul 2014 01:47:09 +0200, Bernd Schmidt <bernds@codesourcery.com> wrote:
> (git doesn't seem to produce something 
> nice for the renames unfortunately)

Are you maybe looking for the the -M or -C options to certain commands
(diff, show, ...)?


Grüße,
 Thomas

[-- Attachment #2: Type: application/pgp-signature, Size: 472 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Migrating gcc.c-torture
  2014-07-24  0:00 ` Andrew Pinski
@ 2014-07-24  7:12   ` Jakub Jelinek
  2014-07-24 17:17     ` Mike Stump
  2014-07-28 22:41     ` Joseph S. Myers
  0 siblings, 2 replies; 16+ messages in thread
From: Jakub Jelinek @ 2014-07-24  7:12 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: Bernd Schmidt, GCC Patches

On Wed, Jul 23, 2014 at 04:52:23PM -0700, Andrew Pinski wrote:
> > Comments, objections? Ok to apply the preliminary patch?
> 
> Yes, what if you don't move the tests but just change how the .exp to
> use the same infrastructure as gcc.dg/torture instead?

Yeah.  I believe gcc.c-torture/compile/ has been converted already,
so it is just about gcc.c-torture/execute/.  Each of these tests has
it's own default idioms, e.g. -w in by default in gcc.c-torture/.
So, please just tweak execute.exp, so that it does what it did until now
(perhaps with the exception of *.x files support) in dg framework, and
convert *.exp files into dg-* directives in the testcases.

	Jakub

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Migrating gcc.c-torture
  2014-07-24  6:45 ` Thomas Schwinge
@ 2014-07-24  7:49   ` Andreas Schwab
  0 siblings, 0 replies; 16+ messages in thread
From: Andreas Schwab @ 2014-07-24  7:49 UTC (permalink / raw)
  To: Thomas Schwinge; +Cc: Bernd Schmidt, GCC Patches

Thomas Schwinge <thomas@codesourcery.com> writes:

> Hi!
>
> On Thu, 24 Jul 2014 01:47:09 +0200, Bernd Schmidt <bernds@codesourcery.com> wrote:
>> (git doesn't seem to produce something 
>> nice for the renames unfortunately)
>
> Are you maybe looking for the the -M or -C options to certain commands
> (diff, show, ...)?

Or set diff.renames in your .gitconfig.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Migrating gcc.c-torture
  2014-07-24  7:12   ` Jakub Jelinek
@ 2014-07-24 17:17     ` Mike Stump
  2014-07-24 17:33       ` Mike Stump
  2014-07-28 22:41     ` Joseph S. Myers
  1 sibling, 1 reply; 16+ messages in thread
From: Mike Stump @ 2014-07-24 17:17 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Andrew Pinski, Bernd Schmidt, GCC Patches

On Jul 24, 2014, at 12:06 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Wed, Jul 23, 2014 at 04:52:23PM -0700, Andrew Pinski wrote:
>>> Comments, objections? Ok to apply the preliminary patch?
>> 
>> Yes, what if you don't move the tests but just change how the .exp to
>> use the same infrastructure as gcc.dg/torture instead?
> 
> Yeah.

I too support upgrade in place.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Migrating gcc.c-torture
  2014-07-24 17:17     ` Mike Stump
@ 2014-07-24 17:33       ` Mike Stump
  0 siblings, 0 replies; 16+ messages in thread
From: Mike Stump @ 2014-07-24 17:33 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Andrew Pinski, Bernd Schmidt, GCC Patches

[ dup, sorry ]

On Jul 24, 2014, at 12:06 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Wed, Jul 23, 2014 at 04:52:23PM -0700, Andrew Pinski wrote:
>>> Comments, objections? Ok to apply the preliminary patch?
>> 
>> Yes, what if you don't move the tests but just change how the .exp to
>> use the same infrastructure as gcc.dg/torture instead?
> 
> Yeah.

I too support upgrade in place.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Migrating gcc.c-torture
  2014-07-24  7:12   ` Jakub Jelinek
  2014-07-24 17:17     ` Mike Stump
@ 2014-07-28 22:41     ` Joseph S. Myers
  2014-08-22 12:19       ` Bernd Schmidt
  1 sibling, 1 reply; 16+ messages in thread
From: Joseph S. Myers @ 2014-07-28 22:41 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Andrew Pinski, Bernd Schmidt, GCC Patches

On Thu, 24 Jul 2014, Jakub Jelinek wrote:

> On Wed, Jul 23, 2014 at 04:52:23PM -0700, Andrew Pinski wrote:
> > > Comments, objections? Ok to apply the preliminary patch?
> > 
> > Yes, what if you don't move the tests but just change how the .exp to
> > use the same infrastructure as gcc.dg/torture instead?
> 
> Yeah.  I believe gcc.c-torture/compile/ has been converted already,
> so it is just about gcc.c-torture/execute/.  Each of these tests has
> it's own default idioms, e.g. -w in by default in gcc.c-torture/.
> So, please just tweak execute.exp, so that it does what it did until now
> (perhaps with the exception of *.x files support) in dg framework, and
> convert *.exp files into dg-* directives in the testcases.

And note that this is bug 20567.  Existing dg-* directive uses in 
gcc.c-torture/execute/ (which are currently ignored) may or may not be 
correct, so they should be reviewed as part of such a migration to decide 
whether they should stay or be removed.  (There aren't that many of them 
to review.)

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Migrating gcc.c-torture
  2014-07-28 22:41     ` Joseph S. Myers
@ 2014-08-22 12:19       ` Bernd Schmidt
  2014-08-22 20:39         ` Mike Stump
  2014-09-05 10:10         ` Thomas Schwinge
  0 siblings, 2 replies; 16+ messages in thread
From: Bernd Schmidt @ 2014-08-22 12:19 UTC (permalink / raw)
  To: Joseph S. Myers, Jakub Jelinek; +Cc: Andrew Pinski, GCC Patches

[-- Attachment #1: Type: text/plain, Size: 3166 bytes --]

On 07/29/2014 12:36 AM, Joseph S. Myers wrote:
> On Thu, 24 Jul 2014, Jakub Jelinek wrote:
>> Yeah.  I believe gcc.c-torture/compile/ has been converted already,
>> so it is just about gcc.c-torture/execute/.  Each of these tests has
>> it's own default idioms, e.g. -w in by default in gcc.c-torture/.

Using -w does not strike me as a feature - ideally we'd like to know if 
we produce new warnings. Almost all of the existing warnings could be 
shut up by adding declarations of abort and exit.

>> So, please just tweak execute.exp, so that it does what it did until now
>> (perhaps with the exception of *.x files support) in dg framework, and
>> convert *.exp files into dg-* directives in the testcases.
>
> And note that this is bug 20567.  Existing dg-* directive uses in
> gcc.c-torture/execute/ (which are currently ignored) may or may not be
> correct, so they should be reviewed as part of such a migration to decide
> whether they should stay or be removed.  (There aren't that many of them
> to review.)

Here's another attempt. I've used a global default of "-w" as in 
c-torture/compile; in testcases that use dg-options (overriding this 
default) I've usually added in declarations of abort and exit to shut up 
the warnings.

Some notes about testcases where the conversion wasn't straightforward:

931004-12.c:
     # xfail this on powerpc-*-darwin, see PR 15923
In the PR, we first see a note that the test has been xfailed, then 
later we see a "Fixed". I've decided not to keep the xfail.

cvt-1.c:
Has a dubious comment about the test failing on d10v without 32 bit 
ints. Since that would indicate a bug in the target, and the target was 
removed anyway (or never added - can't find any other mention of it), 
decided not to keep the xfail.

20030125-1.x:
Uses a test for *linux*, *gnu* or uclibc to identify whether the target 
supports C99 library functions. Replaced with require-effective-target 
c99_runtime.

990413-2.c:
Says the test is x86 specific. Not moved to gcc.target however, in order 
to keep it running with all torture options.

20111227-[23].c:
Wants to examing optimizer log files (which presumably doesn't do 
anything when run in current c-torture), and wants to run at only one 
optimization level. Moved to gcc.dg and added -free since it is not 
enabled at -O.

20010129-1.c:
Has some tcl code that modifies options on i686 based on whether -m64 is 
specified. As a translation I've used
/* { dg-options "-mtune-i686" { target { { i?86*-*-* } && ilp32 } } } */
which I think should do the same thing.

920710-1.x:
Claims h8300 does not have long long. The .x file predates a checkin 
that makes LONG_LONG_TYPE_SIZE 64 on h8300. Decided not to keep this.

pr53366-1.x:
No corresponding test exists (there are tests with that name in 
dg/torture and target/i386).

These are the changes on x86_64-linux:

                 === gcc Summary ===

-# of expected passes           199892
+# of expected passes           199844
  # of unexpected failures       247
  # of unexpected successes      54
  # of expected failures         526
-# of unsupported tests         3487
+# of unsupported tests         3495

Ok?


Bernd

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: execute.diff --]
[-- Type: text/x-patch; name="execute.diff", Size: 66237 bytes --]

diff --git a/gcc/testsuite/gcc.c-torture/execute/20010122-1.c b/gcc/testsuite/gcc.c-torture/execute/20010122-1.c
index 280e3d4..14269fa 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20010122-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20010122-1.c
@@ -1,3 +1,4 @@
+/* { dg-skip-if "requires frame pointers" { *-*-* } "-fomit-frame-pointer" "" } */
 
 extern void exit (int);
 extern void abort (void);
diff --git a/gcc/testsuite/gcc.c-torture/execute/20010122-1.x b/gcc/testsuite/gcc.c-torture/execute/20010122-1.x
deleted file mode 100644
index 6558236..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/20010122-1.x
+++ /dev/null
@@ -1,11 +0,0 @@
-# This test relies on __builtin_return_address(1) returning something
-# useful or NULL.  This is not guaranteed to be be so, especially when 
-# -fomit-frame-pointer is used.  So do not test with it.
-
-set torture_eval_before_compile {
-  if {[string match {*-fomit-frame-pointer*} "$option"]} {
-    continue
-  }
-}
-
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/20010129-1.c b/gcc/testsuite/gcc.c-torture/execute/20010129-1.c
index a4ea5e4..0586577 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20010129-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20010129-1.c
@@ -1,3 +1,5 @@
+/* { dg-options "-mtune-i686" { target { { i?86*-*-* } && ilp32 } } } */
+
 long baz1 (void *a)
 {
   static long l;
diff --git a/gcc/testsuite/gcc.c-torture/execute/20010129-1.x b/gcc/testsuite/gcc.c-torture/execute/20010129-1.x
deleted file mode 100644
index 7e474c4..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/20010129-1.x
+++ /dev/null
@@ -1,13 +0,0 @@
-# Use "-mtune=i686" on i?86-*-* unless "-m64" is specified.
-if { [istarget "i?86-*-*"] } {
-  set target_name [target_info name]
-  if {[board_info $target_name exists multilib_flags]} {
-    set multilib_flags [board_info $target_name multilib_flags]
-    if { ![regexp -- "-m64" $multilib_flags] } {
-      set additional_flags "-mtune=i686"
-    }
-  } else {
-    set additional_flags "-mtune=i686"
-  }
-}
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/20020404-1.c b/gcc/testsuite/gcc.c-torture/execute/20020404-1.c
index dc62b15..fe5ea14 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20020404-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20020404-1.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target int32plus } */
+/* { dg-skip-if "pointers can be truncated" { m32c-*-* } "*" "" } */
 /* Extracted from GDB sources. */
 
 typedef long long bfd_signed_vma;
diff --git a/gcc/testsuite/gcc.c-torture/execute/20020404-1.x b/gcc/testsuite/gcc.c-torture/execute/20020404-1.x
deleted file mode 100644
index e4fd61a..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/20020404-1.x
+++ /dev/null
@@ -1,15 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int16] } {
-	return 1
-}
-
-# m32c pointers can be 24 bits in a 32 bit variable, so the test
-# patterns may get truncated.
-if { [istarget "m32c-*-*"] } {
-	return 1
-}
-
-
-return 0
-
diff --git a/gcc/testsuite/gcc.c-torture/execute/20021024-1.c b/gcc/testsuite/gcc.c-torture/execute/20021024-1.c
index f7d98e9..93504f2 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20021024-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20021024-1.c
@@ -1,4 +1,5 @@
 /* Origin: PR target/6981 from Mattias Engdegaard <mattias@virtutech.se>.  */
+/* { dg-require-effective-target int32plus } */
 
 void exit (int);
 void abort (void);
diff --git a/gcc/testsuite/gcc.c-torture/execute/20021024-1.x b/gcc/testsuite/gcc.c-torture/execute/20021024-1.x
deleted file mode 100644
index 121fcfe..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/20021024-1.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int16] } {
-	return 1
-}
-
-return 0;
diff --git a/gcc/testsuite/gcc.c-torture/execute/20021127-1.c b/gcc/testsuite/gcc.c-torture/execute/20021127-1.c
index 0b3ff9a..204305b 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20021127-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20021127-1.c
@@ -1,3 +1,5 @@
+/* { dg-options "-std=c99" } */
+
 long long a = -1;
 long long llabs (long long);
 void abort (void);
diff --git a/gcc/testsuite/gcc.c-torture/execute/20021127-1.x b/gcc/testsuite/gcc.c-torture/execute/20021127-1.x
deleted file mode 100644
index efd854a..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/20021127-1.x
+++ /dev/null
@@ -1,2 +0,0 @@
-set additional_flags "-std=c99"
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/20030125-1.c b/gcc/testsuite/gcc.c-torture/execute/20030125-1.c
index 28cfbd1..60ede34 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20030125-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20030125-1.c
@@ -1,4 +1,5 @@
 /* Verify whether math functions are simplified.  */
+/* { dg-require-effective-target c99_runtime } */
 double sin(double);
 double floor(double);
 float 
diff --git a/gcc/testsuite/gcc.c-torture/execute/20030125-1.x b/gcc/testsuite/gcc.c-torture/execute/20030125-1.x
deleted file mode 100644
index 895cff7..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/20030125-1.x
+++ /dev/null
@@ -1,7 +0,0 @@
-# Only glibc includes all c99 functions at the moment.
-if { ! ([istarget "*-linux*"]
-	|| [istarget "*-gnu*"])} then {
-    return 1
-}
-if { [check_effective_target_uclibc] } { return 1 }
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/20030216-1.c b/gcc/testsuite/gcc.c-torture/execute/20030216-1.c
index 2153bfd..0256ae3 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20030216-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20030216-1.c
@@ -1,3 +1,8 @@
+/* This test requires constant propagation of loads and stores to be
+   enabled.  This is only guaranteed at -O2 and higher.  Do not run
+   at -O1.  */
+/* { dg-skip-if "requires higher optimization" { *-*-* } "-O1" "" } */
+
 void link_error (void);
 const double one=1.0;
 main ()
diff --git a/gcc/testsuite/gcc.c-torture/execute/20030216-1.x b/gcc/testsuite/gcc.c-torture/execute/20030216-1.x
deleted file mode 100644
index a0e03e3..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/20030216-1.x
+++ /dev/null
@@ -1,12 +0,0 @@
-# This test requires constant propagation of loads and stores to be
-# enabled.  This is only guaranteed at -O2 and higher.  Do not run
-# at -O1.
-
-set torture_eval_before_compile {
-  if {[string match {*-O1*} "$option"]} {
-    continue
-  }
-}
-
-return 0
-
diff --git a/gcc/testsuite/gcc.c-torture/execute/20030222-1.c b/gcc/testsuite/gcc.c-torture/execute/20030222-1.c
index 93d1e3c..385ae68 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20030222-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20030222-1.c
@@ -3,7 +3,7 @@
    succeeded at all.  We use volatile to make sure the long long is
    actually truncated to int, in case a single register is wide enough
    for a long long.  */
-
+/* { dg-skip-if "asm would require extra shift-left-4-byte" { spu-*-* } "*" "" } */
 #include <limits.h>
 
 void
diff --git a/gcc/testsuite/gcc.c-torture/execute/20030222-1.x b/gcc/testsuite/gcc.c-torture/execute/20030222-1.x
deleted file mode 100644
index e195563..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/20030222-1.x
+++ /dev/null
@@ -1,6 +0,0 @@
-if [istarget "spu-*-*"] {
-    # Using inline assembly to convert long long to int is not working quite
-    # right # on the SPU.  An extra shift-left-4-byte is needed.
-    return 1
-}
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/20040629-1.c b/gcc/testsuite/gcc.c-torture/execute/20040629-1.c
index 6b3e906..5e03222 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20040629-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20040629-1.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target int32plus } */
+
 /* Test arithmetics on bitfields.  */
 #ifndef T
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/20040629-1.x b/gcc/testsuite/gcc.c-torture/execute/20040629-1.x
deleted file mode 100644
index 121fcfe..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/20040629-1.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int16] } {
-	return 1
-}
-
-return 0;
diff --git a/gcc/testsuite/gcc.c-torture/execute/20040703-1.c b/gcc/testsuite/gcc.c-torture/execute/20040703-1.c
index eba358d..a1b75d9 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20040703-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20040703-1.c
@@ -1,4 +1,5 @@
 /* PR 16341 */
+/* { dg-require-effective-target int32plus } */
 
 #define PART_PRECISION (sizeof (cpp_num_part) * 8)
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/20040703-1.x b/gcc/testsuite/gcc.c-torture/execute/20040703-1.x
deleted file mode 100644
index 121fcfe..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/20040703-1.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int16] } {
-	return 1
-}
-
-return 0;
diff --git a/gcc/testsuite/gcc.c-torture/execute/20040705-1.c b/gcc/testsuite/gcc.c-torture/execute/20040705-1.c
index a9ba88e..fe14d0f 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20040705-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20040705-1.c
@@ -1,2 +1,4 @@
+/* { dg-require-effective-target int32plus } */
+
 #define FIELDS1 long long l;
 #include "20040629-1.c"
diff --git a/gcc/testsuite/gcc.c-torture/execute/20040705-1.x b/gcc/testsuite/gcc.c-torture/execute/20040705-1.x
deleted file mode 100644
index 121fcfe..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/20040705-1.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int16] } {
-	return 1
-}
-
-return 0;
diff --git a/gcc/testsuite/gcc.c-torture/execute/20040705-2.c b/gcc/testsuite/gcc.c-torture/execute/20040705-2.c
index a36fb6a..1d69586 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20040705-2.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20040705-2.c
@@ -1,2 +1,3 @@
+/* { dg-require-effective-target int32plus } */
 #define FIELDS2 long long l;
 #include "20040629-1.c"
diff --git a/gcc/testsuite/gcc.c-torture/execute/20040705-2.x b/gcc/testsuite/gcc.c-torture/execute/20040705-2.x
deleted file mode 100644
index 121fcfe..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/20040705-2.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int16] } {
-	return 1
-}
-
-return 0;
diff --git a/gcc/testsuite/gcc.c-torture/execute/20040709-1.c b/gcc/testsuite/gcc.c-torture/execute/20040709-1.c
index 455313a..52de67d 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20040709-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20040709-1.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target int32plus } */
+
 /* Test arithmetics on bitfields.  */
 
 extern void abort (void);
diff --git a/gcc/testsuite/gcc.c-torture/execute/20040709-1.x b/gcc/testsuite/gcc.c-torture/execute/20040709-1.x
deleted file mode 100644
index 121fcfe..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/20040709-1.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int16] } {
-	return 1
-}
-
-return 0;
diff --git a/gcc/testsuite/gcc.c-torture/execute/20040709-2.c b/gcc/testsuite/gcc.c-torture/execute/20040709-2.c
index 6ae1f2d..925050d 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20040709-2.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20040709-2.c
@@ -1,4 +1,5 @@
 /* Test arithmetics on bitfields.  */
+/* { dg-require-effective-target int32plus } */
 
 extern void abort (void);
 extern void exit (int);
diff --git a/gcc/testsuite/gcc.c-torture/execute/20040709-2.x b/gcc/testsuite/gcc.c-torture/execute/20040709-2.x
deleted file mode 100644
index 121fcfe..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/20040709-2.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int16] } {
-	return 1
-}
-
-return 0;
diff --git a/gcc/testsuite/gcc.c-torture/execute/20040811-1.c b/gcc/testsuite/gcc.c-torture/execute/20040811-1.c
index 62f377a..0122825 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20040811-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20040811-1.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target int32plus } */
+
 /* Ensure that we deallocate X when branching back before its
    declaration.  */
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/20040811-1.x b/gcc/testsuite/gcc.c-torture/execute/20040811-1.x
deleted file mode 100644
index 121fcfe..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/20040811-1.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int16] } {
-	return 1
-}
-
-return 0;
diff --git a/gcc/testsuite/gcc.c-torture/execute/20050316-1.c b/gcc/testsuite/gcc.c-torture/execute/20050316-1.c
index 2a1c625..0a285d7 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20050316-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20050316-1.c
@@ -1,4 +1,6 @@
 /* PR rtl-optimization/16104 */
+/* { dg-require-effective-target int32plus } */
+/* { dg-options "-Wno-psabi" } */
 
 extern void abort (void);
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/20050316-1.x b/gcc/testsuite/gcc.c-torture/execute/20050316-1.x
deleted file mode 100644
index cb2d28f..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/20050316-1.x
+++ /dev/null
@@ -1,8 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int16] } {
-	return 1
-}
-
-set additional_flags "-Wno-psabi"
-return 0;
diff --git a/gcc/testsuite/gcc.c-torture/execute/20050316-2.c b/gcc/testsuite/gcc.c-torture/execute/20050316-2.c
index c648777..920dfdb 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20050316-2.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20050316-2.c
@@ -1,3 +1,8 @@
+/* This testcase generates MMX instructions together with x87 instructions.
+   Currently, there is no "emms" generated to switch between register sets,
+   so the testcase fails for targets where MMX insns are enabled.  */
+/* { dg-options "-mno-mmx -Wno-psabi" { target { x86_64-*-* i?86-*-* } } } */
+
 extern void abort (void);
 
 typedef int V2SI __attribute__ ((vector_size (8)));
diff --git a/gcc/testsuite/gcc.c-torture/execute/20050316-2.x b/gcc/testsuite/gcc.c-torture/execute/20050316-2.x
deleted file mode 100644
index f5b4aaa..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/20050316-2.x
+++ /dev/null
@@ -1,9 +0,0 @@
-# This testcase generates MMX instructions together with x87 instructions.
-# Currently, there is no "emms" generated to switch between register sets,
-# so the testcase fails for targets where MMX insns are enabled.
-
-if { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } {
-	set additional_flags "-mno-mmx"
-}
-
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/20050316-3.c b/gcc/testsuite/gcc.c-torture/execute/20050316-3.c
index 773243f..9f35ece 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20050316-3.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20050316-3.c
@@ -1,3 +1,4 @@
+/* { dg-options "-Wno-psabi" } */
 extern void abort (void);
 
 typedef int V2SI __attribute__ ((vector_size (8)));
diff --git a/gcc/testsuite/gcc.c-torture/execute/20050316-3.x b/gcc/testsuite/gcc.c-torture/execute/20050316-3.x
deleted file mode 100644
index cb7b119..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/20050316-3.x
+++ /dev/null
@@ -1,2 +0,0 @@
-set additional_flags "-Wno-psabi"
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/20050604-1.c b/gcc/testsuite/gcc.c-torture/execute/20050604-1.c
index 70097aa..6d63389 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20050604-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20050604-1.c
@@ -1,4 +1,8 @@
 /* PR regression/21897 */
+/* This testcase generates MMX instructions together with x87 instructions.
+   Currently, there is no "emms" generated to switch between register sets,
+   so the testcase fails for targets where MMX insns are enabled.  */
+/* { dg-options "-mno-mmx" { target { x86_64-*-* i?86-*-* } } } */
 
 extern void abort (void);
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/20050604-1.x b/gcc/testsuite/gcc.c-torture/execute/20050604-1.x
deleted file mode 100644
index 756242d..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/20050604-1.x
+++ /dev/null
@@ -1,10 +0,0 @@
-# This testcase generates MMX instructions together with x87 instructions.
-# Currently, there is no "emms" generated to switch between register sets,
-# so the testcase fails for targets where MMX insns are enabled.
-
-if { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } {
-	set additional_flags "-mno-mmx"
-}
-
-set additional_flags "-Wno-psabi"
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/20061101-1.c b/gcc/testsuite/gcc.c-torture/execute/20061101-1.c
index 2351728..7bea079 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20061101-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20061101-1.c
@@ -1,5 +1,6 @@
 /* PR rtl-optimization/28970 */
 /* Origin: Peter Bergner <bergner@vnet.ibm.com> */
+/* { dg-require-effective-target int32plus } */
 
 extern void abort (void);
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/20061101-1.x b/gcc/testsuite/gcc.c-torture/execute/20061101-1.x
deleted file mode 100644
index 4efed4c..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/20061101-1.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int32plus] } {
-	return 0
-}
-
-return 1;
diff --git a/gcc/testsuite/gcc.c-torture/execute/20061220-1.c b/gcc/testsuite/gcc.c-torture/execute/20061220-1.c
index 188f92c..9a133e8 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20061220-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20061220-1.c
@@ -1,4 +1,5 @@
 /* PR middle-end/30262 */
+/* { dg-skip-if "asm statements do not work as expected" { rl78-*-* } "*" "" } */
 extern void abort (void);
 
 int
diff --git a/gcc/testsuite/gcc.c-torture/execute/20061220-1.x b/gcc/testsuite/gcc.c-torture/execute/20061220-1.x
deleted file mode 100644
index bfc4e96..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/20061220-1.x
+++ /dev/null
@@ -1,6 +0,0 @@
-# asm statements for the RL78 do not work as expected
-if { [istarget "rl78-*-*"] } {
-        return 1;
-}
-
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/20081117-1.c b/gcc/testsuite/gcc.c-torture/execute/20081117-1.c
index bff7464..8fa00d2 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20081117-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20081117-1.c
@@ -1,3 +1,4 @@
+/* { dg-require-effective-target int32plus } */
 extern void abort (void);
 
 struct s
diff --git a/gcc/testsuite/gcc.c-torture/execute/20081117-1.x b/gcc/testsuite/gcc.c-torture/execute/20081117-1.x
deleted file mode 100644
index 7378270..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/20081117-1.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int16] } {
-        return 1
-}
-
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/20101011-1.c b/gcc/testsuite/gcc.c-torture/execute/20101011-1.c
index 9299bb9..85b910d 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20101011-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20101011-1.c
@@ -1,5 +1,5 @@
-/* With -fnon-call-exceptions 0 / 0 should not be eliminated.  The .x
-   file sets the option.  */
+/* { dg-options "-fnon-call-exceptions" } */
+/* With -fnon-call-exceptions 0 / 0 should not be eliminated.  */
 
 #ifdef SIGNAL_SUPPRESS
 # define DO_TEST 0
@@ -75,6 +75,9 @@ __aeabi_idiv0 (int return_value)
 # define DO_TEST 1
 #endif
 
+extern void abort (void);
+extern void exit (int);
+
 #if DO_TEST
 
 #include <signal.h>
diff --git a/gcc/testsuite/gcc.c-torture/execute/20101011-1.x b/gcc/testsuite/gcc.c-torture/execute/20101011-1.x
deleted file mode 100644
index b5c080d..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/20101011-1.x
+++ /dev/null
@@ -1,2 +0,0 @@
-set additional_flags "-fnon-call-exceptions"
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/20120919-1.c b/gcc/testsuite/gcc.c-torture/execute/20120919-1.c
index e7f3295..afcde95 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20120919-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20120919-1.c
@@ -1,5 +1,6 @@
 /* PR rtl-optimization/54290 */
 /* Testcase by Eric Volk <eriksnga@gmail.com> */
+/* { dg-require-effective-target int32plus } */
 
 double vd[2] = {1., 0.};
 int vi[2] = {1234567890, 0};
diff --git a/gcc/testsuite/gcc.c-torture/execute/20120919-1.x b/gcc/testsuite/gcc.c-torture/execute/20120919-1.x
deleted file mode 100644
index 4efed4c..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/20120919-1.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int32plus] } {
-	return 0
-}
-
-return 1;
diff --git a/gcc/testsuite/gcc.c-torture/execute/920612-1.c b/gcc/testsuite/gcc.c-torture/execute/920612-1.c
index a70c0d2..bc63003 100644
--- a/gcc/testsuite/gcc.c-torture/execute/920612-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/920612-1.c
@@ -1,2 +1,7 @@
+/* { dg-options "-fwrapv" } */
+
+extern void abort (void);
+extern void exit (int);
+
 f(j)int j;{return++j>0;}
 main(){if(f((~0U)>>1))abort();exit(0);}
diff --git a/gcc/testsuite/gcc.c-torture/execute/920612-1.x b/gcc/testsuite/gcc.c-torture/execute/920612-1.x
deleted file mode 100644
index 36a5839..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/920612-1.x
+++ /dev/null
@@ -1,2 +0,0 @@
-set additional_flags "-fwrapv"
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/920710-1.x b/gcc/testsuite/gcc.c-torture/execute/920710-1.x
deleted file mode 100644
index b7612f7..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/920710-1.x
+++ /dev/null
@@ -1,6 +0,0 @@
-# h8300 does not have long long
-if { [istarget "h8300-*-*"] } {
-        return 1;
-}
-
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/920711-1.c b/gcc/testsuite/gcc.c-torture/execute/920711-1.c
index aa83452..f72ef7c 100644
--- a/gcc/testsuite/gcc.c-torture/execute/920711-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/920711-1.c
@@ -1,2 +1,7 @@
+/* { dg-options "-fwrapv" } */
+
+extern void abort (void);
+extern void exit (int);
+
 f(long a){return (--a > 0);}
 main(){if(f(0x80000000L)==0)abort();exit(0);}
diff --git a/gcc/testsuite/gcc.c-torture/execute/920711-1.x b/gcc/testsuite/gcc.c-torture/execute/920711-1.x
deleted file mode 100644
index 36a5839..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/920711-1.x
+++ /dev/null
@@ -1,2 +0,0 @@
-set additional_flags "-fwrapv"
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/930529-1.c b/gcc/testsuite/gcc.c-torture/execute/930529-1.c
index 906338e..9c4085c 100644
--- a/gcc/testsuite/gcc.c-torture/execute/930529-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/930529-1.c
@@ -1,3 +1,8 @@
+/* { dg-options { "-fwrapv" } } */
+
+extern void abort (void);
+extern void exit (int);
+
 dd (x,d) { return x / d; }
 
 main ()
diff --git a/gcc/testsuite/gcc.c-torture/execute/930529-1.x b/gcc/testsuite/gcc.c-torture/execute/930529-1.x
deleted file mode 100644
index 25225f4..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/930529-1.x
+++ /dev/null
@@ -1,24 +0,0 @@
-# The problem on Alpha at -O3 is that when dd is inlined, we have
-# division by a constant, which gets converted to multiplication
-# by a large constant, which gets turned into an induction variable.
-# The problem is that the multiplication was unsigned SImode, and the
-# induction variable is DImode, and we lose the truncation that
-# should have happened.
-#
-# On tree-ssa branch, the loop problem is still extant, but the
-# gimple-level optimization makes it easy for the tree-rtl expanders
-# to see that the comparisons are always true, and so the loop code
-# is never exercized.
-
-# set torture_eval_before_execute {
-# 
-#     set compiler_conditional_xfail_data {
-#         "division by a constant conflicts with strength reduction" \
-#         "alpha*-*-*" \
-#         { "-O3" } \
-#         { "" }
-#     }
-# }
-
-set additional_flags "-fwrapv"
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/931004-12.x b/gcc/testsuite/gcc.c-torture/execute/931004-12.x
deleted file mode 100644
index 591dc7f..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/931004-12.x
+++ /dev/null
@@ -1,6 +0,0 @@
-if { [istarget "powerpc-*-darwin*] } {
-    # xfail this on powerpc-*-darwin, see PR 15923
-    set torture_execute_xfail [istarget]
-}
-
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/980709-1.c b/gcc/testsuite/gcc.c-torture/execute/980709-1.c
index cda8076..54b3bbc 100644
--- a/gcc/testsuite/gcc.c-torture/execute/980709-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/980709-1.c
@@ -1,3 +1,4 @@
+/* { dg-xfail-if "Can not call system libm.a with -msoft-float" { powerpc-*-aix* rs6000-*-aix* } { "-msoft-float" } { "" } } */
 #include <math.h>
 
 main()
diff --git a/gcc/testsuite/gcc.c-torture/execute/980709-1.x b/gcc/testsuite/gcc.c-torture/execute/980709-1.x
deleted file mode 100644
index 307f568..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/980709-1.x
+++ /dev/null
@@ -1,16 +0,0 @@
-# XFAIL this test for AIX using -msoft-float.
-# This test calls the system libm.a function pow.
-# A false failure is reported if -msoft-float is used.
-# AIX expects the parameters to be passed in fp regs. 
-if { [istarget powerpc-*-aix*] || [istarget rs6000-*-aix*] } {
-    set torture_eval_before_execute {
-	global compiler_conditional_xfail_data
-	set compiler_conditional_xfail_data {
-	    "Can not call system libm.a with -msoft-float" \
-		    "*-*-aix*" \
-		    { "-msoft-float" } \
-		    { "" }
-	}
-    }
-}
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/981130-1.c b/gcc/testsuite/gcc.c-torture/execute/981130-1.c
index 72630b0..c4ca227 100644
--- a/gcc/testsuite/gcc.c-torture/execute/981130-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/981130-1.c
@@ -1,3 +1,4 @@
+/* { dg-xfail-if "alias analysis conflicts with instruction scheduling" { m32r-*-* } { "-O2" "-O1" "-O0" "-Os"} { "" } } */
 struct s { int a; int b;};
 struct s s1;
 struct s s2 = { 1, 2, };
diff --git a/gcc/testsuite/gcc.c-torture/execute/981130-1.x b/gcc/testsuite/gcc.c-torture/execute/981130-1.x
deleted file mode 100644
index 1565c68..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/981130-1.x
+++ /dev/null
@@ -1,22 +0,0 @@
-# This test is known to fail on targets that use the instruction scheduler
-# at optimisation levels of 2 or more because the alias analysis is confused
-# by the reassignment of a variable structure to a fixed structure.  The 
-# failure could be suppressed by preventing instruction scheduling:
-#
-# set additional_flags "-fno-schedule-insns2";
-#
-# but this would disguise the fact that there is a problem.  Instead we use
-# we generate an xfail result and explain that it is alias analysis that
-# is at fault.
-
-set torture_eval_before_execute {
-
-    set compiler_conditional_xfail_data {
-        "alias analysis conflicts with instruction scheduling" \
-	"m32r-*-*" \
-	{ "-O2" "-O1" "-O0" "-Os"} \
-	{ "" }
-	}    
-}
-
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/990127-1.c b/gcc/testsuite/gcc.c-torture/execute/990127-1.c
index c495848..8b572a7 100644
--- a/gcc/testsuite/gcc.c-torture/execute/990127-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/990127-1.c
@@ -1,3 +1,6 @@
+extern void abort (void);
+extern void exit (int);
+
 main()
 {
     int a,b,c;
diff --git a/gcc/testsuite/gcc.c-torture/execute/990127-2.c b/gcc/testsuite/gcc.c-torture/execute/990127-2.c
index 0d0f495..e87d27a 100644
--- a/gcc/testsuite/gcc.c-torture/execute/990127-2.c
+++ b/gcc/testsuite/gcc.c-torture/execute/990127-2.c
@@ -1,3 +1,8 @@
+/* { dg-options "-mpc64"  { target { i?86-*-* x86_64-*-* } } } */
+
+extern void abort (void);
+extern void exit (int);
+
 void
 fpEq (double x, double y)
 {
diff --git a/gcc/testsuite/gcc.c-torture/execute/990127-2.x b/gcc/testsuite/gcc.c-torture/execute/990127-2.x
deleted file mode 100644
index 501e931..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/990127-2.x
+++ /dev/null
@@ -1,20 +0,0 @@
-# On x86 targets, two floating-point double values can't be reliably compared
-# for inequality due to excess precision of 80387 floating-point coprocessor.
-# Use -mpc64 to force 80387 floating-point precision to 64 bits.  This option
-# has no effect on SSE, but it is needed in case of -m32 on x86_64 targets.
-
-if { [istarget i?86-*-darwin*]
-     || [istarget i?86-*-linux*]
-     || [istarget i?86-*-gnu*]
-     || [istarget i?86-*-kfreebsd*-gnu]
-     || [istarget i?86-*-knetbsd*-gnu]
-     || [istarget i?86-*-solaris2*]
-     || [istarget x86_64-*-darwin*]
-     || [istarget x86_64-*-linux*]
-     || [istarget x86_64-*-kfreebsd*-gnu]
-     || [istarget x86_64-*-knetbsd*-gnu]
-     || [istarget x86_64-*-solaris2*] } {
-	set additional_flags "-mpc64"
-}
-
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/990413-2.c b/gcc/testsuite/gcc.c-torture/execute/990413-2.c
index 262140a..3beb540 100644
--- a/gcc/testsuite/gcc.c-torture/execute/990413-2.c
+++ b/gcc/testsuite/gcc.c-torture/execute/990413-2.c
@@ -1,4 +1,5 @@
 /* This tests for a bug in regstack that was breaking glibc's math library. */
+/* { dg-skip-if "" { ! { i?86-*-* x86_64-*-* } } { "*" } { "" } } */
 
 extern void abort (void);
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/990413-2.x b/gcc/testsuite/gcc.c-torture/execute/990413-2.x
deleted file mode 100644
index 58be1c0..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/990413-2.x
+++ /dev/null
@@ -1,3 +0,0 @@
-# This test is x86 specific.
-if { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } { return 0 }
-return 1
diff --git a/gcc/testsuite/gcc.c-torture/execute/990826-0.c b/gcc/testsuite/gcc.c-torture/execute/990826-0.c
index 2807ea3..c630da7 100644
--- a/gcc/testsuite/gcc.c-torture/execute/990826-0.c
+++ b/gcc/testsuite/gcc.c-torture/execute/990826-0.c
@@ -6,6 +6,8 @@ Date: Sun, 06 Jun 1999 23:37:23 -0400
 X-UIDL: 9c1e40c572e3b306464f703461764cd5
 */
 
+/* { dg-xfail-if "Can not call system libm.a with -msoft-float" { powerpc-*-aix* rs6000-*-aix* } { "-msoft-float" } { "" } } */
+
 #include <stdio.h>
 #include <math.h>
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/990826-0.x b/gcc/testsuite/gcc.c-torture/execute/990826-0.x
deleted file mode 100644
index 477c10b..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/990826-0.x
+++ /dev/null
@@ -1,16 +0,0 @@
-# XFAIL this test for AIX using -msoft-float.
-# This test calls the system libm.a function floor.
-# A false failure is reported if -msoft-float is used.
-# AIX expects the parameters to be passed in fp regs. 
-if { [istarget powerpc-*-aix*] || [istarget rs6000-*-aix*] } {
-    set torture_eval_before_execute {
-	global compiler_conditional_xfail_data
-	set compiler_conditional_xfail_data {
-	    "Can not call system libm.a with -msoft-float" \
-		    "*-*-aix*" \
-		    { "-msoft-float" } \
-		    { "" }
-	}
-    }
-}
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/bf64-1.c b/gcc/testsuite/gcc.c-torture/execute/bf64-1.c
index 60028fb..d69a7c4 100644
--- a/gcc/testsuite/gcc.c-torture/execute/bf64-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/bf64-1.c
@@ -1,3 +1,4 @@
+/* { dg-xfail-if "ABI specifies bitfields cannot exceed 32 bits" { mcore-*-* } "*" "" } */
 struct tmp
 {
   long long int pad : 12;
diff --git a/gcc/testsuite/gcc.c-torture/execute/bf64-1.x b/gcc/testsuite/gcc.c-torture/execute/bf64-1.x
deleted file mode 100644
index f3069f2..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/bf64-1.x
+++ /dev/null
@@ -1,8 +0,0 @@
-# The MCore ABI specifies that bitfields may not exceed 32 bits.
-# Hence this tes will fail.
-
-if { [istarget "mcore-*-*"] } {
-	set torture_execute_xfail "mcore-*-*"
-}
-
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/bitfld-4.c b/gcc/testsuite/gcc.c-torture/execute/bitfld-4.c
index 6f7d7e2..13a5c69 100644
--- a/gcc/testsuite/gcc.c-torture/execute/bitfld-4.c
+++ b/gcc/testsuite/gcc.c-torture/execute/bitfld-4.c
@@ -6,6 +6,8 @@
    32-bit systems.  */
 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
 
+/* { dg-require-effective-target int32plus } */
+
 extern void abort (void);
 
 struct s { int a:12, b:20; };
diff --git a/gcc/testsuite/gcc.c-torture/execute/bitfld-4.x b/gcc/testsuite/gcc.c-torture/execute/bitfld-4.x
deleted file mode 100644
index 121fcfe..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/bitfld-4.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int16] } {
-	return 1
-}
-
-return 0;
diff --git a/gcc/testsuite/gcc.c-torture/execute/cmpsi-2.c b/gcc/testsuite/gcc.c-torture/execute/cmpsi-2.c
index 62832a9..52c8065 100644
--- a/gcc/testsuite/gcc.c-torture/execute/cmpsi-2.c
+++ b/gcc/testsuite/gcc.c-torture/execute/cmpsi-2.c
@@ -1,3 +1,4 @@
+/* { dg-require-effective-target int32plus } */
 #define F 140
 #define T 13
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/cmpsi-2.x b/gcc/testsuite/gcc.c-torture/execute/cmpsi-2.x
deleted file mode 100644
index 121fcfe..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/cmpsi-2.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int16] } {
-	return 1
-}
-
-return 0;
diff --git a/gcc/testsuite/gcc.c-torture/execute/cvt-1.x b/gcc/testsuite/gcc.c-torture/execute/cvt-1.x
deleted file mode 100644
index 997c865..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/cvt-1.x
+++ /dev/null
@@ -1,7 +0,0 @@
-# This doesn't work on d10v if ints are not 32 bits
-
-if { [istarget "d10v-*-*"] && ! [string-match "*-mint32*" $CFLAGS] } {
-	set torture_execute_xfail "d10v-*-*"
-}
-
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/eeprof-1.c b/gcc/testsuite/gcc.c-torture/execute/eeprof-1.c
index 248b8cc..96dab9a 100644
--- a/gcc/testsuite/gcc.c-torture/execute/eeprof-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/eeprof-1.c
@@ -1,3 +1,8 @@
+/* { dg-options "-finstrument-functions" } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } "*" "" } */
+
+extern void abort (void);
+
 #define ASSERT(X)	if (!(X)) abort ();
 #define NOCHK __attribute__ ((no_instrument_function))
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/eeprof-1.x b/gcc/testsuite/gcc.c-torture/execute/eeprof-1.x
deleted file mode 100644
index d53f8c2..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/eeprof-1.x
+++ /dev/null
@@ -1,5 +0,0 @@
-if { [istarget "powerpc-ibm-aix*"] } {
-        set torture_execute_xfail "powerpc-ibm-aix*"
-}
-set additional_flags "-finstrument-functions"
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/execute.exp b/gcc/testsuite/gcc.c-torture/execute/execute.exp
index 9f29ef2..886bd05 100644
--- a/gcc/testsuite/gcc.c-torture/execute/execute.exp
+++ b/gcc/testsuite/gcc.c-torture/execute/execute.exp
@@ -22,28 +22,17 @@
 # C torture test suite.
 #
 
-if $tracelevel then {
-    strace $tracelevel
-}
+# Load support procs.
+load_lib gcc-dg.exp
 
-# load support procs
-load_lib torture-options.exp
-load_lib c-torture.exp
+# Initialize `dg'.
+dg-init
 
-torture-init
-set-torture-options $C_TORTURE_OPTIONS {{}} $LTO_TORTURE_OPTIONS
+# Main loop.
+set saved-dg-do-what-default ${dg-do-what-default}
+set dg-do-what-default "run"
+gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "" "-w"
+set dg-do-what-default ${saved-dg-do-what-default}
 
-#
-# main test loop
-#
-
-foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c]] {
-    # If we're only testing specific files and this isn't one of them, skip it.
-    if ![runtest_file_p $runtests $src] then {
-	continue
-    }
-
-    c-torture-execute $src
-}
-
-torture-finish
+# All done.
+dg-finish
diff --git a/gcc/testsuite/gcc.c-torture/execute/ipa-sra-2.c b/gcc/testsuite/gcc.c-torture/execute/ipa-sra-2.c
index 515d416..feb2a34 100644
--- a/gcc/testsuite/gcc.c-torture/execute/ipa-sra-2.c
+++ b/gcc/testsuite/gcc.c-torture/execute/ipa-sra-2.c
@@ -1,3 +1,4 @@
+/* { dg-require-effective-target int32plus } */
 struct big
 {
   int data[1000000];
diff --git a/gcc/testsuite/gcc.c-torture/execute/ipa-sra-2.x b/gcc/testsuite/gcc.c-torture/execute/ipa-sra-2.x
deleted file mode 100644
index c65423e..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/ipa-sra-2.x
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib target-supports.exp
-
-return  [expr [check_effective_target_int16 ]] 
diff --git a/gcc/testsuite/gcc.c-torture/execute/loop-2f.c b/gcc/testsuite/gcc.c-torture/execute/loop-2f.c
index 4803d64..539db4b 100644
--- a/gcc/testsuite/gcc.c-torture/execute/loop-2f.c
+++ b/gcc/testsuite/gcc.c-torture/execute/loop-2f.c
@@ -1,3 +1,6 @@
+/* { dg-require-effective-target mmap } */
+/* { dg-skip-if "the executable is at the same position the test tries to remap" { m68k-*-linux* } { "*" } { "" } } */
+
 #include <limits.h>
 
 #include <sys/types.h>
diff --git a/gcc/testsuite/gcc.c-torture/execute/loop-2f.x b/gcc/testsuite/gcc.c-torture/execute/loop-2f.x
deleted file mode 100644
index ad024dd..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/loop-2f.x
+++ /dev/null
@@ -1,11 +0,0 @@
-load_lib target-supports.exp
-
-if { ! [check_effective_target_mmap] } {
-        return 1
-}
-
-if [istarget "m68k-*-linux*"] {
-    # the executable is at the same position the test tries to remap
-    return 1
-}
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/loop-2g.c b/gcc/testsuite/gcc.c-torture/execute/loop-2g.c
index 91af413..0840945 100644
--- a/gcc/testsuite/gcc.c-torture/execute/loop-2g.c
+++ b/gcc/testsuite/gcc.c-torture/execute/loop-2g.c
@@ -1,3 +1,6 @@
+/* { dg-require-effective-target mmap } */
+/* { dg-skip-if "the executable is at the same position the test tries to remap" { m68k-*-linux* } { "*" } { "" } } */
+
 #include <limits.h>
 
 #include <sys/types.h>
diff --git a/gcc/testsuite/gcc.c-torture/execute/loop-2g.x b/gcc/testsuite/gcc.c-torture/execute/loop-2g.x
deleted file mode 100644
index ad024dd..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/loop-2g.x
+++ /dev/null
@@ -1,11 +0,0 @@
-load_lib target-supports.exp
-
-if { ! [check_effective_target_mmap] } {
-        return 1
-}
-
-if [istarget "m68k-*-linux*"] {
-    # the executable is at the same position the test tries to remap
-    return 1
-}
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/mode-dependent-address.c b/gcc/testsuite/gcc.c-torture/execute/mode-dependent-address.c
index 5bf840c..49c8c09 100644
--- a/gcc/testsuite/gcc.c-torture/execute/mode-dependent-address.c
+++ b/gcc/testsuite/gcc.c-torture/execute/mode-dependent-address.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target stdint_types } */
+
 #include <stdint.h>
 #include <string.h>
 #include <stdlib.h>
diff --git a/gcc/testsuite/gcc.c-torture/execute/mode-dependent-address.x b/gcc/testsuite/gcc.c-torture/execute/mode-dependent-address.x
deleted file mode 100644
index 6622e71..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/mode-dependent-address.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { ! [check_effective_target_stdint_types] } {
-	return 1
-}
-
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/nest-align-1.c b/gcc/testsuite/gcc.c-torture/execute/nest-align-1.c
index 548c887..73c0f64 100644
--- a/gcc/testsuite/gcc.c-torture/execute/nest-align-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/nest-align-1.c
@@ -2,6 +2,9 @@
    function.  */
 /* Origin: Joey Ye <joey.ye@intel.com> */
 
+/* Force bigger stack alignment for PowerPC EABI targets.  */
+/* { dg-options "-mno-eabi" { target powerpc-*-eabi* } } */
+
 #include <stddef.h>
 
 typedef int aligned __attribute__((aligned));
diff --git a/gcc/testsuite/gcc.c-torture/execute/nest-align-1.x b/gcc/testsuite/gcc.c-torture/execute/nest-align-1.x
deleted file mode 100644
index 392d9aa..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/nest-align-1.x
+++ /dev/null
@@ -1,5 +0,0 @@
-# Force bigger stack alignment for PowerPC EABI targets.
-if { [istarget "powerpc-*-eabi*"] } {
-    set additional_flags "-mno-eabi"
-}
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr19689.c b/gcc/testsuite/gcc.c-torture/execute/pr19689.c
index 608415f..d950315 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr19689.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr19689.c
@@ -1,3 +1,4 @@
+/* { dg-require-effective-target int32plus } */
 extern void abort (void);
 
 struct
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr19689.x b/gcc/testsuite/gcc.c-torture/execute/pr19689.x
deleted file mode 100644
index 121fcfe..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/pr19689.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int16] } {
-	return 1
-}
-
-return 0;
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr22493-1.c b/gcc/testsuite/gcc.c-torture/execute/pr22493-1.c
index bc0ff78..dedcb65 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr22493-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr22493-1.c
@@ -1,3 +1,5 @@
+/* { dg-options "-fwrapv" } */
+
 #include <limits.h>
 extern void abort ();
 extern void exit (int);
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr22493-1.x b/gcc/testsuite/gcc.c-torture/execute/pr22493-1.x
deleted file mode 100644
index 36a5839..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/pr22493-1.x
+++ /dev/null
@@ -1,2 +0,0 @@
-set additional_flags "-fwrapv"
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr23047.c b/gcc/testsuite/gcc.c-torture/execute/pr23047.c
index 7557fc2..2c963ab 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr23047.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr23047.c
@@ -1,3 +1,4 @@
+/* { dg-options "-fwrapv" } */
 #include <limits.h>
 extern void abort ();
 extern void exit (int);
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr23047.x b/gcc/testsuite/gcc.c-torture/execute/pr23047.x
deleted file mode 100644
index 36a5839..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/pr23047.x
+++ /dev/null
@@ -1,2 +0,0 @@
-set additional_flags "-fwrapv"
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr23135.c b/gcc/testsuite/gcc.c-torture/execute/pr23135.c
index 57b5f7c..378ebe7 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr23135.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr23135.c
@@ -1,10 +1,15 @@
 /* Based on execute/simd-1.c, modified by joern.rennecke@st.com to
    trigger a reload bug.  Verified for gcc mainline from 20050722 13:00 UTC
    for sh-elf -m4 -O2.  */
+/* { dg-options "-Wno-psabi" } */
+
 #ifndef STACK_SIZE
 #define STACK_SIZE (256*1024)
 #endif
 
+extern void abort (void);
+extern void exit (int);
+
 typedef struct { char c[STACK_SIZE/2]; } big_t;
 
 typedef int __attribute__((mode(SI))) __attribute__((vector_size (8))) vecint;
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr23135.x b/gcc/testsuite/gcc.c-torture/execute/pr23135.x
deleted file mode 100644
index cb7b119..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/pr23135.x
+++ /dev/null
@@ -1,2 +0,0 @@
-set additional_flags "-Wno-psabi"
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr29797-1.c b/gcc/testsuite/gcc.c-torture/execute/pr29797-1.c
index 9bcc2a9..40758c1 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr29797-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr29797-1.c
@@ -1,3 +1,4 @@
+/* { dg-require-effective-target int32plus } */
 extern void abort(void);
 
 unsigned int bar(void) { return 32768; }
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr29797-1.x b/gcc/testsuite/gcc.c-torture/execute/pr29797-1.x
deleted file mode 100644
index 4efed4c..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/pr29797-1.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int32plus] } {
-	return 0
-}
-
-return 1;
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr31448.c b/gcc/testsuite/gcc.c-torture/execute/pr31448.c
index 720ba92..fb8c247 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr31448.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr31448.c
@@ -1,5 +1,6 @@
 /* PR middle-end/31448, this used to ICE during expand because
    reduce_to_bit_field_precision was not ready to handle constants. */
+/* { dg-require-effective-target int32plus } */
 
 typedef struct _st {
     int iIndex : 24;
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr31448.x b/gcc/testsuite/gcc.c-torture/execute/pr31448.x
deleted file mode 100644
index 4efed4c..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/pr31448.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int32plus] } {
-	return 0
-}
-
-return 1;
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr35456.c b/gcc/testsuite/gcc.c-torture/execute/pr35456.c
index 175a0b2..17c70bc 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr35456.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr35456.c
@@ -1,3 +1,4 @@
+/* { dg-skip-if "signed zero not supported" { "vax-*-*" } { "*" } { "" } } */
 extern void abort (void);
 
 double
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr35456.x b/gcc/testsuite/gcc.c-torture/execute/pr35456.x
deleted file mode 100644
index 73b18fb..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/pr35456.x
+++ /dev/null
@@ -1,3 +0,0 @@
-# VAX does not support signed zero.
-if [istarget "vax-*-*"] { return 1 }
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr37573.c b/gcc/testsuite/gcc.c-torture/execute/pr37573.c
index 5891910..173a8d4 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr37573.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr37573.c
@@ -1,4 +1,5 @@
 /* PR tree-optimization/37573 */
+/* { dg-require-effective-target int32plus } */
 
 struct S
 {
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr37573.x b/gcc/testsuite/gcc.c-torture/execute/pr37573.x
deleted file mode 100644
index 7378270..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/pr37573.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int16] } {
-        return 1
-}
-
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr38151.c b/gcc/testsuite/gcc.c-torture/execute/pr38151.c
index 113a255..5ee058d 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr38151.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr38151.c
@@ -1,3 +1,4 @@
+/* { dg-options "-Wno-psabi" } */
 void abort (void);
 
 struct S2848
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr38151.x b/gcc/testsuite/gcc.c-torture/execute/pr38151.x
deleted file mode 100644
index cb7b119..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/pr38151.x
+++ /dev/null
@@ -1,2 +0,0 @@
-set additional_flags "-Wno-psabi"
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr39228.c b/gcc/testsuite/gcc.c-torture/execute/pr39228.c
index 06d8efd..dcd8d53 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr39228.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr39228.c
@@ -1,3 +1,6 @@
+/* { dg-options "-mieee" { target sh*-*-* alpha*-*-* } } */
+/* { dg-skip-if "No Inf/NaN support" { spu-*-* } "*" "" } */
+
 extern void abort (void);
 
 static int __attribute__((always_inline)) testf (float b)
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr39228.x b/gcc/testsuite/gcc.c-torture/execute/pr39228.x
deleted file mode 100644
index a7d8a82..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/pr39228.x
+++ /dev/null
@@ -1,10 +0,0 @@
-if { [istarget "alpha*-*-*"] || [istarget "sh*-*-*"] } {
-	# alpha and SH require -mieee for this test.
-	set additional_flags "-mieee"
-}
-if [istarget "spu-*-*"] {
-	# No Inf/NaN support on SPU.
-	return 1
-}
-
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr39501.c b/gcc/testsuite/gcc.c-torture/execute/pr39501.c
index 3749d6e..9c1868d 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr39501.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr39501.c
@@ -1,4 +1,8 @@
 /* { dg-options "-ffast-math" } */
+
+extern void abort (void);
+extern void exit (int);
+
 #define min1(a,b) ((a) < (b) ? (a) : (b))
 #define max1(a,b) ((a) > (b) ? (a) : (b))
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr39501.x b/gcc/testsuite/gcc.c-torture/execute/pr39501.x
deleted file mode 100644
index 72527d7..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/pr39501.x
+++ /dev/null
@@ -1,2 +0,0 @@
-set additional_flags "-ffast-math"
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr40386.c b/gcc/testsuite/gcc.c-torture/execute/pr40386.c
index ae0ac5a..59cd641 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr40386.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr40386.c
@@ -1,4 +1,8 @@
 /* { dg-options "-fno-ira-share-spill-slots" } */
+
+extern void abort (void);
+extern void exit (int);
+
 #define CHAR_BIT 8
 
 #define ROR(a,b) (((a) >> (b)) | ((a) << ((sizeof (a) * CHAR_BIT) - (b))))
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr40386.x b/gcc/testsuite/gcc.c-torture/execute/pr40386.x
deleted file mode 100644
index 12192e2..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/pr40386.x
+++ /dev/null
@@ -1,2 +0,0 @@
-set additional_flags "-fno-ira-share-spill-slots"
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr43220.c b/gcc/testsuite/gcc.c-torture/execute/pr43220.c
index 4709f17..0d6ebfb 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr43220.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr43220.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target int32plus } */
+
 void *volatile p;
 
 int
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr43220.x b/gcc/testsuite/gcc.c-torture/execute/pr43220.x
deleted file mode 100644
index 121fcfe..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/pr43220.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int16] } {
-	return 1
-}
-
-return 0;
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr44683.c b/gcc/testsuite/gcc.c-torture/execute/pr44683.c
index d0fd446..85eb016 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr44683.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr44683.c
@@ -1,3 +1,4 @@
+/* { dg-options "-mieee" { target sh*-*-* } } */
 int __attribute__((noinline,noclone))
 copysign_bug (double x)
 {
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr44683.x b/gcc/testsuite/gcc.c-torture/execute/pr44683.x
deleted file mode 100644
index 2041340..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/pr44683.x
+++ /dev/null
@@ -1,6 +0,0 @@
-if { [istarget "sh*-*-*"] } {
-	# SH require -mieee for this test.
-	set additional_flags "-mieee"
-}
-
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr45262.c b/gcc/testsuite/gcc.c-torture/execute/pr45262.c
index 72e186b..45cc8de 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr45262.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr45262.c
@@ -1,5 +1,7 @@
 /* PR middle-end/45262 */
 
+/* { dg-require-effective-target int32plus } */
+
 extern void abort (void);
 
 int
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr45262.x b/gcc/testsuite/gcc.c-torture/execute/pr45262.x
deleted file mode 100644
index 121fcfe..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/pr45262.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int16] } {
-	return 1
-}
-
-return 0;
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr47237.c b/gcc/testsuite/gcc.c-torture/execute/pr47237.c
index 2100e15..470c8ee 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr47237.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr47237.c
@@ -1,3 +1,4 @@
+/* { dg-xfail-if "can cause stack underflow" { nios2-*-* } "*" "" } */
 #define INTEGER_ARG  5
 
 extern void abort(void);
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr47237.x b/gcc/testsuite/gcc.c-torture/execute/pr47237.x
deleted file mode 100644
index d5d6988..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/pr47237.x
+++ /dev/null
@@ -1,6 +0,0 @@
-if { [istarget "nios2-*-*"] } {
-    # This test can cause the stack to underflow on Nios II.
-    set torture_execute_xfail [istarget]
-}
-
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr51581-1.c b/gcc/testsuite/gcc.c-torture/execute/pr51581-1.c
index 396b7aa..14e1e31 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr51581-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr51581-1.c
@@ -1,5 +1,7 @@
 /* PR tree-optimization/51581 */
 
+/* { dg-require-effective-target int32plus } */
+
 extern void abort (void);
 
 #define N 4096
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr51581-1.x b/gcc/testsuite/gcc.c-torture/execute/pr51581-1.x
deleted file mode 100644
index 4efed4c..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/pr51581-1.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int32plus] } {
-	return 0
-}
-
-return 1;
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr51581-2.c b/gcc/testsuite/gcc.c-torture/execute/pr51581-2.c
index dc111c4..e4345b5 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr51581-2.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr51581-2.c
@@ -1,4 +1,5 @@
 /* PR tree-optimization/51581 */
+/* { dg-require-effective-target int32plus } */
 
 extern void abort (void);
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr51581-2.x b/gcc/testsuite/gcc.c-torture/execute/pr51581-2.x
deleted file mode 100644
index 4efed4c..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/pr51581-2.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int32plus] } {
-	return 0
-}
-
-return 1;
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr52979-1.c b/gcc/testsuite/gcc.c-torture/execute/pr52979-1.c
index 246b1fd..13ecb79 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr52979-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr52979-1.c
@@ -1,5 +1,7 @@
 /* PR middle-end/52979 */
 
+/* { dg-require-effective-target int32plus } */
+
 extern void abort (void);
 int c, d, e;
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr52979-1.x b/gcc/testsuite/gcc.c-torture/execute/pr52979-1.x
deleted file mode 100644
index 4efed4c..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/pr52979-1.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int32plus] } {
-	return 0
-}
-
-return 1;
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr52979-2.c b/gcc/testsuite/gcc.c-torture/execute/pr52979-2.c
index 52f5bb8..91d4fbc 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr52979-2.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr52979-2.c
@@ -1,4 +1,5 @@
 /* PR middle-end/52979 */
+/* { dg-require-effective-target int32plus } */
 
 extern void abort (void);
 int c, d, e;
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr52979-2.x b/gcc/testsuite/gcc.c-torture/execute/pr52979-2.x
deleted file mode 100644
index 4efed4c..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/pr52979-2.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int32plus] } {
-	return 0
-}
-
-return 1;
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr53366-1.x b/gcc/testsuite/gcc.c-torture/execute/pr53366-1.x
deleted file mode 100644
index eeb3846..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/pr53366-1.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int16] } {
-	return 1
-}
-
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr56799.c b/gcc/testsuite/gcc.c-torture/execute/pr56799.c
index d9ee26b..a8558ea 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr56799.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr56799.c
@@ -1,3 +1,4 @@
+/* { dg-require-effective-target int32plus } */
 
 #include <stdio.h>
 typedef struct { int x; int y;} S;
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr56799.x b/gcc/testsuite/gcc.c-torture/execute/pr56799.x
deleted file mode 100644
index 4efed4c..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/pr56799.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int32plus] } {
-	return 0
-}
-
-return 1;
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr57124.c b/gcc/testsuite/gcc.c-torture/execute/pr57124.c
index 835d249..ca60158 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr57124.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr57124.c
@@ -1,3 +1,9 @@
+/* { dg-require-effective-target int32plus } */
+/* { dg-options "-fno-strict-overflow" } */
+
+extern void abort (void);
+extern void exit (int);
+
 __attribute__ ((noinline))
 foo(short unsigned int *p1, short unsigned int *p2)
 {
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr57124.x b/gcc/testsuite/gcc.c-torture/execute/pr57124.x
deleted file mode 100644
index da6cfd0..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/pr57124.x
+++ /dev/null
@@ -1,9 +0,0 @@
-load_lib target-supports.exp
-
-set additional_flags "-fno-strict-overflow"
-
-if { [check_effective_target_int16] } {
-	return 1
-}
-
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr57344-2.c b/gcc/testsuite/gcc.c-torture/execute/pr57344-2.c
index 9bf60ca..599071b 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr57344-2.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr57344-2.c
@@ -1,4 +1,5 @@
 /* PR middle-end/57344 */
+/* { dg-require-effective-target int32plus } */
 
 struct __attribute__((packed)) S
 {
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr57344-2.x b/gcc/testsuite/gcc.c-torture/execute/pr57344-2.x
deleted file mode 100644
index 121fcfe..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/pr57344-2.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int16] } {
-	return 1
-}
-
-return 0;
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr58570.c b/gcc/testsuite/gcc.c-torture/execute/pr58570.c
index 6d5116d..28b6efe 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr58570.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr58570.c
@@ -1,3 +1,4 @@
+/* { dg-require-effective-target int32plus } */
 #pragma pack(1)
 struct S
 {
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr58570.x b/gcc/testsuite/gcc.c-torture/execute/pr58570.x
deleted file mode 100644
index 121fcfe..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/pr58570.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int16] } {
-	return 1
-}
-
-return 0;
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr60822.c b/gcc/testsuite/gcc.c-torture/execute/pr60822.c
index d225331..dcd2447 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr60822.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr60822.c
@@ -1,3 +1,4 @@
+/* { dg-require-effective-target int32plus } */
 struct X {
     char fill0[800000];
     int a;
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr60822.x b/gcc/testsuite/gcc.c-torture/execute/pr60822.x
deleted file mode 100644
index 4efed4c..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/pr60822.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int32plus] } {
-	return 0
-}
-
-return 1;
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr7284-1.c b/gcc/testsuite/gcc.c-torture/execute/pr7284-1.c
index de0057c..067f322 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr7284-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr7284-1.c
@@ -2,6 +2,7 @@
    DR#081), not undefined.  Bug 7284 from Al Grant (AlGrant at
    myrealbox.com).  */
 
+/* { dg-require-effective-target int32plus } */
 /* { dg-options "-std=c89" } */
 
 extern void abort (void);
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr7284-1.x b/gcc/testsuite/gcc.c-torture/execute/pr7284-1.x
deleted file mode 100644
index 121fcfe..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/pr7284-1.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int16] } {
-	return 1
-}
-
-return 0;
diff --git a/gcc/testsuite/gcc.c-torture/execute/shiftdi.c b/gcc/testsuite/gcc.c-torture/execute/shiftdi.c
index 44f0dfc..7e04098 100644
--- a/gcc/testsuite/gcc.c-torture/execute/shiftdi.c
+++ b/gcc/testsuite/gcc.c-torture/execute/shiftdi.c
@@ -1,3 +1,5 @@
+/* { dg-require-effective-target int32plus } */
+
 /* Failed on sparc with -mv8plus because sparc.c:set_extends() thought
    erroneously that SImode ASHIFT chops the upper bits, it does not.  */
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/shiftdi.x b/gcc/testsuite/gcc.c-torture/execute/shiftdi.x
deleted file mode 100644
index 121fcfe..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/shiftdi.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int16] } {
-	return 1
-}
-
-return 0;
diff --git a/gcc/testsuite/gcc.c-torture/execute/simd-4.c b/gcc/testsuite/gcc.c-torture/execute/simd-4.c
index 5b9c785..8a92cfe 100644
--- a/gcc/testsuite/gcc.c-torture/execute/simd-4.c
+++ b/gcc/testsuite/gcc.c-torture/execute/simd-4.c
@@ -1,3 +1,4 @@
+/* { dg-require-effective-target stdint_types } */
 #include <stdint.h>
 typedef int32_t __attribute__((vector_size(8))) v2si;
 int64_t s64;
diff --git a/gcc/testsuite/gcc.c-torture/execute/simd-4.x b/gcc/testsuite/gcc.c-torture/execute/simd-4.x
deleted file mode 100644
index 2e7510c..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/simd-4.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_stdint_types] } {
-	return 0
-}
-
-return 1;
diff --git a/gcc/testsuite/gcc.c-torture/execute/strncmp-1.c b/gcc/testsuite/gcc.c-torture/execute/strncmp-1.c
index dee904f..c5d39fd 100644
--- a/gcc/testsuite/gcc.c-torture/execute/strncmp-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/strncmp-1.c
@@ -1,3 +1,4 @@
+/* { dg-xfail-if "kernel strncmp does not perform unsigned comparisons" { vxworks_kernel } "*" "" } */
 /* Copyright (C) 2002  Free Software Foundation.
 
    Test strncmp with various combinations of pointer alignments and lengths to
diff --git a/gcc/testsuite/gcc.c-torture/execute/strncmp-1.x b/gcc/testsuite/gcc.c-torture/execute/strncmp-1.x
deleted file mode 100644
index b555e0c..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/strncmp-1.x
+++ /dev/null
@@ -1,16 +0,0 @@
-if {[istarget i?86-*-vxworks*]
-    || [istarget mips*-*-vxworks*]
-    || [istarget sh*-*-vxworks*]
-    || [istarget sparc*-*-vxworks*]} {
-    # The kernel strncmp doesn't perform unsigned comparisons.
-    set torture_eval_before_execute {
-	global compiler_conditional_xfail_data
-	set compiler_conditional_xfail_data {
-	    "The kernel strncmp doesn't perform unsigned comparisons."
-	    { "*-*-*" }
-	    {}
-	    { "-mrtp" }
-	}
-    }
-}
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/usmul.c b/gcc/testsuite/gcc.c-torture/execute/usmul.c
index 28501b5..42b447a 100644
--- a/gcc/testsuite/gcc.c-torture/execute/usmul.c
+++ b/gcc/testsuite/gcc.c-torture/execute/usmul.c
@@ -1,3 +1,4 @@
+/* { dg-require-effective-target int32plus } */
 int __attribute__ ((noinline)) foo (short x, unsigned short y)
 {
   return x * y;
diff --git a/gcc/testsuite/gcc.c-torture/execute/usmul.x b/gcc/testsuite/gcc.c-torture/execute/usmul.x
deleted file mode 100644
index 121fcfe..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/usmul.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int16] } {
-	return 1
-}
-
-return 0;
diff --git a/gcc/testsuite/gcc.c-torture/execute/vrp-5.c b/gcc/testsuite/gcc.c-torture/execute/vrp-5.c
index 8f3c725..8df557c 100644
--- a/gcc/testsuite/gcc.c-torture/execute/vrp-5.c
+++ b/gcc/testsuite/gcc.c-torture/execute/vrp-5.c
@@ -1,3 +1,4 @@
+/* { dg-require-effective-target int32plus } */
 extern void exit (int);
 extern void abort ();
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/vrp-5.x b/gcc/testsuite/gcc.c-torture/execute/vrp-5.x
deleted file mode 100644
index 121fcfe..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/vrp-5.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int16] } {
-	return 1
-}
-
-return 0;
diff --git a/gcc/testsuite/gcc.c-torture/execute/vrp-6.c b/gcc/testsuite/gcc.c-torture/execute/vrp-6.c
index 7c6a175..90ebd2d 100644
--- a/gcc/testsuite/gcc.c-torture/execute/vrp-6.c
+++ b/gcc/testsuite/gcc.c-torture/execute/vrp-6.c
@@ -1,3 +1,4 @@
+/* { dg-require-effective-target int32plus } */
 #include <limits.h>
 
 extern void exit (int);
diff --git a/gcc/testsuite/gcc.c-torture/execute/vrp-6.x b/gcc/testsuite/gcc.c-torture/execute/vrp-6.x
deleted file mode 100644
index 121fcfe..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/vrp-6.x
+++ /dev/null
@@ -1,7 +0,0 @@
-load_lib target-supports.exp
-
-if { [check_effective_target_int16] } {
-	return 1
-}
-
-return 0;
diff --git a/gcc/testsuite/gcc.c-torture/execute/zerolen-2.c b/gcc/testsuite/gcc.c-torture/execute/zerolen-2.c
index 446e582..4a55acd 100644
--- a/gcc/testsuite/gcc.c-torture/execute/zerolen-2.c
+++ b/gcc/testsuite/gcc.c-torture/execute/zerolen-2.c
@@ -1,3 +1,4 @@
+/* { dg-skip-if "assumes absence of larger-than-word padding" { epiphany-*-* } "*" "" } */
 extern void abort(void);
 
 typedef int word __attribute__((mode(word)));
diff --git a/gcc/testsuite/gcc.c-torture/execute/zerolen-2.x b/gcc/testsuite/gcc.c-torture/execute/zerolen-2.x
deleted file mode 100644
index cee203d..0000000
--- a/gcc/testsuite/gcc.c-torture/execute/zerolen-2.x
+++ /dev/null
@@ -1,7 +0,0 @@
-if [istarget "epiphany-*-*"] {
-    # This test assumes the absence of larger-than-word padding.
-    # to make this true for struct foo on epiphany would require
-    # __attribute__((packed,aligned(__alignof__(word)))) .
-    return 1
-}
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/20111227-2.c b/gcc/testsuite/gcc.dg/20111227-2.c
similarity index 94%
rename from gcc/testsuite/gcc.c-torture/execute/20111227-2.c
rename to gcc/testsuite/gcc.dg/20111227-2.c
index 692c947..1266db3 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20111227-2.c
+++ b/gcc/testsuite/gcc.dg/20111227-2.c
@@ -1,6 +1,6 @@
 /* Testcase derived from 20111227-1.c to ensure that REE is combining
    redundant zero extends with zero extend to wider mode.  */
-/* { dg-options "-fdump-rtl-ree -O" } */
+/* { dg-options "-fdump-rtl-ree -O -free" } */
 extern void abort (void);
 
 unsigned short s;
diff --git a/gcc/testsuite/gcc.c-torture/execute/20111227-3.c b/gcc/testsuite/gcc.dg/20111227-3.c
similarity index 94%
rename from gcc/testsuite/gcc.c-torture/execute/20111227-3.c
rename to gcc/testsuite/gcc.dg/20111227-3.c
index d6726c4..a750db3 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20111227-3.c
+++ b/gcc/testsuite/gcc.dg/20111227-3.c
@@ -1,6 +1,6 @@
 /* Testcase derived from 20111227-1.c to ensure that REE is combining
    redundant sign extends with sign extend to wider mode.  */
-/* { dg-options "-fdump-rtl-ree -O" } */
+/* { dg-options "-fdump-rtl-ree -O -free" } */
 
 extern void abort (void);
 

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Migrating gcc.c-torture
  2014-08-22 12:19       ` Bernd Schmidt
@ 2014-08-22 20:39         ` Mike Stump
  2014-08-25 16:13           ` Bernd Schmidt
  2014-08-28 14:27           ` Bernd Schmidt
  2014-09-05 10:10         ` Thomas Schwinge
  1 sibling, 2 replies; 16+ messages in thread
From: Mike Stump @ 2014-08-22 20:39 UTC (permalink / raw)
  To: Bernd Schmidt; +Cc: Joseph S. Myers, Jakub Jelinek, Andrew Pinski, GCC Patches

On Aug 22, 2014, at 5:18 AM, Bernd Schmidt <bernds@codesourcery.com> wrote:
> 
> Here's another attempt.

> Ok?

Ok.  Thanks a ton for doing the work.

The resolutions look fine, the translation looks good.

Before you check it in, consider:

  930529-1.x has some alpha bits but I didn’t notice a discussion nor do I have state on the bug to know if the resolution is correct.

As always, people will comment (or just fix) any noticed fallout.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Migrating gcc.c-torture
  2014-08-22 20:39         ` Mike Stump
@ 2014-08-25 16:13           ` Bernd Schmidt
  2014-08-28 14:27           ` Bernd Schmidt
  1 sibling, 0 replies; 16+ messages in thread
From: Bernd Schmidt @ 2014-08-25 16:13 UTC (permalink / raw)
  To: Mike Stump; +Cc: Joseph S. Myers, Jakub Jelinek, Andrew Pinski, GCC Patches

On 08/22/2014 10:39 PM, Mike Stump wrote:
> Before you check it in, consider:
>
> 930529-1.x has some alpha bits but I didnÂ’t notice a discussion nor
> do I have state on the bug to know if the resolution is correct.

Those are commented out, and I assume superseded by the use of -fwrapv.

Thanks!


Bernd

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Migrating gcc.c-torture
  2014-08-22 20:39         ` Mike Stump
  2014-08-25 16:13           ` Bernd Schmidt
@ 2014-08-28 14:27           ` Bernd Schmidt
  2014-08-28 21:02             ` Mike Stump
  2014-08-29 19:55             ` Jeff Law
  1 sibling, 2 replies; 16+ messages in thread
From: Bernd Schmidt @ 2014-08-28 14:27 UTC (permalink / raw)
  To: Mike Stump; +Cc: Joseph S. Myers, Jakub Jelinek, Andrew Pinski, GCC Patches

On 08/22/2014 10:39 PM, Mike Stump wrote:
> On Aug 22, 2014, at 5:18 AM, Bernd Schmidt <bernds@codesourcery.com> wrote:
>>
>> Here's another attempt.
>
>> Ok?
>
> Ok.  Thanks a ton for doing the work.

The next question would be what to do with gcc.c-torture/unsorted.  As 
far as I can tell, these are all just plain compile tests, except for 
dump-noaddr.c.  Ok to move all except for that test to 
c-torture/compile, adjusting SFset.c and DFcmp.c which require int32plus?


Bernd

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Migrating gcc.c-torture
  2014-08-28 14:27           ` Bernd Schmidt
@ 2014-08-28 21:02             ` Mike Stump
  2014-08-29 19:55             ` Jeff Law
  1 sibling, 0 replies; 16+ messages in thread
From: Mike Stump @ 2014-08-28 21:02 UTC (permalink / raw)
  To: Bernd Schmidt; +Cc: Joseph S. Myers, Jakub Jelinek, Andrew Pinski, GCC Patches

On Aug 28, 2014, at 7:27 AM, Bernd Schmidt <bernds@codesourcery.com> wrote:
> The next question would be what to do with gcc.c-torture/unsorted.  As far as I can tell, these are all just plain compile tests, except for dump-noaddr.c.  Ok to move all except for that test to c-torture/compile, adjusting SFset.c and DFcmp.c which require int32plus?

Ok.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Migrating gcc.c-torture
  2014-08-28 14:27           ` Bernd Schmidt
  2014-08-28 21:02             ` Mike Stump
@ 2014-08-29 19:55             ` Jeff Law
  1 sibling, 0 replies; 16+ messages in thread
From: Jeff Law @ 2014-08-29 19:55 UTC (permalink / raw)
  To: Bernd Schmidt, Mike Stump
  Cc: Joseph S. Myers, Jakub Jelinek, Andrew Pinski, GCC Patches

On 08/28/14 08:27, Bernd Schmidt wrote:
> On 08/22/2014 10:39 PM, Mike Stump wrote:
>> On Aug 22, 2014, at 5:18 AM, Bernd Schmidt <bernds@codesourcery.com>
>> wrote:
>>>
>>> Here's another attempt.
>>
>>> Ok?
>>
>> Ok.  Thanks a ton for doing the work.
>
> The next question would be what to do with gcc.c-torture/unsorted.  As
> far as I can tell, these are all just plain compile tests, except for
> dump-noaddr.c.  Ok to move all except for that test to
> c-torture/compile, adjusting SFset.c and DFcmp.c which require int32plus?
They are all just plain compile tests.  They come from Torbjorn's old 
c-torture distribution which formed the first GCC suite.

I can't recall why he had an unsorted directory separate from the 
compile tests.

jeff

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Migrating gcc.c-torture
  2014-08-22 12:19       ` Bernd Schmidt
  2014-08-22 20:39         ` Mike Stump
@ 2014-09-05 10:10         ` Thomas Schwinge
  2014-09-05 17:13           ` Mike Stump
  1 sibling, 1 reply; 16+ messages in thread
From: Thomas Schwinge @ 2014-09-05 10:10 UTC (permalink / raw)
  To: Bernd Schmidt, Joseph S. Myers, Jakub Jelinek
  Cc: Andrew Pinski, GCC Patches, mikestump, law

[-- Attachment #1: Type: text/plain, Size: 2113 bytes --]

Hi!

On Fri, 22 Aug 2014 14:18:32 +0200, Bernd Schmidt <bernds@codesourcery.com> wrote:
> On 07/29/2014 12:36 AM, Joseph S. Myers wrote:
> > On Thu, 24 Jul 2014, Jakub Jelinek wrote:
> >> Yeah.  I believe gcc.c-torture/compile/ has been converted already,
> >> so it is just about gcc.c-torture/execute/.

> >> So, please just tweak execute.exp, so that it does what it did until now
> >> (perhaps with the exception of *.x files support) in dg framework, and
> >> convert *.exp files into dg-* directives in the testcases.
> >
> > And note that this is bug 20567.  Existing dg-* directive uses in
> > gcc.c-torture/execute/ (which are currently ignored) may or may not be
> > correct, so they should be reviewed as part of such a migration to decide
> > whether they should stay or be removed.  (There aren't that many of them
> > to review.)

Should PR20567 now be updated?

> Here's another attempt.  [...]

> --- a/gcc/testsuite/gcc.c-torture/execute/execute.exp
> +++ b/gcc/testsuite/gcc.c-torture/execute/execute.exp
> @@ -22,28 +22,17 @@
>  # C torture test suite.

> -set-torture-options $C_TORTURE_OPTIONS {{}} $LTO_TORTURE_OPTIONS
> +# Main loop.
> +set saved-dg-do-what-default ${dg-do-what-default}
> +set dg-do-what-default "run"
> +gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "" "-w"
> +set dg-do-what-default ${saved-dg-do-what-default}

> -foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c]] {
> -    # If we're only testing specific files and this isn't one of them, skip it.
> -    if ![runtest_file_p $runtests $src] then {
> -	continue
> -    }
> -
> -    c-torture-execute $src
> -}

I noticed that this change causes that the »-Og -g« option combination
(which is part of C_TORTURE_OPTIONS) is no longer being tested with
gcc-dg-runtest.  (The same thing happend for all the tests that were
moved from gcc.c-torture/unsorted/ to gcc.c-torture/compile/.)  Would it
be desirable to restore testing of that option combination, maybe
generally for gcc-dg-runtest, or would that be overkill?


Grüße,
 Thomas

[-- Attachment #2: Type: application/pgp-signature, Size: 472 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Migrating gcc.c-torture
  2014-09-05 10:10         ` Thomas Schwinge
@ 2014-09-05 17:13           ` Mike Stump
  0 siblings, 0 replies; 16+ messages in thread
From: Mike Stump @ 2014-09-05 17:13 UTC (permalink / raw)
  To: Thomas Schwinge
  Cc: Bernd Schmidt, Joseph S. Myers, Jakub Jelinek, Andrew Pinski,
	GCC Patches, law

On Sep 5, 2014, at 3:10 AM, Thomas Schwinge <thomas@codesourcery.com> wrote:
> Should PR20567 now be updated?

Updated.

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2014-09-05 17:13 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-23 23:52 Migrating gcc.c-torture Bernd Schmidt
2014-07-24  0:00 ` Andrew Pinski
2014-07-24  7:12   ` Jakub Jelinek
2014-07-24 17:17     ` Mike Stump
2014-07-24 17:33       ` Mike Stump
2014-07-28 22:41     ` Joseph S. Myers
2014-08-22 12:19       ` Bernd Schmidt
2014-08-22 20:39         ` Mike Stump
2014-08-25 16:13           ` Bernd Schmidt
2014-08-28 14:27           ` Bernd Schmidt
2014-08-28 21:02             ` Mike Stump
2014-08-29 19:55             ` Jeff Law
2014-09-05 10:10         ` Thomas Schwinge
2014-09-05 17:13           ` Mike Stump
2014-07-24  6:45 ` Thomas Schwinge
2014-07-24  7:49   ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).