+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.
--- /dev/null
+/* 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;
#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 }
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); \
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; \
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); \
} \
\
for (i = 0; i < n; i++) \
{ \
TYPE t = va_arg (ap, TYPE); \
- DEBUG_DOT; \
check##TYPE (t, (TYPE2)i+1); \
} \
va_end (ap); \
extern void scalar_by_value_1_x (void);
extern void exit (int);
+int fails;
int
main ()
-#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; \
check##NAME (TYPE x, TYPE v) \
{ \
if (x != v + INITVAL) \
- { \
- DEBUG_NL; \
- abort (); \
- } \
+ DEBUG_CHECK \
} \
\
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); \
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)
T(d)
T(ld)
+if (fails != 0)
+ abort ();
+
#undef T
}
#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
for (i = 0; i < n; i++) \
{ \
TYPE t = va_arg (ap, TYPE); \
- DEBUG_DOT; \
check##NAME (t, i+1); \
} \
va_end (ap); \
extern void scalar_by_value_2_x (void);
extern void exit (int);
+int fails;
int
main ()
-#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; \
check##NAME (TYPE x, TYPE v) \
{ \
if (x != v + INITVAL) \
- { \
- DEBUG_NL; \
- abort (); \
- } \
+ DEBUG_CHECK \
} \
\
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); \
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))
T(ss)
T(f)
+if (fails != 0)
+ abort ();
+
#undef T
}
#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; \
extern void scalar_return_1_x (void);
extern void exit (int);
+int fails;
int
main ()
-#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) \
check##NAME (TYPE x, TYPE v) \
{ \
if (x != v) \
- { \
- DEBUG_NL; \
- abort (); \
- } \
+ DEBUG_CHECK \
} \
\
void \
{ \
TYPE rslt; \
DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" init: "); \
init##NAME (&g01##NAME, 1); \
init##NAME (&g02##NAME, 2); \
init##NAME (&g03##NAME, 3); \
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)
T(d)
T(ld)
+if (fails != 0)
+ abort ();
+
#undef T
}
#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; \
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; \
}
extern void scalar_return_2_x (void);
extern void exit (int);
+int fails;
int
main ()
-#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; \
check##NAME (TYPE x, TYPE v) \
{ \
if (x != v) \
- { \
- DEBUG_NL; \
- abort (); \
- } \
+ DEBUG_CHECK \
} \
\
void \
{ \
TYPE rslt; \
DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" init: "); \
init##NAME (&g01##NAME, 1); \
init##NAME (&g02##NAME, 2); \
init##NAME (&g03##NAME, 3); \
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))
T(ss)
T(f)
+if (fails != 0)
+ abort ();
+
#undef T
}
#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
/* 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 }
extern void struct_by_value_2_x (void);
extern void exit (int);
+int fails;
int
main ()
-#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]; }; \
int j; \
for (j = 0; j < N; j++) \
if (p->i[j] != (TYPE) (i + j)) \
- { \
- DEBUG_NL; \
- abort (); \
- } \
+ DEBUG_CHECK \
} \
\
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); \
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, \
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, \
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, \
DEBUG_NL; \
}
-extern void abort (void);
-
T(0, uc, unsigned char)
T(1, uc, unsigned char)
T(2, uc, unsigned char)
T(14, ui, unsigned int)
T(15, ui, unsigned int)
+if (fails != 0)
+ abort ();
+
#undef T
}
#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
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); \
} \
\
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); \
extern void struct_by_value_3_x (void);
extern void exit (int);
+int fails;
int
main ()
-#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; \
testit##TYPE (void) \
{ \
DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" init: "); \
init##TYPE ( &g1s##TYPE, 1); \
init##TYPE ( &g2s##TYPE, 2); \
init##TYPE ( &g3s##TYPE, 3); \
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"
T(Sisc)
T(Sics)
+if (fails != 0)
+ abort ();
+
#undef T
}
#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
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); \
} \
\
for (i = 0; i < n; i++) \
{ \
TYPE t = va_arg (ap, TYPE); \
- DEBUG_DOT; \
check##TYPE (t, i+1); \
} \
va_end (ap); \
extern void struct_by_value_4_x (void);
extern void exit (int);
+int fails;
int
main ()
-#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]; }; \
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); \
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, \
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, \
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, \
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)
T(14, Si)
T(15, Si)
+if (fails != 0)
+ abort ();
+
#undef T
}
#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
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); \
} \
\
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); \
extern void struct_by_value_5_x (void);
extern void exit (int);
+int fails;
int
main ()
-#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)
T(Sf15, float)
T(Sf16, float)
+if (fails != 0)
+ abort ();
+
#undef T
}
#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
extern void struct_by_value_6_x (void);
extern void exit (int);
+int fails;
int
main ()
-#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)
T(Sd15, double)
T(Sd16, double)
+if (fails != 0)
+ abort ();
+
#undef T
}
#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
extern void struct_by_value_7_x (void);
extern void exit (int);
+int fails;
int
main ()
-#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)
T(Sld15, long double)
T(Sld16, long double)
+if (fails != 0)
+ abort ();
+
#undef T
}
#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
extern void struct_by_value_8_x (void);
extern void exit (int);
+int fails;
int
main ()
-#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]; }; \
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); \
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, \
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, \
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, \
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)
T(14, Sis)
T(15, Sis)
+if (fails != 0)
+ abort ();
+
#undef T
}
#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
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); \
} \
\
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); \
extern void struct_by_value_9_x (void);
extern void exit (int);
+int fails;
int
main ()
-#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]; }; \
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); \
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, \
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, \
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, \
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)
T(14, Scis)
T(15, Scis)
+if (fails != 0)
+ abort ();
+
#undef T
}
#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
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); \
} \
\
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); \
extern void struct_return_2_x (void);
extern void exit (int);
+int fails;
int
main ()
-#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) \
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; \
} \
} \
\
{ \
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); \
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)
T(14, ui, unsigned int)
T(15, ui, unsigned int)
+if (fails != 0)
+ abort ();
+
#undef T
}
#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]; }; \
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; \
}
extern void struct_return_3_x (void);
extern void exit (int);
+int fails;
int
main ()
-#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) \
{ \
TYPE rslt; \
DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" init: "); \
init##TYPE (&g01##TYPE, 1); \
init##TYPE (&g02##TYPE, 2); \
init##TYPE (&g03##TYPE, 3); \
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"
T(Sisc)
T(Sics)
+if (fails != 0)
+ abort ();
+
#undef T
}
#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"
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; \
}