1 #include <stdarg.h>
2 
3 #include "compat-common.h"
4 
5 #ifdef SKIP_VA
6 const int test_va = 0;
7 #else
8 const int test_va = 1;
9 #endif
10 
11 #include "mixed-struct-defs.h"
12 
13 extern void checkScd (Scd x, int i);
14 extern void checkScdc (Scdc x, int i);
15 extern void checkSd (Sd x, int i);
16 extern void checkSdi (Sdi x, int i);
17 extern void checkScsds (Scsds x, int i);
18 extern void checkScsdsc (Scsdsc x, int i);
19 extern void checkScsdis (Scsdis x, int i);
20 extern void checkScsdisc (Scsdisc x, int i);
21 extern void checkSsds (Ssds x, int i);
22 extern void checkSsdsc (Ssdsc x, int i);
23 extern void checkScssdss (Scssdss x, int i);
24 extern void checkScssdssc (Scssdssc x, int i);
25 
26 #include "mixed-struct-init.h"
27 
28 #define T(TYPE)							\
29 extern TYPE g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE;		\
30 extern TYPE g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE;		\
31 extern TYPE g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE;	\
32 extern TYPE g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE;	\
33 								\
34 void								\
35 checkg##TYPE (void)						\
36 {								\
37   check##TYPE (  g1s##TYPE,  1);				\
38   check##TYPE (  g2s##TYPE,  2);				\
39   check##TYPE (  g3s##TYPE,  3);				\
40   check##TYPE (  g4s##TYPE,  4);				\
41   check##TYPE (  g5s##TYPE,  5);				\
42   check##TYPE (  g6s##TYPE,  6);				\
43   check##TYPE (  g7s##TYPE,  7);				\
44   check##TYPE (  g8s##TYPE,  8);				\
45   check##TYPE (  g9s##TYPE,  9);				\
46   check##TYPE ( g10s##TYPE, 10);				\
47   check##TYPE ( g11s##TYPE, 11);				\
48   check##TYPE ( g12s##TYPE, 12);				\
49   check##TYPE ( g13s##TYPE, 13);				\
50   check##TYPE ( g14s##TYPE, 14);				\
51   check##TYPE ( g15s##TYPE, 15);				\
52   check##TYPE ( g16s##TYPE, 16);				\
53 }								\
54 								\
55 void								\
56 test##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4,			\
57 	    TYPE s5, TYPE s6, TYPE s7, TYPE s8,			\
58 	    TYPE s9, TYPE s10, TYPE s11, TYPE s12,		\
59 	    TYPE s13, TYPE s14, TYPE s15, TYPE s16)		\
60 {								\
61   check##TYPE (s1, 1);						\
62   check##TYPE (s2, 2);						\
63   check##TYPE (s3, 3);						\
64   check##TYPE (s4, 4);						\
65   check##TYPE (s5, 5);						\
66   check##TYPE (s6, 6);						\
67   check##TYPE (s7, 7);						\
68   check##TYPE (s8, 8);						\
69   check##TYPE (s9, 9);						\
70   check##TYPE (s10, 10);					\
71   check##TYPE (s11, 11);					\
72   check##TYPE (s12, 12);					\
73   check##TYPE (s13, 13);					\
74   check##TYPE (s14, 14);					\
75   check##TYPE (s15, 15);					\
76   check##TYPE (s16, 16);					\
77 }								\
78 								\
79 void								\
80 testva##TYPE (int n, ...)					\
81 {								\
82   int i;							\
83   va_list ap;							\
84   if (test_va)							\
85     {								\
86       va_start (ap, n);						\
87       for (i = 0; i < n; i++)					\
88 	{							\
89 	  TYPE t = va_arg (ap, TYPE);				\
90 	  check##TYPE (t, i+1);					\
91 	}							\
92       va_end (ap);						\
93     }								\
94 }
95 
96 T(Scdc)
97 T(Sd)
98 T(Sdi)
99 T(Scsdsc)
100 T(Scsdis)
101 T(Scsdisc)
102 T(Ssds)
103 T(Ssdsc)
104 T(Scssdssc)
105