Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gcc.dg / compat / struct-by-value-22_y.c
blob079e40e5f897a920bd37e5c1074f4cd7e383b215
1 #include <stdarg.h>
2 #include "compat-common.h"
3 #include "mixed-struct-defs.h"
4 #include "mixed-struct-check.h"
6 #ifdef SKIP_VA
7 const int test_va = 0;
8 #else
9 const int test_va = 1;
10 #endif
12 #define T(NAME, FIELDS, TYPE, FIELDINIT, FIELDTEST) \
13 void \
14 testva##NAME (int n, ...) \
15 { \
16 va_list ap; \
17 if (test_va) \
18 { \
19 struct S { FIELDS TYPE a[n]; } s; \
20 int fail = 0, i, j; \
22 va_start (ap, n); \
23 for (j = 0; j < 2; ++j) \
24 { \
25 s = va_arg (ap, struct S); \
26 for (i = 0; i < n; ++i) \
27 if (s.a[i] != 12 + n - i) \
28 ++fail; \
29 if (fail) \
30 { DEBUG_FAIL; } \
31 if (!j && va_arg (ap, int) != n) \
32 { DEBUG_FAIL; } \
33 FIELDTEST; \
34 } \
35 va_end (ap); \
36 } \
39 #include "struct-by-value-22_x.c"