1#include <stdarg.h>
2#include "compat-common.h"
3#include "mixed-struct-defs.h"
4#include "mixed-struct-check.h"
5
6#ifdef SKIP_VA
7const int test_va = 0;
8#else
9const int test_va = 1;
10#endif
11
12#define T(NAME, FIELDS, TYPE, FIELDINIT, FIELDTEST)			\
13void									\
14testva##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;						\
21									\
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    }									\
37}
38
39#include "struct-by-value-22_x.c"
40