compat-common.h: New file.
authorJanis Johnson <janis187@us.ibm.com>
Tue, 10 Jun 2003 19:08:33 +0000 (19:08 +0000)
committerJanis Johnson <janis@gcc.gnu.org>
Tue, 10 Jun 2003 19:08:33 +0000 (19:08 +0000)
* 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.

From-SVN: r67724

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 f9e8c6eb7e4c17576c9f211aceef484124869159..af4f80792a3338af807a876b4c0103a3e8a6553b 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 e907c7f046803e24dcb29aa3293e83dd20efbf44..bd3283b6b0ebfc0fd6fdadaf8fbfdfeb9fa12062 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 867c75b01cafecf93d31f0d23a05ae03fbc870c5..876f1b3556cee0847fa09daede4034ff20ee1111 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 89d2faa86186bad307f093583fc4c0a09195c923..49fccdd0931fb61fdcaebcf8dfb2c67fb6f17666 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 9e8a8f1b04ce6633d95b15b8a80452ae9329ca90..5272a379f4cb5ff5797b3107c02c6ac111a64f01 100644 (file)
@@ -3,6 +3,7 @@
 
 extern void scalar_by_value_1_x (void);
 extern void exit (int);
+int fails;
 
 int
 main ()
index 9ce16a0d50d8dfed3c67cd4d513f3176210dfd23..51b5abd3d77be319cf88bf82c46a2d0de7ffac6d 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 2bc024446419afe5fef94906a75ac64e4ca4d45b..7b4b60ea77f25eb552aa42953a1e459a53d8691d 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 93b64dfe19f73fd23968b6075e56562ef1002f58..8426b789434ecde3bb921f4c02a90ebff7d2064f 100644 (file)
@@ -5,6 +5,7 @@
 
 extern void scalar_by_value_2_x (void);
 extern void exit (int);
+int fails;
 
 int
 main ()
index 0b20f5f69062bf9682a620640bb30daa13b2a82a..fae665f2ca17cdf751294d355d6dda8c6ddae927 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 5b7933400bc635d3dba7839ed0fd89b6a263450c..2eea6135d74c293b4848bce530c7935891918107 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 0dca50b1c8af9edd1ff77a0ac592c809c42bd4e7..0a27f5416b1d84157e7077fc83374bd49eba28dd 100644 (file)
@@ -3,6 +3,7 @@
 
 extern void scalar_return_1_x (void);
 extern void exit (int);
+int fails;
 
 int
 main ()
index aaa634e81b649179279b63ba8951bbfd700f9c12..7e8f975f758f298baa2685ae601a016527804f45 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 edf332bd370af8d20bda968ca214cda0fc340467..f913dbbb8917a05f6f155cc743669615e3e45ba7 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 56325e3dab7c57f382adc82bfed556535651edcc..11a5e5044fc754fb600b18ac2d099cce44f45875 100644 (file)
@@ -3,6 +3,7 @@
 
 extern void scalar_return_2_x (void);
 extern void exit (int);
+int fails;
 
 int
 main ()
index 16b4dd8c32a62d673b566af67d256a7852a21f38..2e68d59b7eae34582abc1fcdf79293f20adda9a3 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 89a824c924545d52ae413af42d9bebb32fefbeb7..1f7d5493836cf0db708d9f303232ba57ddb8b4bf 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 9ae103f987edbe43b06b0aa02b6aea8dfa435f34..85b334c44c23ea7dcb5190da63260a1bea996677 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 621c65460b6e79de94dbc4482c6d25f8d00d9032..8cb6fc078289de75dabf785c2f9e816d48fa9cc3 100644 (file)
@@ -4,6 +4,7 @@
 
 extern void struct_by_value_2_x (void);
 extern void exit (int);
+int fails;
 
 int
 main ()
index 79c47ce028293baa2e361361156628b1839e785b..ce455bf5bc224f1126f37f0eb2d8f48a387e1e0d 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 1e843853d0dc5335a3008ed88c5daf4faf8afe13..f5b3c713f1783dd3e669d22ea6db2f9f7f2bb6cc 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 86fb4a36646654bfed241f5d34d12dd1a7c74389..0b720689531c2bc1ccc29375ac9b2a32e0e7d010 100644 (file)
@@ -5,6 +5,7 @@
 
 extern void struct_by_value_3_x (void);
 extern void exit (int);
+int fails;
 
 int
 main ()
index 3eaa03426747a2e6e7d1b8c62f91a39ec0cef737..4490f48563467e3ae65cfc61dfd2406a205ca61e 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 87deacda0b65dc6ddbd522cbcc2629fe75a72e86..571bea8d414163ee7d177f450a30c5775111423b 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 03443939849f4012e48335e5c34d42334a7f015f..570eddc5d5e104404df8e8896c4502a50c4a9822 100644 (file)
@@ -4,6 +4,7 @@
 
 extern void struct_by_value_4_x (void);
 extern void exit (int);
+int fails;
 
 int
 main ()
index e857ac001e5f436b2e641524d595029650c96b07..4b24cd56a85de92a8443679d4ff6924efbea677f 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 1e21d8aa1b379f4f77378c85bdb972ddc834969a..2541dd06d52e36c4d1a3063c31ec0fb63ed83d54 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 d4e0da64334627ad295b33f578990555196e5122..32eaafbe23b3c5c7433a314497225bc51b9bddce 100644 (file)
@@ -4,6 +4,7 @@
 
 extern void struct_by_value_5_x (void);
 extern void exit (int);
+int fails;
 
 int
 main ()
index 69169ca1523d21a817ca4a8460b519b03b14883c..6db7771bc3a5492e2addddad68c6fed93527e00b 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 b9702ae28f1c40375c2bee12011b9b916e34abf0..9290b8fa92e1c76fe850a6e07792bd597a008161 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 4e7308fbf3b731019281c3ae0b671b7184cb5b2d..39dc31f4a6a9628d47882c23d1066bde9ff9845c 100644 (file)
@@ -4,6 +4,7 @@
 
 extern void struct_by_value_6_x (void);
 extern void exit (int);
+int fails;
 
 int
 main ()
index 4b87017cfebe2f1dc39a33e20b59625149134d02..cef1523b3ff31d64800931db9e9f359597019a11 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 49cc5d2211d61a420e6f886ba602c8096cfa3880..b5bc10025a0b8dc27b9bfbb869fbdb1a19412aad 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 7f0264c0f4beb782bb7ad8f17c0a4dd16e7cefa6..98caf4286a41cdefeca60796edc2bc3f6316c8e3 100644 (file)
@@ -4,6 +4,7 @@
 
 extern void struct_by_value_7_x (void);
 extern void exit (int);
+int fails;
 
 int
 main ()
index 7f9d09a9d65d2f58554586d3548fd71b5ce4aed4..30d945082f7cbbedb24056f66f0ebf64f3821d2e 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 bccff5decd9a329253f58c13aa0183d5d1019d66..ca52a9b10f7132de224a7503fcbf3530e71a6868 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 6ede893d4fe3137660ab6c4b7aaed6911d6ab7d9..cc094fcc9ad39c9d258b788ed3baca164dd773f5 100644 (file)
@@ -4,6 +4,7 @@
 
 extern void struct_by_value_8_x (void);
 extern void exit (int);
+int fails;
 
 int
 main ()
index 8695e895c3a5e60a2f5b67906199a47278edb6e6..6c983c58cb9e0a65ff9108bb5ad13330440612bb 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 e776fc3e39863f3382a9ba985d7b3c66328318e1..9dadfb03c1fbe3099e7d8345561643d6c43a7f61 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 676ab027656a5d6ed9de4a80235062b9b934ea9c..942de1355083a6ffe908e5b2dd7bdfa7d165721d 100644 (file)
@@ -4,6 +4,7 @@
 
 extern void struct_by_value_9_x (void);
 extern void exit (int);
+int fails;
 
 int
 main ()
index ff8f057ecb6ed8136b8923cab9b511f527ad7474..3cd7ca74f048b6d661e80759f68db1f1c955992f 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 a98e5c95eb631c8d9af926acd2fdae747d718fc6..5d034048c1a9a955cdeeaef9cc70e949a546174c 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 6089c02555a22eb6590ebf6668eac42730fae751..22a1f6ef7c89c36884fa98a58e9bdc18e9fb1f88 100644 (file)
@@ -3,6 +3,7 @@
 
 extern void struct_return_2_x (void);
 extern void exit (int);
+int fails;
 
 int
 main ()
index aa2c34ad5c18f6d5f2a3bbe8960afc81ed8b6f60..ff83e95f064b63e957b86e0c480d0c6df447bc75 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 50f3cc716ba597b1800aacc5696def8ad9216e7f..d8bdcc240de63d8a7acdc4d2c80b20503672016a 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 87be8a3db4016680e29a7521533c6642d37cef63..83f0d119a534ae9144c17ecaf5300dafe4c7f2c7 100644 (file)
@@ -4,6 +4,7 @@
 
 extern void struct_return_3_x (void);
 extern void exit (int);
+int fails;
 
 int
 main ()
index 05d1e5059bd575a0419b5de562ca5071094a9424..62e9a94f5aba157327bf18fdb582b0e42b809a28 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 4dc20311ca0eb0da260600ecaf6b8066a8b3ba3f..dbd471351008f00e9a617ebca36b1c77dca85832 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;                                                 \
 }