3 #define DEBUG_FPUTS(x) fputs (x, stdout)
4 #define DEBUG_DOT putc ('.', stdout)
5 #define DEBUG_NL putc ('\n', stdout)
13 struct S##TYPE##N { TYPE i[N]; }; \
15 struct S##TYPE##N g1s##TYPE##N, g2s##TYPE##N; \
16 struct S##TYPE##N g3s##TYPE##N, g4s##TYPE##N; \
17 struct S##TYPE##N g5s##TYPE##N, g6s##TYPE##N; \
18 struct S##TYPE##N g7s##TYPE##N, g8s##TYPE##N; \
19 struct S##TYPE##N g9s##TYPE##N, g10s##TYPE##N; \
20 struct S##TYPE##N g11s##TYPE##N, g12s##TYPE##N; \
21 struct S##TYPE##N g13s##TYPE##N, g14s##TYPE##N; \
22 struct S##TYPE##N g15s##TYPE##N, g16s##TYPE##N; \
24 extern void init##TYPE (TYPE *p, int i); \
25 extern void checkg##TYPE##N (void); \
27 test##TYPE##N (struct S##TYPE##N s1, struct S##TYPE##N s2, \
28 struct S##TYPE##N s3, struct S##TYPE##N s4, \
29 struct S##TYPE##N s5, struct S##TYPE##N s6, \
30 struct S##TYPE##N s7, struct S##TYPE##N s8, \
31 struct S##TYPE##N s9, struct S##TYPE##N s10, \
32 struct S##TYPE##N s11, struct S##TYPE##N s12, \
33 struct S##TYPE##N s13, struct S##TYPE##N s14, \
34 struct S##TYPE##N s15, struct S##TYPE##N s16); \
35 extern void testva##TYPE##N (int n, ...); \
39 init##TYPE##N (struct S##TYPE##N *p, int i) \
42 for (j = 0; j < N; j++) \
43 init##TYPE(&p->i[j], i+j); \
47 check##TYPE##N (struct S##TYPE##N *p, int i) \
50 for (j = 0; j < N; j++) \
51 check##TYPE(p->i[j], i+j); \
55 test2_##TYPE##N (struct S##TYPE##N s1, struct S##TYPE##N s2, \
56 struct S##TYPE##N s3, struct S##TYPE##N s4, \
57 struct S##TYPE##N s5, struct S##TYPE##N s6, \
58 struct S##TYPE##N s7, struct S##TYPE##N s8) \
60 test##TYPE##N (s1, g2s##TYPE##N, s2, g4s##TYPE##N, \
61 s3, g6s##TYPE##N, s4, g8s##TYPE##N, \
62 s5, g10s##TYPE##N, s6, g12s##TYPE##N, \
63 s7, g14s##TYPE##N, s8, g16s##TYPE##N); \
67 testit##TYPE##N (void) \
69 DEBUG_FPUTS (#TYPE "[" #N "]"); \
70 init##TYPE##N ( &g1s##TYPE##N, 1*16); \
71 init##TYPE##N ( &g2s##TYPE##N, 2*16); \
72 init##TYPE##N ( &g3s##TYPE##N, 3*16); \
73 init##TYPE##N ( &g4s##TYPE##N, 4*16); \
74 init##TYPE##N ( &g5s##TYPE##N, 5*16); \
75 init##TYPE##N ( &g6s##TYPE##N, 6*16); \
76 init##TYPE##N ( &g7s##TYPE##N, 7*16); \
77 init##TYPE##N ( &g8s##TYPE##N, 8*16); \
78 init##TYPE##N ( &g9s##TYPE##N, 9*16); \
79 init##TYPE##N (&g10s##TYPE##N, 10*16); \
80 init##TYPE##N (&g11s##TYPE##N, 11*16); \
81 init##TYPE##N (&g12s##TYPE##N, 12*16); \
82 init##TYPE##N (&g13s##TYPE##N, 13*16); \
83 init##TYPE##N (&g14s##TYPE##N, 14*16); \
84 init##TYPE##N (&g15s##TYPE##N, 15*16); \
85 init##TYPE##N (&g16s##TYPE##N, 16*16); \
87 DEBUG_FPUTS (" test"); \
88 test##TYPE##N (g1s##TYPE##N, g2s##TYPE##N, \
89 g3s##TYPE##N, g4s##TYPE##N, \
90 g5s##TYPE##N, g6s##TYPE##N, \
91 g7s##TYPE##N, g8s##TYPE##N, \
92 g9s##TYPE##N, g10s##TYPE##N, \
93 g11s##TYPE##N, g12s##TYPE##N, \
94 g13s##TYPE##N, g14s##TYPE##N, \
95 g15s##TYPE##N, g16s##TYPE##N); \
96 DEBUG_FPUTS (" testva"); \
97 testva##TYPE##N (16, \
98 g1s##TYPE##N, g2s##TYPE##N, \
99 g3s##TYPE##N, g4s##TYPE##N, \
100 g5s##TYPE##N, g6s##TYPE##N, \
101 g7s##TYPE##N, g8s##TYPE##N, \
102 g9s##TYPE##N, g10s##TYPE##N, \
103 g11s##TYPE##N, g12s##TYPE##N, \
104 g13s##TYPE##N, g14s##TYPE##N, \
105 g15s##TYPE##N, g16s##TYPE##N); \
106 DEBUG_FPUTS (" test2"); \
107 test2_##TYPE##N (g1s##TYPE##N, g3s##TYPE##N, \
108 g5s##TYPE##N, g7s##TYPE##N, \
109 g9s##TYPE##N, g11s##TYPE##N, \
110 g13s##TYPE##N, g15s##TYPE##N); \
114 typedef struct { char c; } Sc;
115 typedef struct { short s; } Ss;
116 typedef struct { int i; } Si;
117 typedef struct { short s; char c; } Ssc;
118 typedef struct { int i; short s; } Sis;
119 typedef struct { char c; short s; int i; } Scsi;
120 typedef struct { char c; int i; short s; } Scis;
122 extern void abort (void);
124 void checkSc (Sc x, int i) { if (x.c != i/16) { DEBUG_NL; abort (); } }
125 void checkSs (Ss x, int i) { if (x.s != i) { DEBUG_NL; abort (); } }
126 void checkSi (Si x, int i) { if (x.i != i) { DEBUG_NL; abort (); } }
127 void checkSsc (Ssc x, int i)
128 { if (x.s != i || x.c != (i/16)+1) { DEBUG_NL; abort (); } }
129 void checkSis (Sis x, int i)
130 { if (x.i != i || x.s != i+1) { DEBUG_NL; abort (); } }
131 void checkScsi (Scsi x, int i)
132 { if (x.c != i/16 || x.s != i+1 || x.i != i+2) { DEBUG_NL; abort (); } }
133 void checkScis (Scis x, int i)
134 { if (x.c != i/16 || x.i != i+1 || x.s != i+2) { DEBUG_NL; abort (); } }
252 struct_by_value_4_x ()
254 #define T(N, TYPE) testit##TYPE##N ();