1 /* { dg-options "-Wno-psabi" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
3 #include "compat-common.h"
4 #include "struct-align-1.h"
6 #define SETUP(NAME,V1,V2,V3) \
8 double v2_##NAME = V2; \
11 struct B1_##NAME b1_##NAME = { V1, V2 }; \
12 struct B2_##NAME b2_##NAME = { V1, { V2 } }; \
13 struct B3_##NAME b3_##NAME = { V1, { V2, V3 } }; \
15 struct B1_##NAME ab1_##NAME[2] = \
16 { { V1, V2 }, { V1, V2 } }; \
17 struct B2_##NAME ab2_##NAME[2] = \
18 { { V1, { V2 } }, { V1, { V2 } } }; \
19 struct B3_##NAME ab3_##NAME[2] = \
20 { { V1, { V2, V3 } }, { V1, { V2, V3 } } }; \
22 extern void test_##NAME (void); \
23 extern void checkp1_##NAME (struct B1_##NAME *); \
24 extern void checkp2_##NAME (struct B2_##NAME *); \
25 extern void checkp3_##NAME (struct B3_##NAME *); \
26 extern void checkg1_##NAME (void); \
27 extern void checkg2_##NAME (void); \
28 extern void checkg3_##NAME (void); \
31 pass1_##NAME (struct B1_##NAME s) \
33 checkp1_##NAME (&s); \
37 pass2_##NAME (struct B2_##NAME s) \
39 checkp2_##NAME (&s); \
43 pass3_##NAME (struct B3_##NAME s) \
45 checkp3_##NAME (&s); \
49 return1_##NAME (void) \
51 return ab1_##NAME[0]; \
55 return2_##NAME (void) \
57 return ab2_##NAME[0]; \
61 return3_##NAME (void) \
63 return ab3_##NAME[0]; \
66 #define CHECK(NAME) test_##NAME()
68 #if __INT_MAX__ > 32767
69 SETUP (orig
, 49, 1.0, 111111)
71 SETUP (orig
, 49, 1.0, 1111)
73 #ifndef SKIP_ATTRIBUTE
74 #if __INT_MAX__ > 32767
75 SETUP (p_all
, 50, 2.0, 222222)
76 SETUP (p_inner
, 51, 3.0, 333333)
77 SETUP (p_outer
, 52, 4.0, 444444)
78 SETUP (a_max
, 53, 5.0, 555555)
79 SETUP (m_outer_p_inner
, 54, 6.0, 666666)
80 SETUP (m_inner_p_outer
, 55, 7.0, 777777)
82 SETUP (p_all
, 50, 2.0, 2222)
83 SETUP (p_inner
, 51, 3.0, 3333)
84 SETUP (p_outer
, 52, 4.0, 4444)
85 SETUP (a_max
, 53, 5.0, 5555)
86 SETUP (m_outer_p_inner
, 54, 6.0, 6666)
87 SETUP (m_inner_p_outer
, 55, 7.0, 7777)
92 struct_align_1_x (void)
97 #ifndef SKIP_ATTRIBUTE
102 CHECK (m_outer_p_inner
);
103 CHECK (m_inner_p_outer
);