1 #include "compat-common.h"
2 #include "struct-align-1.h"
4 #define SETUP(NAME,V1,V2,V3) \
6 double v2_##NAME = V2; \
9 struct B1_##NAME b1_##NAME = { V1, V2 }; \
10 struct B2_##NAME b2_##NAME = { V1, { V2 } }; \
11 struct B3_##NAME b3_##NAME = { V1, { V2, V3 } }; \
13 struct B1_##NAME ab1_##NAME[2] = \
14 { { V1, V2 }, { V1, V2 } }; \
15 struct B2_##NAME ab2_##NAME[2] = \
16 { { V1, { V2 } }, { V1, { V2 } } }; \
17 struct B3_##NAME ab3_##NAME[2] = \
18 { { V1, { V2, V3 } }, { V1, { V2, V3 } } }; \
20 extern void test_##NAME (void); \
21 extern void checkp1_##NAME (struct B1_##NAME *); \
22 extern void checkp2_##NAME (struct B2_##NAME *); \
23 extern void checkp3_##NAME (struct B3_##NAME *); \
24 extern void checkg1_##NAME (void); \
25 extern void checkg2_##NAME (void); \
26 extern void checkg3_##NAME (void); \
29 pass1_##NAME (struct B1_##NAME s) \
31 checkp1_##NAME (&s); \
35 pass2_##NAME (struct B2_##NAME s) \
37 checkp2_##NAME (&s); \
41 pass3_##NAME (struct B3_##NAME s) \
43 checkp3_##NAME (&s); \
47 return1_##NAME (void) \
49 return ab1_##NAME[0]; \
53 return2_##NAME (void) \
55 return ab2_##NAME[0]; \
59 return3_##NAME (void) \
61 return ab3_##NAME[0]; \
64 #define CHECK(NAME) test_##NAME()
66 SETUP (orig, 49, 1.0, 111111)
67 SETUP (p_all, 50, 2.0, 222222)
68 SETUP (p_inner, 51, 3.0, 333333)
69 SETUP (p_outer, 52, 4.0, 444444)
70 SETUP (a_max, 53, 5.0, 555555)
71 SETUP (m_outer_p_inner, 54, 6.0, 666666)
72 SETUP (m_inner_p_outer, 55, 7.0, 777777)
75 struct_align_1_x (void)
84 CHECK (m_outer_p_inner);
85 CHECK (m_inner_p_outer);