OSDN Git Service

* gcc.dg/compat/compat-common.h: New file.
authorjanis <janis@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 10 Jun 2003 19:08:33 +0000 (19:08 +0000)
committerjanis <janis@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 10 Jun 2003 19:08:33 +0000 (19:08 +0000)
* gcc.dg/compat/fp-struct-check.h: Improve debugging output.
* gcc.dg/compat/fp-struct-test-by-value-x.h: Ditto.
* gcc.dg/compat/fp-struct-test-by-value-y.h: Ditto.
* gcc.dg/compat/scalar-by-value-1_main.c: Ditto.
* gcc.dg/compat/scalar-by-value-1_x.c: Ditto.
* gcc.dg/compat/scalar-by-value-1_y.c: Ditto.
* gcc.dg/compat/scalar-by-value-2_main.c: Ditto.
* gcc.dg/compat/scalar-by-value-2_x.c: Ditto.
* gcc.dg/compat/scalar-by-value-2_y.c: Ditto.
* gcc.dg/compat/scalar-return-1_main.c: Ditto.
* gcc.dg/compat/scalar-return-1_x.c: Ditto.
* gcc.dg/compat/scalar-return-1_y.c: Ditto.
* gcc.dg/compat/scalar-return-2_main.c: Ditto.
* gcc.dg/compat/scalar-return-2_x.c: Ditto.
* gcc.dg/compat/scalar-return-2_y.c: Ditto.
* gcc.dg/compat/small-struct-check.h: Ditto.
* gcc.dg/compat/struct-by-value-2_main.c: Ditto.
* gcc.dg/compat/struct-by-value-2_x.c: Ditto.
* gcc.dg/compat/struct-by-value-2_y.c: Ditto.
* gcc.dg/compat/struct-by-value-3_main.c: Ditto.
* gcc.dg/compat/struct-by-value-3_x.c: Ditto.
* gcc.dg/compat/struct-by-value-3_y.c: Ditto.
* gcc.dg/compat/struct-by-value-4_main.c: Ditto.
* gcc.dg/compat/struct-by-value-4_x.c: Ditto.
* gcc.dg/compat/struct-by-value-4_y.c: Ditto.
* gcc.dg/compat/struct-by-value-5_main.c: Ditto.
* gcc.dg/compat/struct-by-value-5_x.c: Ditto.
* gcc.dg/compat/struct-by-value-5_y.c: Ditto.
* gcc.dg/compat/struct-by-value-6_main.c: Ditto.
* gcc.dg/compat/struct-by-value-6_x.c: Ditto.
* gcc.dg/compat/struct-by-value-6_y.c: Ditto.
* gcc.dg/compat/struct-by-value-7_main.c: Ditto.
* gcc.dg/compat/struct-by-value-7_x.c: Ditto.
* gcc.dg/compat/struct-by-value-7_y.c: Ditto.
* gcc.dg/compat/struct-by-value-8_main.c: Ditto.
* gcc.dg/compat/struct-by-value-8_x.c: Ditto.
* gcc.dg/compat/struct-by-value-8_y.c: Ditto.
* gcc.dg/compat/struct-by-value-9_main.c: Ditto.
* gcc.dg/compat/struct-by-value-9_x.c: Ditto.
* gcc.dg/compat/struct-by-value-9_y.c: Ditto.
* gcc.dg/compat/struct-return-2_main.c: Ditto.
* gcc.dg/compat/struct-return-2_x.c: Ditto.
* gcc.dg/compat/struct-return-2_y.c: Ditto.
* gcc.dg/compat/struct-return-3_main.c: Ditto.
* gcc.dg/compat/struct-return-3_x.c: Ditto.
* gcc.dg/compat/struct-return-3_y.c: Ditto.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@67724 138bc75d-0d04-0410-961f-82ee72b054a4

48 files changed:
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/compat/compat-common.h [new file with mode: 0644]
gcc/testsuite/gcc.dg/compat/fp-struct-check.h
gcc/testsuite/gcc.dg/compat/fp-struct-test-by-value-x.h
gcc/testsuite/gcc.dg/compat/fp-struct-test-by-value-y.h
gcc/testsuite/gcc.dg/compat/scalar-by-value-1_main.c
gcc/testsuite/gcc.dg/compat/scalar-by-value-1_x.c
gcc/testsuite/gcc.dg/compat/scalar-by-value-1_y.c
gcc/testsuite/gcc.dg/compat/scalar-by-value-2_main.c
gcc/testsuite/gcc.dg/compat/scalar-by-value-2_x.c
gcc/testsuite/gcc.dg/compat/scalar-by-value-2_y.c
gcc/testsuite/gcc.dg/compat/scalar-return-1_main.c
gcc/testsuite/gcc.dg/compat/scalar-return-1_x.c
gcc/testsuite/gcc.dg/compat/scalar-return-1_y.c
gcc/testsuite/gcc.dg/compat/scalar-return-2_main.c
gcc/testsuite/gcc.dg/compat/scalar-return-2_x.c
gcc/testsuite/gcc.dg/compat/scalar-return-2_y.c
gcc/testsuite/gcc.dg/compat/small-struct-check.h
gcc/testsuite/gcc.dg/compat/struct-by-value-2_main.c
gcc/testsuite/gcc.dg/compat/struct-by-value-2_x.c
gcc/testsuite/gcc.dg/compat/struct-by-value-2_y.c
gcc/testsuite/gcc.dg/compat/struct-by-value-3_main.c
gcc/testsuite/gcc.dg/compat/struct-by-value-3_x.c
gcc/testsuite/gcc.dg/compat/struct-by-value-3_y.c
gcc/testsuite/gcc.dg/compat/struct-by-value-4_main.c
gcc/testsuite/gcc.dg/compat/struct-by-value-4_x.c
gcc/testsuite/gcc.dg/compat/struct-by-value-4_y.c
gcc/testsuite/gcc.dg/compat/struct-by-value-5_main.c
gcc/testsuite/gcc.dg/compat/struct-by-value-5_x.c
gcc/testsuite/gcc.dg/compat/struct-by-value-5_y.c
gcc/testsuite/gcc.dg/compat/struct-by-value-6_main.c
gcc/testsuite/gcc.dg/compat/struct-by-value-6_x.c
gcc/testsuite/gcc.dg/compat/struct-by-value-6_y.c
gcc/testsuite/gcc.dg/compat/struct-by-value-7_main.c
gcc/testsuite/gcc.dg/compat/struct-by-value-7_x.c
gcc/testsuite/gcc.dg/compat/struct-by-value-7_y.c
gcc/testsuite/gcc.dg/compat/struct-by-value-8_main.c
gcc/testsuite/gcc.dg/compat/struct-by-value-8_x.c
gcc/testsuite/gcc.dg/compat/struct-by-value-8_y.c
gcc/testsuite/gcc.dg/compat/struct-by-value-9_main.c
gcc/testsuite/gcc.dg/compat/struct-by-value-9_x.c
gcc/testsuite/gcc.dg/compat/struct-by-value-9_y.c
gcc/testsuite/gcc.dg/compat/struct-return-2_main.c
gcc/testsuite/gcc.dg/compat/struct-return-2_x.c
gcc/testsuite/gcc.dg/compat/struct-return-2_y.c
gcc/testsuite/gcc.dg/compat/struct-return-3_main.c
gcc/testsuite/gcc.dg/compat/struct-return-3_x.c
gcc/testsuite/gcc.dg/compat/struct-return-3_y.c

index f9e8c6e..af4f807 100644 (file)
@@ -1,3 +1,53 @@
+2003-06-10  Janis Johnson  <janis187@us.ibm.com>
+
+       * gcc.dg/compat/compat-common.h: New file.
+       * gcc.dg/compat/fp-struct-check.h: Improve debugging output.
+       * gcc.dg/compat/fp-struct-test-by-value-x.h: Ditto.
+       * gcc.dg/compat/fp-struct-test-by-value-y.h: Ditto.
+       * gcc.dg/compat/scalar-by-value-1_main.c: Ditto.
+       * gcc.dg/compat/scalar-by-value-1_x.c: Ditto.
+       * gcc.dg/compat/scalar-by-value-1_y.c: Ditto.
+       * gcc.dg/compat/scalar-by-value-2_main.c: Ditto.
+       * gcc.dg/compat/scalar-by-value-2_x.c: Ditto.
+       * gcc.dg/compat/scalar-by-value-2_y.c: Ditto.
+       * gcc.dg/compat/scalar-return-1_main.c: Ditto.
+       * gcc.dg/compat/scalar-return-1_x.c: Ditto.
+       * gcc.dg/compat/scalar-return-1_y.c: Ditto.
+       * gcc.dg/compat/scalar-return-2_main.c: Ditto.
+       * gcc.dg/compat/scalar-return-2_x.c: Ditto.
+       * gcc.dg/compat/scalar-return-2_y.c: Ditto.
+       * gcc.dg/compat/small-struct-check.h: Ditto.
+       * gcc.dg/compat/struct-by-value-2_main.c: Ditto.
+       * gcc.dg/compat/struct-by-value-2_x.c: Ditto.
+       * gcc.dg/compat/struct-by-value-2_y.c: Ditto.
+       * gcc.dg/compat/struct-by-value-3_main.c: Ditto.
+       * gcc.dg/compat/struct-by-value-3_x.c: Ditto.
+       * gcc.dg/compat/struct-by-value-3_y.c: Ditto.
+       * gcc.dg/compat/struct-by-value-4_main.c: Ditto.
+       * gcc.dg/compat/struct-by-value-4_x.c: Ditto.
+       * gcc.dg/compat/struct-by-value-4_y.c: Ditto.
+       * gcc.dg/compat/struct-by-value-5_main.c: Ditto.
+       * gcc.dg/compat/struct-by-value-5_x.c: Ditto.
+       * gcc.dg/compat/struct-by-value-5_y.c: Ditto.
+       * gcc.dg/compat/struct-by-value-6_main.c: Ditto.
+       * gcc.dg/compat/struct-by-value-6_x.c: Ditto.
+       * gcc.dg/compat/struct-by-value-6_y.c: Ditto.
+       * gcc.dg/compat/struct-by-value-7_main.c: Ditto.
+       * gcc.dg/compat/struct-by-value-7_x.c: Ditto.
+       * gcc.dg/compat/struct-by-value-7_y.c: Ditto.
+       * gcc.dg/compat/struct-by-value-8_main.c: Ditto.
+       * gcc.dg/compat/struct-by-value-8_x.c: Ditto.
+       * gcc.dg/compat/struct-by-value-8_y.c: Ditto.
+       * gcc.dg/compat/struct-by-value-9_main.c: Ditto.
+       * gcc.dg/compat/struct-by-value-9_x.c: Ditto.
+       * gcc.dg/compat/struct-by-value-9_y.c: Ditto.
+       * gcc.dg/compat/struct-return-2_main.c: Ditto.
+       * gcc.dg/compat/struct-return-2_x.c: Ditto.
+       * gcc.dg/compat/struct-return-2_y.c: Ditto.
+       * gcc.dg/compat/struct-return-3_main.c: Ditto.
+       * gcc.dg/compat/struct-return-3_x.c: Ditto.
+       * gcc.dg/compat/struct-return-3_y.c: Ditto.
+
 2003-06-10  Geoffrey Keating  <geoffk@apple.com>
 
        * g++.dg/pch/static-1.C: New file.
diff --git a/gcc/testsuite/gcc.dg/compat/compat-common.h b/gcc/testsuite/gcc.dg/compat/compat-common.h
new file mode 100644 (file)
index 0000000..46eaf42
--- /dev/null
@@ -0,0 +1,23 @@
+/*  Several of the binary compatibility tests use these macros to
+    allow debugging the test or tracking down a failure by getting an
+    indication of whether each individual check passed or failed.
+    When DBG is defined, each check is shown by a dot (pass) or 'F'
+    (fail) rather than aborting as soon as a failure is detected.  */
+#ifdef DBG
+#include <stdio.h>
+#define DEBUG_FPUTS(x) fputs (x, stdout)
+#define DEBUG_DOT putc ('.', stdout)
+#define DEBUG_NL putc ('\n', stdout)
+#define DEBUG_FAIL putc ('F', stdout); fails++
+#define DEBUG_CHECK { DEBUG_FAIL; } else { DEBUG_DOT; }
+#else
+#define DEBUG_FPUTS(x)
+#define DEBUG_DOT
+#define DEBUG_NL
+#define DEBUG_FAIL abort ()
+#define DEBUG_CHECK abort ();
+#endif
+
+extern void abort (void);
+extern int fails;
index e907c7f..bd3283b 100644 (file)
@@ -2,70 +2,70 @@
 
 #define CHECKS(NAME,TYPEM)                                     \
 void checkS##NAME##1 (S##NAME##1 x, TYPEM y)                   \
-{ if (x.a != y) { DEBUG_NL; DEBUG_NL; abort (); } }            \
+{ if (x.a != y) DEBUG_CHECK }                                  \
 void checkS##NAME##2 (S##NAME##2 x, TYPEM y)                   \
-{ if (x.a != y || x.b != y+1 ) { DEBUG_NL; abort (); } }       \
+{ if (x.a != y || x.b != y+1 ) DEBUG_CHECK }                   \
 void checkS##NAME##3 (S##NAME##3 x, TYPEM y)                   \
 { if (x.a != y || x.b != y+1 || x.c != y+2 )                   \
-    { DEBUG_NL; abort (); } }                                  \
+    DEBUG_CHECK }                                              \
 void checkS##NAME##4 (S##NAME##4 x, TYPEM y)                   \
 { if (x.a != y || x.b != y+1 || x.c != y+2 || x.d != y+3)      \
-    { DEBUG_NL; abort (); } }                                  \
+    DEBUG_CHECK }                                              \
 void checkS##NAME##5 (S##NAME##5 x, TYPEM y)                   \
 { if (x.a != y || x.b != y+1 || x.c != y+2 || x.d != y+3       \
-      || x.e != y+4) { DEBUG_NL; abort (); } }                 \
+      || x.e != y+4) DEBUG_CHECK }                             \
 void checkS##NAME##6 (S##NAME##6 x, TYPEM y)                   \
 { if (x.a != y || x.b != y+1 || x.c != y+2 || x.d != y+3       \
-      || x.e != y+4 || x.f != y+5) { DEBUG_NL; abort (); } }   \
+      || x.e != y+4 || x.f != y+5) DEBUG_CHECK }               \
 void checkS##NAME##7 (S##NAME##7 x, TYPEM y)                   \
 { if (x.a != y || x.b != y+1 || x.c != y+2 || x.d != y+3       \
       || x.e != y+4 || x.f != y+5 || x.g != y+6)               \
-    { DEBUG_NL; abort (); } }                                  \
+    DEBUG_CHECK }                                              \
 void checkS##NAME##8 (S##NAME##8 x, TYPEM y)                   \
 { if (x.a != y || x.b != y+1 || x.c != y+2 || x.d != y+3       \
       || x.e != y+4 || x.f != y+5 || x.g != y+6                        \
-      || x.h != y+7) { DEBUG_NL; abort (); } }                 \
+      || x.h != y+7) DEBUG_CHECK }                             \
 void checkS##NAME##9 (S##NAME##9 x, TYPEM y)                   \
 { if (x.a != y || x.b != y+1 || x.c != y+2 || x.d != y+3       \
       || x.e != y+4 || x.f != y+5 || x.g != y+6                        \
-      || x.h != y+7 || x.i != y+8) { DEBUG_NL; abort (); } }   \
+      || x.h != y+7 || x.i != y+8) DEBUG_CHECK }               \
 void checkS##NAME##10 (S##NAME##10 x, TYPEM y)                 \
 { if (x.a != y || x.b != y+1 || x.c != y+2 || x.d != y+3       \
       || x.e != y+4 || x.f != y+5 || x.g != y+6                        \
       || x.h != y+7 || x.i != y+8 || x.j != y+9)               \
-   { DEBUG_NL; abort (); } }                                   \
+   DEBUG_CHECK }                                               \
 void checkS##NAME##11 (S##NAME##11 x, TYPEM y)                 \
 { if (x.a != y || x.b != y+1 || x.c != y+2 || x.d != y+3       \
       || x.e != y+4 || x.f != y+5 || x.g != y+6                        \
       || x.h != y+7 || x.i != y+8 || x.j != y+9                        \
-      || x.k != y+10) { DEBUG_NL; abort (); } }                        \
+      || x.k != y+10) DEBUG_CHECK }                            \
 void checkS##NAME##12 (S##NAME##12 x, TYPEM y)                 \
 { if (x.a != y || x.b != y+1 || x.c != y+2 || x.d != y+3       \
       || x.e != y+4 || x.f != y+5 || x.g != y+6                        \
       || x.h != y+7 || x.i != y+8 || x.j != y+9                        \
-      || x.k != y+10 || x.l != y+11) { DEBUG_NL; abort (); } } \
+      || x.k != y+10 || x.l != y+11) DEBUG_CHECK }             \
 void checkS##NAME##13 (S##NAME##13 x, TYPEM y)                 \
 { if (x.a != y || x.b != y+1 || x.c != y+2 || x.d != y+3       \
       || x.e != y+4 || x.f != y+5 || x.g != y+6                        \
       || x.h != y+7 || x.i != y+8 || x.j != y+9                        \
       || x.k != y+10 || x.l != y+11 || x.m != y+12)            \
-    { DEBUG_NL; abort (); } }                                  \
+    DEBUG_CHECK }                                              \
 void checkS##NAME##14 (S##NAME##14 x, TYPEM y)                 \
 { if (x.a != y || x.b != y+1 || x.c != y+2 || x.d != y+3       \
       || x.e != y+4 || x.f != y+5 || x.g != y+6                        \
       || x.h != y+7 || x.i != y+8 || x.j != y+9                        \
       || x.k != y+10 || x.l != y+11 || x.m != y+12             \
-      || x.n != y+13) { DEBUG_NL; abort (); } }                        \
+      || x.n != y+13) DEBUG_CHECK }                            \
 void checkS##NAME##15 (S##NAME##15 x, TYPEM y)                 \
 { if (x.a != y || x.b != y+1 || x.c != y+2 || x.d != y+3       \
       || x.e != y+4 || x.f != y+5 || x.g != y+6                        \
       || x.h != y+7 || x.i != y+8 || x.j != y+9                        \
       || x.k != y+10 || x.l != y+11 || x.m != y+12             \
-      || x.n != y+13 || x.o != y+14) { DEBUG_NL; abort (); } } \
+      || x.n != y+13 || x.o != y+14) DEBUG_CHECK }             \
 void checkS##NAME##16 (S##NAME##16 x, TYPEM y)                 \
 { if (x.a != y || x.b != y+1 || x.c != y+2 || x.d != y+3       \
       || x.e != y+4 || x.f != y+5 || x.g != y+6                        \
       || x.h != y+7 || x.i != y+8 || x.j != y+9                        \
       || x.k != y+10 || x.l != y+11 || x.m != y+12             \
       || x.n != y+13 || x.o != y+14 || x.p != y+15)            \
-    { DEBUG_NL; abort (); } }
+    DEBUG_CHECK }
index 867c75b..876f1b3 100644 (file)
@@ -27,6 +27,7 @@ void                                                          \
 testit##TYPE (void)                                            \
 {                                                              \
   DEBUG_FPUTS (#TYPE);                                         \
+  DEBUG_FPUTS (" init: ");                                     \
   init##TYPE  ( &g1s##TYPE,  (MTYPE)1);                                \
   init##TYPE  ( &g2s##TYPE,  (MTYPE)2);                                \
   init##TYPE  ( &g3s##TYPE,  (MTYPE)3);                                \
@@ -44,69 +45,91 @@ testit##TYPE (void)                                         \
   init##TYPE  (&g15s##TYPE, (MTYPE)15);                                \
   init##TYPE  (&g16s##TYPE, (MTYPE)16);                                \
   checkg##TYPE ();                                             \
-  DEBUG_FPUTS (" test");                                       \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#TYPE);                                         \
+  DEBUG_FPUTS (" test: ");                                     \
   test##TYPE (g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE,      \
              g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE,       \
              g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE,    \
              g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE);  \
-  DEBUG_FPUTS (" testva");                                     \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#TYPE);                                         \
+  DEBUG_FPUTS (" testva:");                                    \
+  DEBUG_NL;                                                    \
   testva##TYPE (1,                                             \
                g1s##TYPE);                                     \
+  DEBUG_NL;                                                    \
   testva##TYPE (2,                                             \
                g1s##TYPE, g2s##TYPE);                          \
+  DEBUG_NL;                                                    \
   testva##TYPE (3,                                             \
                g1s##TYPE, g2s##TYPE, g3s##TYPE);               \
+  DEBUG_NL;                                                    \
   testva##TYPE (4,                                             \
                g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE);    \
+  DEBUG_NL;                                                    \
   testva##TYPE (5,                                             \
                g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE,     \
                g5s##TYPE);                                     \
+  DEBUG_NL;                                                    \
   testva##TYPE (6,                                             \
                g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE,     \
                g5s##TYPE, g6s##TYPE);                          \
+  DEBUG_NL;                                                    \
   testva##TYPE (7,                                             \
                g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE,     \
                g5s##TYPE, g6s##TYPE, g7s##TYPE);               \
+  DEBUG_NL;                                                    \
   testva##TYPE (8,                                             \
                g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE,     \
                g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE);    \
+  DEBUG_NL;                                                    \
   testva##TYPE (9,                                             \
                g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE,     \
                g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE,     \
                g9s##TYPE);                                     \
+  DEBUG_NL;                                                    \
   testva##TYPE (10,                                            \
                g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE,     \
                g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE,     \
                g9s##TYPE, g10s##TYPE);                         \
+  DEBUG_NL;                                                    \
   testva##TYPE (11,                                            \
                g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE,     \
                g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE,     \
                g9s##TYPE, g10s##TYPE, g11s##TYPE);             \
+  DEBUG_NL;                                                    \
   testva##TYPE (12,                                            \
                g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE,     \
                g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE,     \
                g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE); \
+  DEBUG_NL;                                                    \
   testva##TYPE (13,                                            \
                g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE,     \
                g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE,     \
                g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE,  \
                g13s##TYPE);                                    \
+  DEBUG_NL;                                                    \
   testva##TYPE (14,                                            \
                g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE,     \
                g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE,     \
                g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE,  \
                g13s##TYPE, g14s##TYPE);                        \
+  DEBUG_NL;                                                    \
   testva##TYPE (15,                                            \
                g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE,     \
                g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE,     \
                g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE,  \
                g13s##TYPE, g14s##TYPE, g15s##TYPE);            \
+  DEBUG_NL;                                                    \
   testva##TYPE (16,                                            \
                g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE,     \
                g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE,     \
                g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE,  \
                g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE); \
-  DEBUG_FPUTS (" test2");                                      \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#TYPE);                                         \
+  DEBUG_FPUTS (" test2: ");                                    \
   test2_##TYPE (g1s##TYPE, g3s##TYPE, g5s##TYPE, g7s##TYPE,    \
                g9s##TYPE, g11s##TYPE, g13s##TYPE, g15s##TYPE); \
   DEBUG_NL;                                                    \
index 89d2faa..49fccdd 100644 (file)
@@ -33,37 +33,21 @@ test##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4,                     \
            TYPE s9, TYPE s10, TYPE s11, TYPE s12,              \
            TYPE s13, TYPE s14, TYPE s15, TYPE s16)             \
 {                                                              \
-  DEBUG_DOT;                                                   \
   check##TYPE (s1, (TYPE2)1);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE (s2, (TYPE2)2);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE (s3, (TYPE2)3);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE (s4, (TYPE2)4);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE (s5, (TYPE2)5);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE (s6, (TYPE2)6);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE (s7, (TYPE2)7);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE (s8, (TYPE2)8);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE (s9, (TYPE2)9);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE (s10, (TYPE2)10);                                        \
-  DEBUG_DOT;                                                   \
   check##TYPE (s11, (TYPE2)11);                                        \
-  DEBUG_DOT;                                                   \
   check##TYPE (s12, (TYPE2)12);                                        \
-  DEBUG_DOT;                                                   \
   check##TYPE (s13, (TYPE2)13);                                        \
-  DEBUG_DOT;                                                   \
   check##TYPE (s14, (TYPE2)14);                                        \
-  DEBUG_DOT;                                                   \
   check##TYPE (s15, (TYPE2)15);                                        \
-  DEBUG_DOT;                                                   \
   check##TYPE (s16, (TYPE2)16);                                        \
 }                                                              \
                                                                \
@@ -78,7 +62,6 @@ testva##TYPE (int n, ...)                                     \
       for (i = 0; i < n; i++)                                  \
        {                                                       \
          TYPE t = va_arg (ap, TYPE);                           \
-         DEBUG_DOT;                                            \
          check##TYPE (t, (TYPE2)i+1);                          \
        }                                                       \
       va_end (ap);                                             \
index 9e8a8f1..5272a37 100644 (file)
@@ -3,6 +3,7 @@
 
 extern void scalar_by_value_1_x (void);
 extern void exit (int);
+int fails;
 
 int
 main ()
index 9ce16a0..51b5abd 100644 (file)
@@ -1,13 +1,4 @@
-#ifdef DBG
-#include <stdio.h>
-#define DEBUG_FPUTS(x) fputs (x, stdout)
-#define DEBUG_DOT putc ('.', stdout)
-#define DEBUG_NL putc ('\n', stdout)
-#else
-#define DEBUG_FPUTS(x)
-#define DEBUG_DOT
-#define DEBUG_NL
-#endif
+#include "compat-common.h"
 
 #define T(NAME, TYPE, INITVAL)                                         \
 TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME;               \
@@ -28,10 +19,7 @@ void                                                         \
 check##NAME (TYPE x, TYPE v)                                   \
 {                                                              \
   if (x != v + INITVAL)                                                \
-    {                                                          \
-      DEBUG_NL;                                                        \
-      abort ();                                                        \
-    }                                                          \
+    DEBUG_CHECK                                                        \
 }                                                              \
                                                                \
 void                                                           \
@@ -48,6 +36,7 @@ void                                                          \
 testit##NAME (void)                                            \
 {                                                              \
   DEBUG_FPUTS (#NAME);                                         \
+  DEBUG_FPUTS (" init: ");                                     \
   init##NAME (&g01##NAME,  1);                                 \
   init##NAME (&g02##NAME,  2);                                 \
   init##NAME (&g03##NAME,  3);                                 \
@@ -65,76 +54,96 @@ testit##NAME (void)                                         \
   init##NAME (&g15##NAME, 15);                                 \
   init##NAME (&g16##NAME, 16);                                 \
   checkg##NAME ();                                             \
-  DEBUG_FPUTS (" test");                                       \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#NAME);                                         \
+  DEBUG_FPUTS (" test: ");                                     \
   test##NAME (g01##NAME, g02##NAME, g03##NAME, g04##NAME,      \
              g05##NAME, g06##NAME, g07##NAME, g08##NAME,       \
              g09##NAME, g10##NAME, g11##NAME, g12##NAME,       \
              g13##NAME, g14##NAME, g15##NAME, g16##NAME);      \
-  DEBUG_FPUTS (" testva");                                     \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#NAME);                                         \
+  DEBUG_FPUTS (" testva:");                                    \
+  DEBUG_NL;                                                    \
   testva##NAME (1,                                             \
                g01##NAME);                                     \
+  DEBUG_NL;                                                    \
   testva##NAME (2,                                             \
                g01##NAME, g02##NAME);                          \
+  DEBUG_NL;                                                    \
   testva##NAME (3,                                             \
                g01##NAME, g02##NAME, g03##NAME);               \
+  DEBUG_NL;                                                    \
   testva##NAME (4,                                             \
                g01##NAME, g02##NAME, g03##NAME, g04##NAME);    \
+  DEBUG_NL;                                                    \
   testva##NAME (5,                                             \
                g01##NAME, g02##NAME, g03##NAME, g04##NAME,     \
                g05##NAME);                                     \
+  DEBUG_NL;                                                    \
   testva##NAME (6,                                             \
                g01##NAME, g02##NAME, g03##NAME, g04##NAME,     \
                g05##NAME, g06##NAME);                          \
+  DEBUG_NL;                                                    \
   testva##NAME (7,                                             \
                g01##NAME, g02##NAME, g03##NAME, g04##NAME,     \
                g05##NAME, g06##NAME, g07##NAME);               \
+  DEBUG_NL;                                                    \
   testva##NAME (8,                                             \
                g01##NAME, g02##NAME, g03##NAME, g04##NAME,     \
                g05##NAME, g06##NAME, g07##NAME, g08##NAME);    \
+  DEBUG_NL;                                                    \
   testva##NAME (9,                                             \
                g01##NAME, g02##NAME, g03##NAME, g04##NAME,     \
                g05##NAME, g06##NAME, g07##NAME, g08##NAME,     \
                g09##NAME);                                     \
+  DEBUG_NL;                                                    \
   testva##NAME (10,                                            \
                g01##NAME, g02##NAME, g03##NAME, g04##NAME,     \
                g05##NAME, g06##NAME, g07##NAME, g08##NAME,     \
                g09##NAME, g10##NAME);                          \
+  DEBUG_NL;                                                    \
   testva##NAME (11,                                            \
                g01##NAME, g02##NAME, g03##NAME, g04##NAME,     \
                g05##NAME, g06##NAME, g07##NAME, g08##NAME,     \
                g09##NAME, g10##NAME, g11##NAME);               \
+  DEBUG_NL;                                                    \
   testva##NAME (12,                                            \
                g01##NAME, g02##NAME, g03##NAME, g04##NAME,     \
                g05##NAME, g06##NAME, g07##NAME, g08##NAME,     \
                g09##NAME, g10##NAME, g11##NAME, g12##NAME);    \
+  DEBUG_NL;                                                    \
   testva##NAME (13,                                            \
                g01##NAME, g02##NAME, g03##NAME, g04##NAME,     \
                g05##NAME, g06##NAME, g07##NAME, g08##NAME,     \
                g09##NAME, g10##NAME, g11##NAME, g12##NAME,     \
                g13##NAME);                                     \
+  DEBUG_NL;                                                    \
   testva##NAME (14,                                            \
                g01##NAME, g02##NAME, g03##NAME, g04##NAME,     \
                g05##NAME, g06##NAME, g07##NAME, g08##NAME,     \
                g09##NAME, g10##NAME, g11##NAME, g12##NAME,     \
                g13##NAME, g14##NAME);                          \
+  DEBUG_NL;                                                    \
   testva##NAME (15,                                            \
                g01##NAME, g02##NAME, g03##NAME, g04##NAME,     \
                g05##NAME, g06##NAME, g07##NAME, g08##NAME,     \
                g09##NAME, g10##NAME, g11##NAME, g12##NAME,     \
                g13##NAME, g14##NAME, g15##NAME);               \
+  DEBUG_NL;                                                    \
   testva##NAME (16,                                            \
                g01##NAME, g02##NAME, g03##NAME, g04##NAME,     \
                g05##NAME, g06##NAME, g07##NAME, g08##NAME,     \
                g09##NAME, g10##NAME, g11##NAME, g12##NAME,     \
                g13##NAME, g14##NAME, g15##NAME, g16##NAME);    \
-  DEBUG_FPUTS (" test2");                                      \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#NAME);                                         \
+  DEBUG_FPUTS (" test2: ");                                    \
   test2_##NAME (g01##NAME, g03##NAME, g05##NAME, g07##NAME,    \
                g09##NAME, g11##NAME, g13##NAME, g15##NAME);    \
   DEBUG_NL;                                                    \
 }
 
-extern void abort (void);
-
 T(ui, unsigned int, 51)
 T(si, int, (-55))
 T(ul, unsigned long, 61)
@@ -160,5 +169,8 @@ T(sll)
 T(d)
 T(ld)
 
+if (fails != 0)
+  abort ();
+
 #undef T
 }
index 2bc0244..7b4b60e 100644 (file)
@@ -1,15 +1,6 @@
 #include <stdarg.h>
 
-#ifdef DBG
-#include <stdio.h>
-#define DEBUG_FPUTS(x) fputs (x, stdout)
-#define DEBUG_DOT putc ('.', stdout)
-#define DEBUG_NL putc ('\n', stdout)
-#else
-#define DEBUG_FPUTS(x)
-#define DEBUG_DOT
-#define DEBUG_NL
-#endif
+#include "compat-common.h"
 
 /* Turn off checking for variable arguments with -DSKIPVA.  */
 #ifdef SKIPVA
@@ -88,7 +79,6 @@ testva##NAME (int n, ...)                                     \
       for (i = 0; i < n; i++)                                  \
        {                                                       \
          TYPE t = va_arg (ap, TYPE);                           \
-         DEBUG_DOT;                                            \
          check##NAME (t, i+1);                                 \
        }                                                       \
       va_end (ap);                                             \
index 93b64df..8426b78 100644 (file)
@@ -5,6 +5,7 @@
 
 extern void scalar_by_value_2_x (void);
 extern void exit (int);
+int fails;
 
 int
 main ()
index 0b20f5f..fae665f 100644 (file)
@@ -1,13 +1,4 @@
-#ifdef DBG
-#include <stdio.h>
-#define DEBUG_FPUTS(x) fputs (x, stdout)
-#define DEBUG_DOT putc ('.', stdout)
-#define DEBUG_NL putc ('\n', stdout)
-#else
-#define DEBUG_FPUTS(x)
-#define DEBUG_DOT
-#define DEBUG_NL
-#endif
+#include "compat-common.h"
 
 #define T(NAME, TYPE, INITVAL)                                         \
 TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME;               \
@@ -27,10 +18,7 @@ void                                                         \
 check##NAME (TYPE x, TYPE v)                                   \
 {                                                              \
   if (x != v + INITVAL)                                                \
-    {                                                          \
-      DEBUG_NL;                                                        \
-      abort ();                                                        \
-    }                                                          \
+    DEBUG_CHECK                                                        \
 }                                                              \
                                                                \
 void                                                           \
@@ -47,6 +35,7 @@ void                                                          \
 testit##NAME (void)                                            \
 {                                                              \
   DEBUG_FPUTS (#NAME);                                         \
+  DEBUG_FPUTS (" init: ");                                     \
   init##NAME (&g01##NAME,  1);                                 \
   init##NAME (&g02##NAME,  2);                                 \
   init##NAME (&g03##NAME,  3);                                 \
@@ -64,19 +53,21 @@ testit##NAME (void)                                         \
   init##NAME (&g15##NAME, 15);                                 \
   init##NAME (&g16##NAME, 16);                                 \
   checkg##NAME ();                                             \
-  DEBUG_FPUTS (" test");                                       \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#NAME);                                         \
+  DEBUG_FPUTS (" test: ");                                     \
   test##NAME (g01##NAME, g02##NAME, g03##NAME, g04##NAME,      \
              g05##NAME, g06##NAME, g07##NAME, g08##NAME,       \
              g09##NAME, g10##NAME, g11##NAME, g12##NAME,       \
              g13##NAME, g14##NAME, g15##NAME, g16##NAME);      \
-  DEBUG_FPUTS (" test2");                                      \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#NAME);                                         \
+  DEBUG_FPUTS (" test2: ");                                    \
   test2_##NAME (g01##NAME, g03##NAME, g05##NAME, g07##NAME,    \
                g09##NAME, g11##NAME, g13##NAME, g15##NAME);    \
   DEBUG_NL;                                                    \
 }
 
-extern void abort (void);
-
 T(c, char, 21)
 T(uc, unsigned char, 22)
 T(sc, signed char, (-33))
@@ -98,5 +89,8 @@ T(us)
 T(ss)
 T(f)
 
+if (fails != 0)
+  abort ();
+
 #undef T
 }
index 5b79334..2eea613 100644 (file)
@@ -1,15 +1,6 @@
 #include <stdarg.h>
 
-#ifndef DBG
-#include <stdio.h>
-#define DEBUG_FPUTS(x) fputs (x, stdout)
-#define DEBUG_DOT putc ('.', stdout)
-#define DEBUG_NL putc ('\n', stdout)
-#else
-#define DEBUG_FPUTS(x)
-#define DEBUG_DOT
-#define DEBUG_NL
-#endif
+#include "compat-common.h"
 
 #define T(NAME, TYPE, INITVAL)                                 \
 extern TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME;                \
index 0dca50b..0a27f54 100644 (file)
@@ -3,6 +3,7 @@
 
 extern void scalar_return_1_x (void);
 extern void exit (int);
+int fails;
 
 int
 main ()
index aaa634e..7e8f975 100644 (file)
@@ -1,12 +1,10 @@
-#ifdef DBG
-#include <stdio.h>
-#define DEBUG_FPUTS(x) fputs (x, stdout)
-#define DEBUG_DOT putc ('.', stdout)
-#define DEBUG_NL putc ('\n', stdout)
+#include "compat-common.h"
+
+/* Turn off checking for variable arguments with -DSKIPVA.  */
+#ifdef SKIPVA
+const int test_va = 0;
 #else
-#define DEBUG_FPUTS(x)
-#define DEBUG_DOT
-#define DEBUG_NL
+const int test_va = 1;
 #endif
 
 #define T(NAME, TYPE, INITVAL)                                         \
@@ -25,10 +23,7 @@ void                                                         \
 check##NAME (TYPE x, TYPE v)                                   \
 {                                                              \
   if (x != v)                                                  \
-    {                                                          \
-      DEBUG_NL;                                                        \
-      abort ();                                                        \
-    }                                                          \
+    DEBUG_CHECK                                                        \
 }                                                              \
                                                                \
 void                                                           \
@@ -36,6 +31,7 @@ testit##NAME (void)                                           \
 {                                                              \
   TYPE rslt;                                                   \
   DEBUG_FPUTS (#NAME);                                         \
+  DEBUG_FPUTS (" init: ");                                     \
   init##NAME (&g01##NAME,  1);                                 \
   init##NAME (&g02##NAME,  2);                                 \
   init##NAME (&g03##NAME,  3);                                 \
@@ -53,34 +49,41 @@ testit##NAME (void)                                         \
   init##NAME (&g15##NAME, 15);                                 \
   init##NAME (&g16##NAME, 16);                                 \
   checkg##NAME ();                                             \
-  DEBUG_FPUTS (" test0");                                      \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#NAME);                                         \
+  DEBUG_FPUTS (" test0: ");                                    \
   rslt = test0##NAME ();                                       \
   check##NAME (rslt, g01##NAME);                               \
-  DEBUG_FPUTS (" test1");                                      \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#NAME);                                         \
+  DEBUG_FPUTS (" test1: ");                                    \
   rslt = test1##NAME (g01##NAME);                              \
   check##NAME (rslt, g01##NAME);                               \
-  DEBUG_FPUTS (" testva");                                     \
-  rslt = testva##NAME (1, g01##NAME);                          \
-  check##NAME (rslt, g01##NAME);                               \
-  rslt = testva##NAME (5, g01##NAME, g02##NAME, g03##NAME,     \
-                      g04##NAME, g05##NAME);                   \
-  check##NAME (rslt, g05##NAME);                               \
-  rslt = testva##NAME (9, g01##NAME, g02##NAME, g03##NAME,     \
-                      g04##NAME, g05##NAME, g06##NAME,         \
-                      g07##NAME, g08##NAME, g09##NAME);        \
-  check##NAME (rslt, g09##NAME);                               \
-  rslt = testva##NAME (16, g01##NAME, g02##NAME, g03##NAME,    \
-                      g04##NAME, g05##NAME, g06##NAME,         \
-                      g07##NAME, g08##NAME, g09##NAME,         \
-                      g10##NAME, g11##NAME, g12##NAME,         \
-                      g13##NAME, g14##NAME, g15##NAME,         \
-                      g16##NAME);                              \
-  check##NAME (rslt, g16##NAME);                               \
+  if (test_va)                                                 \
+    {                                                          \
+      DEBUG_NL;                                                        \
+      DEBUG_FPUTS (#NAME);                                     \
+      DEBUG_FPUTS (" testva:");                                        \
+      rslt = testva##NAME (1, g01##NAME);                      \
+      check##NAME (rslt, g01##NAME);                           \
+      rslt = testva##NAME (5, g01##NAME, g02##NAME, g03##NAME, \
+                          g04##NAME, g05##NAME);               \
+      check##NAME (rslt, g05##NAME);                           \
+      rslt = testva##NAME (9, g01##NAME, g02##NAME, g03##NAME, \
+                          g04##NAME, g05##NAME, g06##NAME,     \
+                          g07##NAME, g08##NAME, g09##NAME);    \
+      check##NAME (rslt, g09##NAME);                           \
+      rslt = testva##NAME (16, g01##NAME, g02##NAME, g03##NAME,        \
+                          g04##NAME, g05##NAME, g06##NAME,     \
+                          g07##NAME, g08##NAME, g09##NAME,     \
+                          g10##NAME, g11##NAME, g12##NAME,     \
+                          g13##NAME, g14##NAME, g15##NAME,     \
+                          g16##NAME);                          \
+      check##NAME (rslt, g16##NAME);                           \
+    }                                                          \
   DEBUG_NL;                                                    \
 }
 
-extern void abort (void);
-
 T(ui, unsigned int, 51)
 T(si, int, (-55))
 T(ul, unsigned long, 61)
@@ -106,5 +109,8 @@ T(sll)
 T(d)
 T(ld)
 
+if (fails != 0)
+  abort ();
+
 #undef T
 }
index edf332b..f913dbb 100644 (file)
@@ -1,22 +1,6 @@
 #include <stdarg.h>
 
-#ifdef DBG
-#include <stdio.h>
-#define DEBUG_FPUTS(x) fputs (x, stdout)
-#define DEBUG_DOT putc ('.', stdout)
-#define DEBUG_NL putc ('\n', stdout)
-#else
-#define DEBUG_FPUTS(x)
-#define DEBUG_DOT
-#define DEBUG_NL
-#endif
-
-/* Turn off checking for variable arguments with -DSKIPVA.  */
-#ifdef SKIPVA
-const int test_va = 0;
-#else
-const int test_va = 1;
-#endif
+#include "compat-common.h"
 
 #define T(NAME, TYPE, INITVAL)                                 \
 extern TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME;                \
@@ -71,16 +55,10 @@ testva##NAME (int n, ...)                                   \
   int i;                                                       \
   TYPE rslt;                                                   \
   va_list ap;                                                  \
-  if (test_va)                                                 \
-    {                                                          \
-      va_start (ap, n);                                                \
-      for (i = 0; i < n; i++)                                  \
-       {                                                       \
-         rslt = va_arg (ap, TYPE);                             \
-         DEBUG_DOT;                                            \
-       }                                                       \
-      va_end (ap);                                             \
-    }                                                          \
+  va_start (ap, n);                                            \
+  for (i = 0; i < n; i++)                                      \
+    rslt = va_arg (ap, TYPE);                                  \
+  va_end (ap);                                                 \
   return rslt;                                                 \
 }
 
index 56325e3..11a5e50 100644 (file)
@@ -3,6 +3,7 @@
 
 extern void scalar_return_2_x (void);
 extern void exit (int);
+int fails;
 
 int
 main ()
index 16b4dd8..2e68d59 100644 (file)
@@ -1,13 +1,4 @@
-#ifdef DBG
-#include <stdio.h>
-#define DEBUG_FPUTS(x) fputs (x, stdout)
-#define DEBUG_DOT putc ('.', stdout)
-#define DEBUG_NL putc ('\n', stdout)
-#else
-#define DEBUG_FPUTS(x)
-#define DEBUG_DOT
-#define DEBUG_NL
-#endif
+#include "compat-common.h"
 
 #define T(NAME, TYPE, INITVAL)                                         \
 TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME;               \
@@ -24,10 +15,7 @@ void                                                         \
 check##NAME (TYPE x, TYPE v)                                   \
 {                                                              \
   if (x != v)                                                  \
-    {                                                          \
-      DEBUG_NL;                                                        \
-      abort ();                                                        \
-    }                                                          \
+    DEBUG_CHECK                                                        \
 }                                                              \
                                                                \
 void                                                           \
@@ -35,6 +23,7 @@ testit##NAME (void)                                           \
 {                                                              \
   TYPE rslt;                                                   \
   DEBUG_FPUTS (#NAME);                                         \
+  DEBUG_FPUTS (" init: ");                                     \
   init##NAME (&g01##NAME,  1);                                 \
   init##NAME (&g02##NAME,  2);                                 \
   init##NAME (&g03##NAME,  3);                                 \
@@ -52,17 +41,19 @@ testit##NAME (void)                                         \
   init##NAME (&g15##NAME, 15);                                 \
   init##NAME (&g16##NAME, 16);                                 \
   checkg##NAME ();                                             \
-  DEBUG_FPUTS (" test0");                                      \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#NAME);                                         \
+  DEBUG_FPUTS (" test0: ");                                    \
   rslt = test0##NAME ();                                       \
   check##NAME (rslt, g01##NAME);                               \
-  DEBUG_FPUTS (" test1");                                      \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#NAME);                                         \
+  DEBUG_FPUTS (" test1: ");                                    \
   rslt = test1##NAME (g01##NAME);                              \
   check##NAME (rslt, g01##NAME);                               \
   DEBUG_NL;                                                    \
 }
 
-extern void abort (void);
-
 T(c, char, 21)
 T(uc, unsigned char, 22)
 T(sc, signed char, (-33))
@@ -84,5 +75,8 @@ T(us)
 T(ss)
 T(f)
 
+if (fails != 0)
+  abort ();
+
 #undef T
 }
index 89a824c..1f7d549 100644 (file)
@@ -1,15 +1,6 @@
 #include <stdarg.h>
 
-#ifdef DBG
-#include <stdio.h>
-#define DEBUG_FPUTS(x) fputs (x, stdout)
-#define DEBUG_DOT putc ('.', stdout)
-#define DEBUG_NL putc ('\n', stdout)
-#else
-#define DEBUG_FPUTS(x)
-#define DEBUG_DOT
-#define DEBUG_NL
-#endif
+#include "compat-common.h"
 
 /* Turn off checking for variable arguments with -DSKIPVA.  */
 #ifdef SKIPVA
index 9ae103f..85b334c 100644 (file)
@@ -1,29 +1,29 @@
 /* Function definitions that are used by multiple tests.  */
 
-void checkSc (Sc x, int i) { if (x.c != (char)i) { DEBUG_NL; abort (); } }
-void checkSs (Ss x, int i) { if (x.s != i) { DEBUG_NL; abort (); } }
-void checkSi (Si x, int i) { if (x.i != i) { DEBUG_NL; abort (); } }
+void checkSc (Sc x, int i) { if (x.c != (char)i) DEBUG_CHECK }
+void checkSs (Ss x, int i) { if (x.s != i) DEBUG_CHECK }
+void checkSi (Si x, int i) { if (x.i != i) DEBUG_CHECK }
 void checkSsc (Ssc x, int i)
-{ if (x.s != i || x.c != (char)i+1) { DEBUG_NL; abort (); } }
+{ if (x.s != i || x.c != (char)i+1) DEBUG_CHECK }
 void checkScs (Scs x, int i)
-{ if (x.c != (char)i || x.s != i+1) { DEBUG_NL; abort (); } }
+{ if (x.c != (char)i || x.s != i+1) DEBUG_CHECK }
 void checkSsi (Ssi x, int i)
-{ if (x.s != i || x.i != i+1) { DEBUG_NL; abort (); } }
+{ if (x.s != i || x.i != i+1) DEBUG_CHECK }
 void checkSis (Sis x, int i)
-{ if (x.i != i || x.s != i+1) { DEBUG_NL; abort (); } }
+{ if (x.i != i || x.s != i+1) DEBUG_CHECK }
 void checkSic (Sic x, int i)
-{ if (x.i != i || x.c != (char)i+1) { DEBUG_NL; abort (); } }
+{ if (x.i != i || x.c != (char)i+1) DEBUG_CHECK }
 void checkSci (Sci x, int i)
-{ if (x.c != (char)i || x.i != i+1) { DEBUG_NL; abort (); } }
+{ if (x.c != (char)i || x.i != i+1) DEBUG_CHECK }
 void checkScsi (Scsi x, int i)
-{ if (x.c != (char)i || x.s != i+1 || x.i != i+2) { DEBUG_NL; abort (); } }
+{ if (x.c != (char)i || x.s != i+1 || x.i != i+2) DEBUG_CHECK }
 void checkScis (Scis x, int i)
-{ if (x.c != (char)i || x.i != i+1 || x.s != i+2) { DEBUG_NL; abort (); } }
+{ if (x.c != (char)i || x.i != i+1 || x.s != i+2) DEBUG_CHECK }
 void checkSsci (Ssci x, int i)
-{ if (x.s != i || x.c != (char)i+1 || x.i != i+2) { DEBUG_NL; abort (); } }
+{ if (x.s != i || x.c != (char)i+1 || x.i != i+2) DEBUG_CHECK }
 void checkSsic (Ssic x, int i)
-{ if (x.s != i || x.i != i+1 || x.c != (char)i+2) { DEBUG_NL; abort (); } }
+{ if (x.s != i || x.i != i+1 || x.c != (char)i+2) DEBUG_CHECK }
 void checkSisc (Sisc x, int i)
-{ if (x.i != i || x.s != i+1 || x.c != (char)i+2) { DEBUG_NL; abort (); } }
+{ if (x.i != i || x.s != i+1 || x.c != (char)i+2) DEBUG_CHECK }
 void checkSics (Sics x, int i)
-{ if (x.i != i || x.c != (char)i+1 || x.s != i+2) { DEBUG_NL; abort (); } }
+{ if (x.i != i || x.c != (char)i+1 || x.s != i+2) DEBUG_CHECK }
index 621c654..8cb6fc0 100644 (file)
@@ -4,6 +4,7 @@
 
 extern void struct_by_value_2_x (void);
 extern void exit (int);
+int fails;
 
 int
 main ()
index 79c47ce..ce455bf 100644 (file)
@@ -1,13 +1,4 @@
-#ifdef DBG
-#include <stdio.h>
-#define DEBUG_FPUTS(x) fputs (x, stdout)
-#define DEBUG_DOT putc ('.', stdout)
-#define DEBUG_NL putc ('\n', stdout)
-#else
-#define DEBUG_FPUTS(x)
-#define DEBUG_DOT
-#define DEBUG_NL
-#endif
+#include "compat-common.h"
 
 #define T(N, NAME, TYPE)                                       \
 struct S##NAME##N { TYPE i[N]; };                              \
@@ -44,10 +35,7 @@ check##NAME##N (struct S##NAME##N *p, int i)                 \
   int j;                                                       \
   for (j = 0; j < N; j++)                                      \
     if (p->i[j] != (TYPE) (i + j))                             \
-      {                                                                \
-       DEBUG_NL;                                               \
-       abort ();                                               \
-      }                                                                \
+      DEBUG_CHECK                                              \
 }                                                              \
                                                                \
 void                                                           \
@@ -66,6 +54,7 @@ void                                                          \
 testit##NAME##N (void)                                         \
 {                                                              \
   DEBUG_FPUTS (#NAME "[" #N "]");                              \
+  DEBUG_FPUTS (" init: ");                                     \
   init##NAME##N  ( &g1s##NAME##N,  1*16);                      \
   init##NAME##N  ( &g2s##NAME##N,  2*16);                      \
   init##NAME##N  ( &g3s##NAME##N,  3*16);                      \
@@ -83,7 +72,9 @@ testit##NAME##N (void)                                                \
   init##NAME##N  (&g15s##NAME##N, 15*16);                      \
   init##NAME##N  (&g16s##NAME##N, 16*16);                      \
   checkg##NAME##N ();                                          \
-  DEBUG_FPUTS (" test");                                       \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#NAME "[" #N "]");                              \
+  DEBUG_FPUTS (" test: ");                                     \
   test##NAME##N (g1s##NAME##N, g2s##NAME##N,                   \
                 g3s##NAME##N, g4s##NAME##N,                    \
                 g5s##NAME##N, g6s##NAME##N,                    \
@@ -92,7 +83,9 @@ testit##NAME##N (void)                                                \
                 g11s##NAME##N, g12s##NAME##N,                  \
                 g13s##NAME##N, g14s##NAME##N,                  \
                 g15s##NAME##N, g16s##NAME##N);                 \
-  DEBUG_FPUTS (" testva");                                     \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#NAME "[" #N "]");                              \
+  DEBUG_FPUTS (" testva:");                                    \
   testva##NAME##N (16,                                         \
                   g1s##NAME##N, g2s##NAME##N,                  \
                   g3s##NAME##N, g4s##NAME##N,                  \
@@ -102,7 +95,9 @@ testit##NAME##N (void)                                               \
                   g11s##NAME##N, g12s##NAME##N,                \
                   g13s##NAME##N, g14s##NAME##N,                \
                   g15s##NAME##N, g16s##NAME##N);               \
-  DEBUG_FPUTS (" test2");                                      \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#NAME "[" #N "]");                              \
+  DEBUG_FPUTS (" test2: ");                                    \
   test2_##NAME##N (g1s##NAME##N, g3s##NAME##N,                 \
                   g5s##NAME##N, g7s##NAME##N,                  \
                   g9s##NAME##N, g11s##NAME##N,                 \
@@ -110,8 +105,6 @@ testit##NAME##N (void)                                              \
   DEBUG_NL;                                                    \
 }
 
-extern void abort (void);
-
 T(0, uc, unsigned char)
 T(1, uc, unsigned char)
 T(2, uc, unsigned char)
@@ -217,5 +210,8 @@ T(13, ui, unsigned int)
 T(14, ui, unsigned int)
 T(15, ui, unsigned int)
 
+if (fails != 0)
+  abort ();
+
 #undef T
 }
index 1e84385..f5b3c71 100644 (file)
@@ -1,15 +1,6 @@
 #include <stdarg.h>
 
-#ifdef DBG
-#include <stdio.h>
-#define DEBUG_FPUTS(x) fputs (x, stdout)
-#define DEBUG_DOT putc ('.', stdout)
-#define DEBUG_NL putc ('\n', stdout)
-#else
-#define DEBUG_FPUTS(x)
-#define DEBUG_DOT
-#define DEBUG_NL
-#endif
+#include "compat-common.h"
 
 /* Turn off checking for variable arguments with -DSKIPVA.  */
 #ifdef SKIPVA
@@ -76,37 +67,21 @@ test##NAME##N (struct S##NAME##N s1, struct S##NAME##N s2,  \
               struct S##NAME##N s13, struct S##NAME##N s14,    \
               struct S##NAME##N s15, struct S##NAME##N s16)    \
 {                                                              \
-  DEBUG_DOT;                                                   \
   check##NAME##N (&s1, 1*16);                                  \
-  DEBUG_DOT;                                                   \
   check##NAME##N (&s2, 2*16);                                  \
-  DEBUG_DOT;                                                   \
   check##NAME##N (&s3, 3*16);                                  \
-  DEBUG_DOT;                                                   \
   check##NAME##N (&s4, 4*16);                                  \
-  DEBUG_DOT;                                                   \
   check##NAME##N (&s5, 5*16);                                  \
-  DEBUG_DOT;                                                   \
   check##NAME##N (&s6, 6*16);                                  \
-  DEBUG_DOT;                                                   \
   check##NAME##N (&s7, 7*16);                                  \
-  DEBUG_DOT;                                                   \
   check##NAME##N (&s8, 8*16);                                  \
-  DEBUG_DOT;                                                   \
   check##NAME##N (&s9, 9*16);                                  \
-  DEBUG_DOT;                                                   \
   check##NAME##N (&s10, 10*16);                                        \
-  DEBUG_DOT;                                                   \
   check##NAME##N (&s11, 11*16);                                        \
-  DEBUG_DOT;                                                   \
   check##NAME##N (&s12, 12*16);                                        \
-  DEBUG_DOT;                                                   \
   check##NAME##N (&s13, 13*16);                                        \
-  DEBUG_DOT;                                                   \
   check##NAME##N (&s14, 14*16);                                        \
-  DEBUG_DOT;                                                   \
   check##NAME##N (&s15, 15*16);                                        \
-  DEBUG_DOT;                                                   \
   check##NAME##N (&s16, 16*16);                                        \
 }                                                              \
                                                                \
@@ -121,7 +96,6 @@ testva##NAME##N (int n, ...)                                 \
       for (i = 0; i < n; i++)                                  \
        {                                                       \
          struct S##NAME##N t = va_arg (ap, struct S##NAME##N); \
-         DEBUG_DOT;                                            \
          check##NAME##N (&t, (i+1)*16);                        \
        }                                                       \
       va_end (ap);                                             \
index 86fb4a3..0b72068 100644 (file)
@@ -5,6 +5,7 @@
 
 extern void struct_by_value_3_x (void);
 extern void exit (int);
+int fails;
 
 int
 main ()
index 3eaa034..4490f48 100644 (file)
@@ -1,13 +1,4 @@
-#ifdef DBG
-#include <stdio.h>
-#define DEBUG_FPUTS(x) fputs (x, stdout)
-#define DEBUG_DOT putc ('.', stdout)
-#define DEBUG_NL putc ('\n', stdout)
-#else
-#define DEBUG_FPUTS(x)
-#define DEBUG_DOT
-#define DEBUG_NL
-#endif
+#include "compat-common.h"
 
 #define T(TYPE)                                                        \
 TYPE g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE;               \
@@ -38,6 +29,7 @@ void                                                          \
 testit##TYPE (void)                                            \
 {                                                              \
   DEBUG_FPUTS (#TYPE);                                         \
+  DEBUG_FPUTS (" init: ");                                     \
   init##TYPE  ( &g1s##TYPE,  1);                               \
   init##TYPE  ( &g2s##TYPE,  2);                               \
   init##TYPE  ( &g3s##TYPE,  3);                               \
@@ -55,76 +47,96 @@ testit##TYPE (void)                                         \
   init##TYPE  (&g15s##TYPE, 15);                               \
   init##TYPE  (&g16s##TYPE, 16);                               \
   checkg##TYPE ();                                             \
-  DEBUG_FPUTS (" test");                                       \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#TYPE);                                         \
+  DEBUG_FPUTS (" test: ");                                     \
   test##TYPE (g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE,      \
              g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE,       \
              g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE,    \
              g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE);  \
-  DEBUG_FPUTS (" testva");                                     \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#TYPE);                                         \
+  DEBUG_FPUTS (" testva:");                                    \
+  DEBUG_NL;                                                    \
   testva##TYPE (1,                                             \
                g1s##TYPE);                                     \
+  DEBUG_NL;                                                    \
   testva##TYPE (2,                                             \
                g1s##TYPE, g2s##TYPE);                          \
+  DEBUG_NL;                                                    \
   testva##TYPE (3,                                             \
                g1s##TYPE, g2s##TYPE, g3s##TYPE);               \
+  DEBUG_NL;                                                    \
   testva##TYPE (4,                                             \
                g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE);    \
+  DEBUG_NL;                                                    \
   testva##TYPE (5,                                             \
                g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE,     \
                g5s##TYPE);                                     \
+  DEBUG_NL;                                                    \
   testva##TYPE (6,                                             \
                g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE,     \
                g5s##TYPE, g6s##TYPE);                          \
+  DEBUG_NL;                                                    \
   testva##TYPE (7,                                             \
                g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE,     \
                g5s##TYPE, g6s##TYPE, g7s##TYPE);               \
+  DEBUG_NL;                                                    \
   testva##TYPE (8,                                             \
                g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE,     \
                g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE);    \
+  DEBUG_NL;                                                    \
   testva##TYPE (9,                                             \
                g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE,     \
                g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE,     \
                g9s##TYPE);                                     \
+  DEBUG_NL;                                                    \
   testva##TYPE (10,                                            \
                g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE,     \
                g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE,     \
                g9s##TYPE, g10s##TYPE);                         \
+  DEBUG_NL;                                                    \
   testva##TYPE (11,                                            \
                g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE,     \
                g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE,     \
                g9s##TYPE, g10s##TYPE, g11s##TYPE);             \
+  DEBUG_NL;                                                    \
   testva##TYPE (12,                                            \
                g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE,     \
                g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE,     \
                g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE); \
+  DEBUG_NL;                                                    \
   testva##TYPE (13,                                            \
                g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE,     \
                g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE,     \
                g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE,  \
                g13s##TYPE);                                    \
+  DEBUG_NL;                                                    \
   testva##TYPE (14,                                            \
                g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE,     \
                g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE,     \
                g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE,  \
                g13s##TYPE, g14s##TYPE);                        \
+  DEBUG_NL;                                                    \
   testva##TYPE (15,                                            \
                g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE,     \
                g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE,     \
                g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE,  \
                g13s##TYPE, g14s##TYPE, g15s##TYPE);            \
+  DEBUG_NL;                                                    \
   testva##TYPE (16,                                            \
                g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE,     \
                g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE,     \
                g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE,  \
                g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE); \
-  DEBUG_FPUTS (" test2");                                      \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#TYPE);                                         \
+  DEBUG_FPUTS (" test2:");                                     \
   test2_##TYPE (g1s##TYPE, g3s##TYPE, g5s##TYPE, g7s##TYPE,    \
                g9s##TYPE, g11s##TYPE, g13s##TYPE, g15s##TYPE); \
   DEBUG_NL;                                                    \
 }
 
-extern void abort (void);
-
 #include "small-struct-defs.h"
 #include "small-struct-check.h"
 
@@ -167,5 +179,8 @@ T(Ssic)
 T(Sisc)
 T(Sics)
 
+if (fails != 0)
+  abort ();
+
 #undef T
 }
index 87deacd..571bea8 100644 (file)
@@ -1,15 +1,6 @@
 #include <stdarg.h>
 
-#ifdef DBG
-#include <stdio.h>
-#define DEBUG_FPUTS(x) fputs (x, stdout)
-#define DEBUG_DOT putc ('.', stdout)
-#define DEBUG_NL putc ('\n', stdout)
-#else
-#define DEBUG_FPUTS(x)
-#define DEBUG_DOT
-#define DEBUG_NL
-#endif
+#include "compat-common.h"
 
 /* Turn off checking for variable arguments with -DSKIPVA.  */
 #ifdef SKIPVA
@@ -71,37 +62,21 @@ test##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4,                     \
            TYPE s9, TYPE s10, TYPE s11, TYPE s12,              \
            TYPE s13, TYPE s14, TYPE s15, TYPE s16)             \
 {                                                              \
-  DEBUG_DOT;                                                   \
   check##TYPE (s1, 1);                                         \
-  DEBUG_DOT;                                                   \
   check##TYPE (s2, 2);                                         \
-  DEBUG_DOT;                                                   \
   check##TYPE (s3, 3);                                         \
-  DEBUG_DOT;                                                   \
   check##TYPE (s4, 4);                                         \
-  DEBUG_DOT;                                                   \
   check##TYPE (s5, 5);                                         \
-  DEBUG_DOT;                                                   \
   check##TYPE (s6, 6);                                         \
-  DEBUG_DOT;                                                   \
   check##TYPE (s7, 7);                                         \
-  DEBUG_DOT;                                                   \
   check##TYPE (s8, 8);                                         \
-  DEBUG_DOT;                                                   \
   check##TYPE (s9, 9);                                         \
-  DEBUG_DOT;                                                   \
   check##TYPE (s10, 10);                                       \
-  DEBUG_DOT;                                                   \
   check##TYPE (s11, 11);                                       \
-  DEBUG_DOT;                                                   \
   check##TYPE (s12, 12);                                       \
-  DEBUG_DOT;                                                   \
   check##TYPE (s13, 13);                                       \
-  DEBUG_DOT;                                                   \
   check##TYPE (s14, 14);                                       \
-  DEBUG_DOT;                                                   \
   check##TYPE (s15, 15);                                       \
-  DEBUG_DOT;                                                   \
   check##TYPE (s16, 16);                                       \
 }                                                              \
                                                                \
@@ -116,7 +91,6 @@ testva##TYPE (int n, ...)                                    \
       for (i = 0; i < n; i++)                                  \
        {                                                       \
          TYPE t = va_arg (ap, TYPE);                           \
-         DEBUG_DOT;                                            \
          check##TYPE (t, i+1);                                 \
        }                                                       \
       va_end (ap);                                             \
index 0344393..570eddc 100644 (file)
@@ -4,6 +4,7 @@
 
 extern void struct_by_value_4_x (void);
 extern void exit (int);
+int fails;
 
 int
 main ()
index e857ac0..4b24cd5 100644 (file)
@@ -1,13 +1,4 @@
-#ifdef DBG
-#include <stdio.h>
-#define DEBUG_FPUTS(x) fputs (x, stdout)
-#define DEBUG_DOT putc ('.', stdout)
-#define DEBUG_NL putc ('\n', stdout)
-#else
-#define DEBUG_FPUTS(x)
-#define DEBUG_DOT
-#define DEBUG_NL
-#endif
+#include "compat-common.h"
 
 #define T(N, TYPE)                                             \
 struct S##TYPE##N { TYPE i[N]; };                              \
@@ -67,6 +58,7 @@ void                                                          \
 testit##TYPE##N (void)                                         \
 {                                                              \
   DEBUG_FPUTS (#TYPE "[" #N "]");                              \
+  DEBUG_FPUTS (" init: ");                                     \
   init##TYPE##N  ( &g1s##TYPE##N,  1*16);                      \
   init##TYPE##N  ( &g2s##TYPE##N,  2*16);                      \
   init##TYPE##N  ( &g3s##TYPE##N,  3*16);                      \
@@ -84,7 +76,9 @@ testit##TYPE##N (void)                                                \
   init##TYPE##N  (&g15s##TYPE##N, 15*16);                      \
   init##TYPE##N  (&g16s##TYPE##N, 16*16);                      \
   checkg##TYPE##N ();                                          \
-  DEBUG_FPUTS (" test");                                       \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#TYPE "[" #N "]");                              \
+  DEBUG_FPUTS (" test: ");                                     \
   test##TYPE##N (g1s##TYPE##N, g2s##TYPE##N,                   \
                 g3s##TYPE##N, g4s##TYPE##N,                    \
                 g5s##TYPE##N, g6s##TYPE##N,                    \
@@ -93,7 +87,9 @@ testit##TYPE##N (void)                                                \
                 g11s##TYPE##N, g12s##TYPE##N,                  \
                 g13s##TYPE##N, g14s##TYPE##N,                  \
                 g15s##TYPE##N, g16s##TYPE##N);                 \
-  DEBUG_FPUTS (" testva");                                     \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#TYPE "[" #N "]");                              \
+  DEBUG_FPUTS (" testva:");                                    \
   testva##TYPE##N (16,                                         \
                   g1s##TYPE##N, g2s##TYPE##N,                  \
                   g3s##TYPE##N, g4s##TYPE##N,                  \
@@ -103,7 +99,9 @@ testit##TYPE##N (void)                                               \
                   g11s##TYPE##N, g12s##TYPE##N,                \
                   g13s##TYPE##N, g14s##TYPE##N,                \
                   g15s##TYPE##N, g16s##TYPE##N);               \
-  DEBUG_FPUTS (" test2");                                      \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#TYPE "[" #N "]");                              \
+  DEBUG_FPUTS (" test2: ");                                    \
   test2_##TYPE##N (g1s##TYPE##N, g3s##TYPE##N,                 \
                   g5s##TYPE##N, g7s##TYPE##N,                  \
                   g9s##TYPE##N, g11s##TYPE##N,                 \
@@ -119,19 +117,17 @@ typedef struct { int i; short s; } Sis;
 typedef struct { char c; short s; int i; } Scsi;
 typedef struct { char c; int i; short s; } Scis;
 
-extern void abort (void);
-
-void checkSc (Sc x, int i) { if (x.c != i/16) { DEBUG_NL; abort (); } }
-void checkSs (Ss x, int i) { if (x.s != i) { DEBUG_NL; abort (); } }
-void checkSi (Si x, int i) { if (x.i != i) { DEBUG_NL; abort (); } }
+void checkSc (Sc x, int i) { if (x.c != i/16) DEBUG_CHECK }
+void checkSs (Ss x, int i) { if (x.s != i) DEBUG_CHECK }
+void checkSi (Si x, int i) { if (x.i != i) DEBUG_CHECK }
 void checkSsc (Ssc x, int i)
-{ if (x.s != i || x.c != (i/16)+1) { DEBUG_NL; abort (); } }
+{ if (x.s != i || x.c != (i/16)+1) DEBUG_CHECK }
 void checkSis (Sis x, int i)
-{ if (x.i != i || x.s != i+1) { DEBUG_NL; abort (); } }
+{ if (x.i != i || x.s != i+1) DEBUG_CHECK }
 void checkScsi (Scsi x, int i)
-{ if (x.c != i/16 || x.s != i+1 || x.i != i+2) { DEBUG_NL; abort (); } }
+{ if (x.c != i/16 || x.s != i+1 || x.i != i+2) DEBUG_CHECK }
 void checkScis (Scis x, int i)
-{ if (x.c != i/16 || x.i != i+1 || x.s != i+2) { DEBUG_NL; abort (); } }
+{ if (x.c != i/16 || x.i != i+1 || x.s != i+2) DEBUG_CHECK }
 
 T(0, Sc)
 T(1, Sc)
@@ -238,5 +234,8 @@ T(13, Si)
 T(14, Si)
 T(15, Si)
 
+if (fails != 0)
+  abort ();
+
 #undef T
 }
index 1e21d8a..2541dd0 100644 (file)
@@ -1,15 +1,6 @@
 #include <stdarg.h>
 
-#ifdef DBG
-#include <stdio.h>
-#define DEBUG_FPUTS(x) fputs (x, stdout)
-#define DEBUG_DOT putc ('.', stdout)
-#define DEBUG_NL putc ('\n', stdout)
-#else
-#define DEBUG_FPUTS(x)
-#define DEBUG_DOT
-#define DEBUG_NL
-#endif
+#include "compat-common.h"
 
 /* Turn off checking for variable arguments with -DSKIPVA.  */
 #ifdef SKIPVA
@@ -81,37 +72,21 @@ test##TYPE##N (struct S##TYPE##N s1, struct S##TYPE##N s2,  \
               struct S##TYPE##N s13, struct S##TYPE##N s14,    \
               struct S##TYPE##N s15, struct S##TYPE##N s16)    \
 {                                                              \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s1, 1*16);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s2, 2*16);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s3, 3*16);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s4, 4*16);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s5, 5*16);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s6, 6*16);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s7, 7*16);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s8, 8*16);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s9, 9*16);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s10, 10*16);                                        \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s11, 11*16);                                        \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s12, 12*16);                                        \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s13, 13*16);                                        \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s14, 14*16);                                        \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s15, 15*16);                                        \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s16, 16*16);                                        \
 }                                                              \
                                                                \
@@ -126,7 +101,6 @@ testva##TYPE##N (int n, ...)                                        \
       for (i = 0; i < n; i++)                                  \
        {                                                       \
          struct S##TYPE##N t = va_arg (ap, struct S##TYPE##N); \
-         DEBUG_DOT;                                            \
          check##TYPE##N (&t, (i+1)*16);                        \
        }                                                       \
       va_end (ap);                                             \
index d4e0da6..32eaafb 100644 (file)
@@ -4,6 +4,7 @@
 
 extern void struct_by_value_5_x (void);
 extern void exit (int);
+int fails;
 
 int
 main ()
index 69169ca..6db7771 100644 (file)
@@ -1,20 +1,9 @@
-#ifdef DBG
-#include <stdio.h>
-#define DEBUG_FPUTS(x) fputs (x, stdout)
-#define DEBUG_DOT putc ('.', stdout)
-#define DEBUG_NL putc ('\n', stdout)
-#else
-#define DEBUG_FPUTS(x)
-#define DEBUG_DOT
-#define DEBUG_NL
-#endif
+#include "compat-common.h"
 
 #include "fp-struct-defs.h"
 #include "fp-struct-check.h"
 #include "fp-struct-test-by-value-x.h"
 
-extern void abort (void);
-
 DEFS(f, float)
 CHECKS(f, float)
 
@@ -59,5 +48,8 @@ T(Sf14, float)
 T(Sf15, float)
 T(Sf16, float)
 
+if (fails != 0)
+  abort ();
+
 #undef T
 }
index b9702ae..9290b8f 100644 (file)
@@ -1,15 +1,6 @@
 #include <stdarg.h>
 
-#ifdef DBG
-#include <stdio.h>
-#define DEBUG_FPUTS(x) fputs (x, stdout)
-#define DEBUG_DOT putc ('.', stdout)
-#define DEBUG_NL putc ('\n', stdout)
-#else
-#define DEBUG_FPUTS(x)
-#define DEBUG_DOT
-#define DEBUG_NL
-#endif
+#include "compat-common.h"
 
 /* Turn off checking for variable arguments with -DSKIPVA.  */
 #ifdef SKIPVA
index 4e7308f..39dc31f 100644 (file)
@@ -4,6 +4,7 @@
 
 extern void struct_by_value_6_x (void);
 extern void exit (int);
+int fails;
 
 int
 main ()
index 4b87017..cef1523 100644 (file)
@@ -1,20 +1,9 @@
-#ifdef DBG
-#include <stdio.h>
-#define DEBUG_FPUTS(x) fputs (x, stdout)
-#define DEBUG_DOT putc ('.', stdout)
-#define DEBUG_NL putc ('\n', stdout)
-#else
-#define DEBUG_FPUTS(x)
-#define DEBUG_DOT
-#define DEBUG_NL
-#endif
+#include "compat-common.h"
 
 #include "fp-struct-defs.h"
 #include "fp-struct-check.h"
 #include "fp-struct-test-by-value-x.h"
 
-extern void abort (void);
-
 DEFS(d, double)
 CHECKS(d, double)
 
@@ -59,5 +48,8 @@ T(Sd14, double)
 T(Sd15, double)
 T(Sd16, double)
 
+if (fails != 0)
+  abort ();
+
 #undef T
 }
index 49cc5d2..b5bc100 100644 (file)
@@ -1,15 +1,6 @@
 #include <stdarg.h>
 
-#ifdef DBG
-#include <stdio.h>
-#define DEBUG_FPUTS(x) fputs (x, stdout)
-#define DEBUG_DOT putc ('.', stdout)
-#define DEBUG_NL putc ('\n', stdout)
-#else
-#define DEBUG_FPUTS(x)
-#define DEBUG_DOT
-#define DEBUG_NL
-#endif
+#include "compat-common.h"
 
 /* Turn off checking for variable arguments with -DSKIPVA.  */
 #ifdef SKIPVA
index 7f0264c..98caf42 100644 (file)
@@ -4,6 +4,7 @@
 
 extern void struct_by_value_7_x (void);
 extern void exit (int);
+int fails;
 
 int
 main ()
index 7f9d09a..30d9450 100644 (file)
@@ -1,20 +1,9 @@
-#ifdef DBG
-#include <stdio.h>
-#define DEBUG_FPUTS(x) fputs (x, stdout)
-#define DEBUG_DOT putc ('.', stdout)
-#define DEBUG_NL putc ('\n', stdout)
-#else
-#define DEBUG_FPUTS(x)
-#define DEBUG_DOT
-#define DEBUG_NL
-#endif
+#include "compat-common.h"
 
 #include "fp-struct-defs.h"
 #include "fp-struct-check.h"
 #include "fp-struct-test-by-value-x.h"
 
-extern void abort (void);
-
 DEFS(ld, long double)
 CHECKS(ld, long double)
 
@@ -59,5 +48,8 @@ T(Sld14, long double)
 T(Sld15, long double)
 T(Sld16, long double)
 
+if (fails != 0)
+  abort ();
+
 #undef T
 }
index bccff5d..ca52a9b 100644 (file)
@@ -1,15 +1,6 @@
 #include <stdarg.h>
 
-#ifdef DBG
-#include <stdio.h>
-#define DEBUG_FPUTS(x) fputs (x, stdout)
-#define DEBUG_DOT putc ('.', stdout)
-#define DEBUG_NL putc ('\n', stdout)
-#else
-#define DEBUG_FPUTS(x)
-#define DEBUG_DOT
-#define DEBUG_NL
-#endif
+#include "compat-common.h"
 
 /* Turn off checking for variable arguments with -DSKIPVA.  */
 #ifdef SKIPVA
index 6ede893..cc094fc 100644 (file)
@@ -4,6 +4,7 @@
 
 extern void struct_by_value_8_x (void);
 extern void exit (int);
+int fails;
 
 int
 main ()
index 8695e89..6c983c5 100644 (file)
@@ -1,13 +1,4 @@
-#ifdef DBG
-#include <stdio.h>
-#define DEBUG_FPUTS(x) fputs (x, stdout)
-#define DEBUG_DOT putc ('.', stdout)
-#define DEBUG_NL putc ('\n', stdout)
-#else
-#define DEBUG_FPUTS(x)
-#define DEBUG_DOT
-#define DEBUG_NL
-#endif
+#include "compat-common.h"
 
 #define T(N, TYPE)                                             \
 struct S##TYPE##N { TYPE i[N]; };                              \
@@ -67,6 +58,7 @@ void                                                          \
 testit##TYPE##N (void)                                         \
 {                                                              \
   DEBUG_FPUTS (#TYPE "[" #N "]");                              \
+  DEBUG_FPUTS (" init: ");                                     \
   init##TYPE##N  ( &g1s##TYPE##N,  1*16);                      \
   init##TYPE##N  ( &g2s##TYPE##N,  2*16);                      \
   init##TYPE##N  ( &g3s##TYPE##N,  3*16);                      \
@@ -84,7 +76,9 @@ testit##TYPE##N (void)                                                \
   init##TYPE##N  (&g15s##TYPE##N, 15*16);                      \
   init##TYPE##N  (&g16s##TYPE##N, 16*16);                      \
   checkg##TYPE##N ();                                          \
-  DEBUG_FPUTS (" test");                                       \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#TYPE "[" #N "]");                              \
+  DEBUG_FPUTS (" test: ");                                     \
   test##TYPE##N (g1s##TYPE##N, g2s##TYPE##N,                   \
                 g3s##TYPE##N, g4s##TYPE##N,                    \
                 g5s##TYPE##N, g6s##TYPE##N,                    \
@@ -93,7 +87,9 @@ testit##TYPE##N (void)                                                \
                 g11s##TYPE##N, g12s##TYPE##N,                  \
                 g13s##TYPE##N, g14s##TYPE##N,                  \
                 g15s##TYPE##N, g16s##TYPE##N);                 \
-  DEBUG_FPUTS (" testva");                                     \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#TYPE "[" #N "]");                              \
+  DEBUG_FPUTS (" testva:");                                    \
   testva##TYPE##N (16,                                         \
                   g1s##TYPE##N, g2s##TYPE##N,                  \
                   g3s##TYPE##N, g4s##TYPE##N,                  \
@@ -103,7 +99,9 @@ testit##TYPE##N (void)                                               \
                   g11s##TYPE##N, g12s##TYPE##N,                \
                   g13s##TYPE##N, g14s##TYPE##N,                \
                   g15s##TYPE##N, g16s##TYPE##N);               \
-  DEBUG_FPUTS (" test2");                                      \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#TYPE "[" #N "]");                              \
+  DEBUG_FPUTS (" test2: ");                                    \
   test2_##TYPE##N (g1s##TYPE##N, g3s##TYPE##N,                 \
                   g5s##TYPE##N, g7s##TYPE##N,                  \
                   g9s##TYPE##N, g11s##TYPE##N,                 \
@@ -119,19 +117,17 @@ typedef struct { int i; short s; } Sis;
 typedef struct { char c; short s; int i; } Scsi;
 typedef struct { char c; int i; short s; } Scis;
 
-extern void abort (void);
-
-void checkSc (Sc x, int i) { if (x.c != i/16) { DEBUG_NL; abort (); } }
-void checkSs (Ss x, int i) { if (x.s != i) { DEBUG_NL; abort (); } }
-void checkSi (Si x, int i) { if (x.i != i) { DEBUG_NL; abort (); } }
+void checkSc (Sc x, int i) { if (x.c != i/16) DEBUG_CHECK }
+void checkSs (Ss x, int i) { if (x.s != i) DEBUG_CHECK }
+void checkSi (Si x, int i) { if (x.i != i) DEBUG_CHECK }
 void checkSsc (Ssc x, int i)
-{ if (x.s != i || x.c != (i/16)+1) { DEBUG_NL; abort (); } }
+{ if (x.s != i || x.c != (i/16)+1) DEBUG_CHECK }
 void checkSis (Sis x, int i)
-{ if (x.i != i || x.s != i+1) { DEBUG_NL; abort (); } }
+{ if (x.i != i || x.s != i+1) DEBUG_CHECK }
 void checkScsi (Scsi x, int i)
-{ if (x.c != i/16 || x.s != i+1 || x.i != i+2) { DEBUG_NL; abort (); } }
+{ if (x.c != i/16 || x.s != i+1 || x.i != i+2) DEBUG_CHECK }
 void checkScis (Scis x, int i)
-{ if (x.c != i/16 || x.i != i+1 || x.s != i+2) { DEBUG_NL; abort (); } }
+{ if (x.c != i/16 || x.i != i+1 || x.s != i+2) DEBUG_CHECK }
 
 T(0, Ssc)
 T(1, Ssc)
@@ -206,5 +202,8 @@ T(13, Sis)
 T(14, Sis)
 T(15, Sis)
 
+if (fails != 0)
+  abort ();
+
 #undef T
 }
index e776fc3..9dadfb0 100644 (file)
@@ -1,15 +1,6 @@
 #include <stdarg.h>
 
-#ifdef DBG
-#include <stdio.h>
-#define DEBUG_FPUTS(x) fputs (x, stdout)
-#define DEBUG_DOT putc ('.', stdout)
-#define DEBUG_NL putc ('\n', stdout)
-#else
-#define DEBUG_FPUTS(x)
-#define DEBUG_DOT
-#define DEBUG_NL
-#endif
+#include "compat-common.h"
 
 /* Turn off checking for variable arguments with -DSKIPVA.  */
 #ifdef SKIPVA
@@ -81,37 +72,21 @@ test##TYPE##N (struct S##TYPE##N s1, struct S##TYPE##N s2,  \
               struct S##TYPE##N s13, struct S##TYPE##N s14,    \
               struct S##TYPE##N s15, struct S##TYPE##N s16)    \
 {                                                              \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s1, 1*16);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s2, 2*16);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s3, 3*16);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s4, 4*16);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s5, 5*16);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s6, 6*16);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s7, 7*16);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s8, 8*16);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s9, 9*16);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s10, 10*16);                                        \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s11, 11*16);                                        \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s12, 12*16);                                        \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s13, 13*16);                                        \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s14, 14*16);                                        \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s15, 15*16);                                        \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s16, 16*16);                                        \
 }                                                              \
                                                                \
@@ -126,7 +101,6 @@ testva##TYPE##N (int n, ...)                                        \
       for (i = 0; i < n; i++)                                  \
        {                                                       \
          struct S##TYPE##N t = va_arg (ap, struct S##TYPE##N); \
-         DEBUG_DOT;                                            \
          check##TYPE##N (&t, (i+1)*16);                        \
        }                                                       \
       va_end (ap);                                             \
index 676ab02..942de13 100644 (file)
@@ -4,6 +4,7 @@
 
 extern void struct_by_value_9_x (void);
 extern void exit (int);
+int fails;
 
 int
 main ()
index ff8f057..3cd7ca7 100644 (file)
@@ -1,13 +1,4 @@
-#ifdef DBG
-#include <stdio.h>
-#define DEBUG_FPUTS(x) fputs (x, stdout)
-#define DEBUG_DOT putc ('.', stdout)
-#define DEBUG_NL putc ('\n', stdout)
-#else
-#define DEBUG_FPUTS(x)
-#define DEBUG_DOT
-#define DEBUG_NL
-#endif
+#include "compat-common.h"
 
 #define T(N, TYPE)                                             \
 struct S##TYPE##N { TYPE i[N]; };                              \
@@ -67,6 +58,7 @@ void                                                          \
 testit##TYPE##N (void)                                         \
 {                                                              \
   DEBUG_FPUTS (#TYPE "[" #N "]");                              \
+  DEBUG_FPUTS (" init: ");                                     \
   init##TYPE##N  ( &g1s##TYPE##N,  1*16);                      \
   init##TYPE##N  ( &g2s##TYPE##N,  2*16);                      \
   init##TYPE##N  ( &g3s##TYPE##N,  3*16);                      \
@@ -84,7 +76,9 @@ testit##TYPE##N (void)                                                \
   init##TYPE##N  (&g15s##TYPE##N, 15*16);                      \
   init##TYPE##N  (&g16s##TYPE##N, 16*16);                      \
   checkg##TYPE##N ();                                          \
-  DEBUG_FPUTS (" test");                                       \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#TYPE "[" #N "]");                              \
+  DEBUG_FPUTS (" test: ");                                     \
   test##TYPE##N (g1s##TYPE##N, g2s##TYPE##N,                   \
                 g3s##TYPE##N, g4s##TYPE##N,                    \
                 g5s##TYPE##N, g6s##TYPE##N,                    \
@@ -93,7 +87,10 @@ testit##TYPE##N (void)                                               \
                 g11s##TYPE##N, g12s##TYPE##N,                  \
                 g13s##TYPE##N, g14s##TYPE##N,                  \
                 g15s##TYPE##N, g16s##TYPE##N);                 \
-  DEBUG_FPUTS (" testva");                                     \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#TYPE "[" #N "]");                              \
+  DEBUG_FPUTS (" testva:");                                    \
+  DEBUG_NL;                                                    \
   testva##TYPE##N (16,                                         \
                   g1s##TYPE##N, g2s##TYPE##N,                  \
                   g3s##TYPE##N, g4s##TYPE##N,                  \
@@ -103,7 +100,9 @@ testit##TYPE##N (void)                                              \
                   g11s##TYPE##N, g12s##TYPE##N,                \
                   g13s##TYPE##N, g14s##TYPE##N,                \
                   g15s##TYPE##N, g16s##TYPE##N);               \
-  DEBUG_FPUTS (" test2");                                      \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#TYPE "[" #N "]");                              \
+  DEBUG_FPUTS (" test2: ");                                    \
   test2_##TYPE##N (g1s##TYPE##N, g3s##TYPE##N,                 \
                   g5s##TYPE##N, g7s##TYPE##N,                  \
                   g9s##TYPE##N, g11s##TYPE##N,                 \
@@ -121,17 +120,17 @@ typedef struct { char c; int i; short s; } Scis;
 
 extern void abort (void);
 
-void checkSc (Sc x, int i) { if (x.c != i/16) { DEBUG_NL; abort (); } }
-void checkSs (Ss x, int i) { if (x.s != i) { DEBUG_NL; abort (); } }
-void checkSi (Si x, int i) { if (x.i != i) { DEBUG_NL; abort (); } }
+void checkSc (Sc x, int i) { if (x.c != i/16) DEBUG_CHECK }
+void checkSs (Ss x, int i) { if (x.s != i) DEBUG_CHECK }
+void checkSi (Si x, int i) { if (x.i != i) DEBUG_CHECK }
 void checkSsc (Ssc x, int i)
-{ if (x.s != i || x.c != (i/16)+1) { DEBUG_NL; abort (); } }
+{ if (x.s != i || x.c != (i/16)+1) DEBUG_CHECK }
 void checkSis (Sis x, int i)
-{ if (x.i != i || x.s != i+1) { DEBUG_NL; abort (); } }
+{ if (x.i != i || x.s != i+1) DEBUG_CHECK }
 void checkScsi (Scsi x, int i)
-{ if (x.c != i/16 || x.s != i+1 || x.i != i+2) { DEBUG_NL; abort (); } }
+{ if (x.c != i/16 || x.s != i+1 || x.i != i+2) DEBUG_CHECK }
 void checkScis (Scis x, int i)
-{ if (x.c != i/16 || x.i != i+1 || x.s != i+2) { DEBUG_NL; abort (); } }
+{ if (x.c != i/16 || x.i != i+1 || x.s != i+2) DEBUG_CHECK }
 
 T(0, Scsi)
 T(1, Scsi)
@@ -206,5 +205,8 @@ T(13, Scis)
 T(14, Scis)
 T(15, Scis)
 
+if (fails != 0)
+  abort ();
+
 #undef T
 }
index a98e5c9..5d03404 100644 (file)
@@ -1,15 +1,6 @@
 #include <stdarg.h>
 
-#ifdef DBG
-#include <stdio.h>
-#define DEBUG_FPUTS(x) fputs (x, stdout)
-#define DEBUG_DOT putc ('.', stdout)
-#define DEBUG_NL putc ('\n', stdout)
-#else
-#define DEBUG_FPUTS(x)
-#define DEBUG_DOT
-#define DEBUG_NL
-#endif
+#include "compat-common.h"
 
 /* Turn off checking for variable arguments with -DSKIPVA.  */
 #ifdef SKIPVA
@@ -81,37 +72,21 @@ test##TYPE##N (struct S##TYPE##N s1, struct S##TYPE##N s2,  \
               struct S##TYPE##N s13, struct S##TYPE##N s14,    \
               struct S##TYPE##N s15, struct S##TYPE##N s16)    \
 {                                                              \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s1, 1*16);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s2, 2*16);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s3, 3*16);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s4, 4*16);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s5, 5*16);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s6, 6*16);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s7, 7*16);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s8, 8*16);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s9, 9*16);                                  \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s10, 10*16);                                        \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s11, 11*16);                                        \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s12, 12*16);                                        \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s13, 13*16);                                        \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s14, 14*16);                                        \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s15, 15*16);                                        \
-  DEBUG_DOT;                                                   \
   check##TYPE##N (&s16, 16*16);                                        \
 }                                                              \
                                                                \
@@ -126,7 +101,6 @@ testva##TYPE##N (int n, ...)                                        \
       for (i = 0; i < n; i++)                                  \
        {                                                       \
          struct S##TYPE##N t = va_arg (ap, struct S##TYPE##N); \
-         DEBUG_DOT;                                            \
          check##TYPE##N (&t, (i+1)*16);                        \
        }                                                       \
       va_end (ap);                                             \
index 6089c02..22a1f6e 100644 (file)
@@ -3,6 +3,7 @@
 
 extern void struct_return_2_x (void);
 extern void exit (int);
+int fails;
 
 int
 main ()
index aa2c34a..ff83e95 100644 (file)
@@ -1,12 +1,10 @@
-#ifdef DBG
-#include <stdio.h>
-#define DEBUG_FPUTS(x) fputs (x, stdout)
-#define DEBUG_DOT putc ('.', stdout)
-#define DEBUG_NL putc ('\n', stdout)
+#include "compat-common.h"
+
+/* Turn off checking for variable arguments with -DSKIPVA.  */
+#ifdef SKIPVA
+const int test_va = 0;
 #else
-#define DEBUG_FPUTS(x)
-#define DEBUG_DOT
-#define DEBUG_NL
+const int test_va = 1;
 #endif
 
 #define T(N, NAME, TYPE)                                       \
@@ -30,11 +28,11 @@ void                                                                \
 check##NAME##N (struct S##NAME##N *p, int i)                   \
 {                                                              \
   int j;                                                       \
+  DEBUG_DOT;                                                   \
   for (j = 0; j < N; j++)                                      \
     if (p->i[j] != (TYPE) (i + j))                             \
       {                                                                \
-       DEBUG_NL;                                               \
-       abort ();                                               \
+       DEBUG_FAIL;                                             \
       }                                                                \
 }                                                              \
                                                                \
@@ -43,6 +41,7 @@ testit##NAME##N (void)                                                \
 {                                                              \
   struct S##NAME##N rslt;                                      \
   DEBUG_FPUTS (#NAME "[" #N "]");                              \
+  DEBUG_FPUTS (" init: ");                                     \
   init##NAME##N  ( &g1s##NAME##N,  1*16);                      \
   init##NAME##N  ( &g2s##NAME##N,  2*16);                      \
   init##NAME##N  ( &g3s##NAME##N,  3*16);                      \
@@ -60,42 +59,49 @@ testit##NAME##N (void)                                              \
   init##NAME##N  (&g15s##NAME##N, 15*16);                      \
   init##NAME##N  (&g16s##NAME##N, 16*16);                      \
   checkg##NAME##N ();                                          \
-  DEBUG_FPUTS (" test0");                                      \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#NAME "[" #N "]");                              \
+  DEBUG_FPUTS (" test0: ");                                    \
   rslt = test0##NAME##N ();                                    \
   check##NAME##N (&rslt, 1*16);                                        \
-  DEBUG_FPUTS (" test1");                                      \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#NAME "[" #N "]");                              \
+  DEBUG_FPUTS (" test1: ");                                    \
   rslt = test1##NAME##N (g1s##NAME##N);                                \
   check##NAME##N (&rslt, 1*16);                                        \
-  DEBUG_FPUTS (" testva");                                     \
-  rslt = testva##NAME##N (1, g1s##NAME##N);                    \
-  check##NAME##N (&rslt, 1*16);                                        \
-  rslt = testva##NAME##N (5,                                   \
-                         g1s##NAME##N, g2s##NAME##N,           \
-                         g3s##NAME##N, g4s##NAME##N,           \
-                         g5s##NAME##N);                        \
-  check##NAME##N (&rslt, 5*16);                                        \
-  rslt = testva##NAME##N (9,                                   \
-                         g1s##NAME##N, g2s##NAME##N,           \
-                         g3s##NAME##N, g4s##NAME##N,           \
-                         g5s##NAME##N, g6s##NAME##N,           \
-                         g7s##NAME##N, g8s##NAME##N,           \
-                         g9s##NAME##N);                        \
-  check##NAME##N (&rslt, 9*16);                                        \
-  rslt = testva##NAME##N (16,                                  \
-                         g1s##NAME##N, g2s##NAME##N,           \
-                         g3s##NAME##N, g4s##NAME##N,           \
-                         g5s##NAME##N, g6s##NAME##N,           \
-                         g7s##NAME##N, g8s##NAME##N,           \
-                         g9s##NAME##N, g10s##NAME##N,          \
-                         g11s##NAME##N, g12s##NAME##N,         \
-                         g13s##NAME##N, g14s##NAME##N,         \
-                         g15s##NAME##N, g16s##NAME##N);        \
-  check##NAME##N (&rslt, 16*16);                                       \
+  if (test_va)                                                 \
+    {                                                          \
+      DEBUG_NL;                                                        \
+      DEBUG_FPUTS (#NAME "[" #N "]");                          \
+      DEBUG_FPUTS (" testva: ");                               \
+      rslt = testva##NAME##N (1, g1s##NAME##N);                        \
+      check##NAME##N (&rslt, 1*16);                            \
+      rslt = testva##NAME##N (5,                               \
+                             g1s##NAME##N, g2s##NAME##N,       \
+                             g3s##NAME##N, g4s##NAME##N,       \
+                             g5s##NAME##N);                    \
+      check##NAME##N (&rslt, 5*16);                            \
+      rslt = testva##NAME##N (9,                               \
+                             g1s##NAME##N, g2s##NAME##N,       \
+                             g3s##NAME##N, g4s##NAME##N,       \
+                             g5s##NAME##N, g6s##NAME##N,       \
+                             g7s##NAME##N, g8s##NAME##N,       \
+                             g9s##NAME##N);                    \
+      check##NAME##N (&rslt, 9*16);                            \
+      rslt = testva##NAME##N (16,                              \
+                             g1s##NAME##N, g2s##NAME##N,       \
+                             g3s##NAME##N, g4s##NAME##N,       \
+                             g5s##NAME##N, g6s##NAME##N,       \
+                             g7s##NAME##N, g8s##NAME##N,       \
+                             g9s##NAME##N, g10s##NAME##N,      \
+                             g11s##NAME##N, g12s##NAME##N,     \
+                             g13s##NAME##N, g14s##NAME##N,     \
+                             g15s##NAME##N, g16s##NAME##N);    \
+      check##NAME##N (&rslt, 16*16);                           \
+    }                                                          \
   DEBUG_NL;                                                    \
 }
 
-extern void abort (void);
-
 T(0, uc, unsigned char)
 T(1, uc, unsigned char)
 T(2, uc, unsigned char)
@@ -201,5 +207,8 @@ T(13, ui, unsigned int)
 T(14, ui, unsigned int)
 T(15, ui, unsigned int)
 
+if (fails != 0)
+  abort ();
+
 #undef T
 }
index 50f3cc7..d8bdcc2 100644 (file)
@@ -1,22 +1,6 @@
 #include <stdarg.h>
 
-#ifdef DBG
-#include <stdio.h>
-#define DEBUG_FPUTS(x) fputs (x, stdout)
-#define DEBUG_DOT putc ('.', stdout)
-#define DEBUG_NL putc ('\n', stdout)
-#else
-#define DEBUG_FPUTS(x)
-#define DEBUG_DOT
-#define DEBUG_NL
-#endif
-
-/* Turn off checking for variable arguments with -DSKIPVA.  */
-#ifdef SKIPVA
-const int test_va = 0;
-#else
-const int test_va = 1;
-#endif
+#include "compat-common.h"
 
 #define T(N, NAME, TYPE)                                       \
 struct S##NAME##N { TYPE i[N]; };                              \
@@ -79,16 +63,10 @@ testva##NAME##N (int n, ...)                                        \
   int i;                                                       \
   struct S##NAME##N rslt;                                      \
   va_list ap;                                                  \
-  if (test_va)                                                 \
-    {                                                          \
-      va_start (ap, n);                                                \
-      for (i = 0; i < n; i++)                                  \
-       {                                                       \
-         rslt = va_arg (ap, struct S##NAME##N);                \
-         DEBUG_DOT;                                            \
-       }                                                       \
-      va_end (ap);                                             \
-    }                                                          \
+  va_start (ap, n);                                            \
+  for (i = 0; i < n; i++)                                      \
+    rslt = va_arg (ap, struct S##NAME##N);                     \
+  va_end (ap);                                                 \
   return rslt;                                                 \
 }
 
index 87be8a3..83f0d11 100644 (file)
@@ -4,6 +4,7 @@
 
 extern void struct_return_3_x (void);
 extern void exit (int);
+int fails;
 
 int
 main ()
index 05d1e50..62e9a94 100644 (file)
@@ -1,12 +1,10 @@
-#ifdef DBG
-#include <stdio.h>
-#define DEBUG_FPUTS(x) fputs (x, stdout)
-#define DEBUG_DOT putc ('.', stdout)
-#define DEBUG_NL putc ('\n', stdout)
+#include "compat-common.h"
+
+/* Turn off checking for variable arguments with -DSKIPVA.  */
+#ifdef SKIPVA
+const int test_va = 0;
 #else
-#define DEBUG_FPUTS(x)
-#define DEBUG_DOT
-#define DEBUG_NL
+const int test_va = 1;
 #endif
 
 #define T(TYPE)                                                        \
@@ -26,6 +24,7 @@ testit##TYPE (void)                                           \
 {                                                              \
   TYPE rslt;                                                   \
   DEBUG_FPUTS (#TYPE);                                         \
+  DEBUG_FPUTS (" init: ");                                     \
   init##TYPE  (&g01##TYPE,  1);                                        \
   init##TYPE  (&g02##TYPE,  2);                                        \
   init##TYPE  (&g03##TYPE,  3);                                        \
@@ -43,39 +42,46 @@ testit##TYPE (void)                                         \
   init##TYPE  (&g15##TYPE, 15);                                        \
   init##TYPE  (&g16##TYPE, 16);                                        \
   checkg##TYPE ();                                             \
-  DEBUG_FPUTS (" test0");                                      \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#TYPE);                                         \
+  DEBUG_FPUTS (" test0: ");                                    \
   rslt = test0##TYPE ();                                       \
   check##TYPE (rslt, 1);                                       \
-  DEBUG_FPUTS (" test1");                                      \
+  DEBUG_NL;                                                    \
+  DEBUG_FPUTS (#TYPE);                                         \
+  DEBUG_FPUTS (" test1: ");                                    \
   rslt = test1##TYPE (g01##TYPE);                              \
   check##TYPE (rslt, 1);                                       \
-  DEBUG_FPUTS (" testva");                                     \
-  rslt = testva##TYPE (1, g01##TYPE);                          \
-  check##TYPE (rslt, 1);                                       \
-  rslt = testva##TYPE (5, g01##TYPE, g02##TYPE,                        \
-                         g03##TYPE, g04##TYPE,                 \
-                         g05##TYPE);                           \
-  check##TYPE (rslt, 5);                                       \
-  rslt = testva##TYPE (9, g01##TYPE, g02##TYPE,                        \
-                         g03##TYPE, g04##TYPE,                 \
-                         g05##TYPE, g06##TYPE,                 \
-                         g07##TYPE, g08##TYPE,                 \
-                         g09##TYPE);                           \
-  check##TYPE (rslt, 9);                                       \
-  rslt = testva##TYPE (16, g01##TYPE, g02##TYPE,               \
-                         g03##TYPE, g04##TYPE,                 \
-                         g05##TYPE, g06##TYPE,                 \
-                         g07##TYPE, g08##TYPE,                 \
-                         g09##TYPE, g10##TYPE,                 \
-                         g11##TYPE, g12##TYPE,                 \
-                         g13##TYPE, g14##TYPE,                 \
-                         g15##TYPE, g16##TYPE);                \
-  check##TYPE (rslt, 16);                                      \
+  if (test_va)                                                 \
+    {                                                          \
+      DEBUG_NL;                                                        \
+      DEBUG_FPUTS (#TYPE);                                     \
+      DEBUG_FPUTS (" testva: ");                               \
+      rslt = testva##TYPE (1, g01##TYPE);                      \
+      check##TYPE (rslt, 1);                                   \
+      rslt = testva##TYPE (5, g01##TYPE, g02##TYPE,            \
+                          g03##TYPE, g04##TYPE,                \
+                          g05##TYPE);                          \
+      check##TYPE (rslt, 5);                                   \
+      rslt = testva##TYPE (9, g01##TYPE, g02##TYPE,            \
+                          g03##TYPE, g04##TYPE,                \
+                          g05##TYPE, g06##TYPE,                \
+                          g07##TYPE, g08##TYPE,                \
+                          g09##TYPE);                          \
+      check##TYPE (rslt, 9);                                   \
+      rslt = testva##TYPE (16, g01##TYPE, g02##TYPE,           \
+                          g03##TYPE, g04##TYPE,                \
+                          g05##TYPE, g06##TYPE,                \
+                          g07##TYPE, g08##TYPE,                \
+                          g09##TYPE, g10##TYPE,                \
+                          g11##TYPE, g12##TYPE,                \
+                          g13##TYPE, g14##TYPE,                \
+                          g15##TYPE, g16##TYPE);               \
+      check##TYPE (rslt, 16);                                  \
+    }                                                          \
   DEBUG_NL;                                                    \
 }
 
-extern void abort (void);
-
 #include "small-struct-defs.h"
 #include "small-struct-check.h"
 
@@ -118,5 +124,8 @@ T(Ssic)
 T(Sisc)
 T(Sics)
 
+if (fails != 0)
+  abort ();
+
 #undef T
 }
index 4dc2031..dbd4713 100644 (file)
@@ -1,22 +1,6 @@
 #include <stdarg.h>
 
-#ifdef DBG
-#include <stdio.h>
-#define DEBUG_FPUTS(x) fputs (x, stdout)
-#define DEBUG_DOT putc ('.', stdout)
-#define DEBUG_NL putc ('\n', stdout)
-#else
-#define DEBUG_FPUTS(x)
-#define DEBUG_DOT
-#define DEBUG_NL
-#endif
-
-/* Turn off checking for variable arguments with -DSKIPVA.  */
-#ifdef SKIPVA
-const int test_va = 0;
-#else
-const int test_va = 1;
-#endif
+#include "compat-common.h"
 
 #include "small-struct-defs.h"
 #include "small-struct-init.h"
@@ -68,16 +52,10 @@ testva##TYPE (int n, ...)                                   \
   int i;                                                       \
   TYPE rslt;                                                   \
   va_list ap;                                                  \
-  if (test_va)                                                 \
-    {                                                          \
-      va_start (ap, n);                                                \
-      for (i = 0; i < n; i++)                                  \
-       {                                                       \
-         rslt = va_arg (ap, TYPE);                             \
-         DEBUG_DOT;                                            \
-       }                                                       \
-      va_end (ap);                                             \
-    }                                                          \
+  va_start (ap, n);                                            \
+  for (i = 0; i < n; i++)                                      \
+      rslt = va_arg (ap, TYPE);                                        \
+  va_end (ap);                                                 \
   return rslt;                                                 \
 }