1 #define T(N)							\
2 struct S##N { unsigned char i[N]; };				\
3 struct S##N g1s##N, g2s##N, g3s##N;				\
4 								\
5 extern void init##N (struct S##N *p, int i);			\
6 extern void checkg##N (void);					\
7 extern void test##N (struct S##N s1,				\
8     struct S##N s2, struct S##N s3);				\
9 								\
10 void								\
11 check##N (struct S##N x, int i)					\
12 {								\
13   int j;							\
14   for (j = 0; j < N; j++)					\
15     if (x.i[j] != i + j) abort ();				\
16 }								\
17 								\
18 void								\
19 test2_##N (struct S##N s1, struct S##N s2)			\
20 {								\
21   test##N (s1, g2s##N, s2);					\
22 }								\
23 								\
24 void								\
25 testit##N (void)						\
26 {								\
27   init##N (&g1s##N, 64);					\
28   init##N (&g2s##N, 128);					\
29   init##N (&g3s##N, 192);					\
30   checkg##N ();							\
31   test##N (g1s##N, g2s##N, g3s##N);				\
32   test2_##N (g1s##N, g3s##N);					\
33 }
34 
35 extern void abort (void);
36 
37 #ifndef SKIP_ZERO_ARRAY
38 T(0)
39 #endif
40 T(1) T(2) T(3) T(4) T(5) T(6) T(7)
41 T(8) T(9) T(10) T(11) T(12) T(13) T(14) T(15)
42 T(16) T(17) T(18) T(19) T(20) T(21) T(22) T(23)
43 T(24) T(25) T(26) T(27) T(28) T(29) T(30) T(31)
44 T(32) T(33) T(34) T(35) T(36) T(37) T(38) T(39)
45 T(40) T(41) T(42) T(43) T(44) T(45) T(46) T(47)
46 T(48) T(49) T(50) T(51) T(52) T(53) T(54) T(55)
47 T(56) T(57) T(58) T(59) T(60) T(61) T(62) T(63)
48 
49 #undef T
50 
51 void
struct_by_value_1_x()52 struct_by_value_1_x ()
53 {
54 #define T(N) testit##N ();
55 
56 #ifndef SKIP_ZERO_ARRAY
57 T(0)
58 #endif
59 T(1) T(2) T(3) T(4) T(5) T(6) T(7)
60 T(8) T(9) T(10) T(11) T(12) T(13) T(14) T(15)
61 T(16) T(17) T(18) T(19) T(20) T(21) T(22) T(23)
62 T(24) T(25) T(26) T(27) T(28) T(29) T(30) T(31)
63 T(32) T(33) T(34) T(35) T(36) T(37) T(38) T(39)
64 T(40) T(41) T(42) T(43) T(44) T(45) T(46) T(47)
65 T(48) T(49) T(50) T(51) T(52) T(53) T(54) T(55)
66 T(56) T(57) T(58) T(59) T(60) T(61) T(62) T(63)
67 
68 #undef T
69 }
70