LWG 3035. std::allocator's constructors should be constexpr
[official-gcc.git] / gcc / testsuite / gcc.dg / compat / struct-align-2_x.c
blob6bfc2226889543b240a1b930c2bdbfcde5f8f066
1 /* { dg-options "-Wno-psabi" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
3 /* Disable this test for 16-bit targets. */
5 #include <limits.h>
7 #if !(defined __GNUC__) || (INT_MAX > 32767)
9 #include "compat-common.h"
10 #include "struct-align-2.h"
12 #define SETUP(NAME,V1,V2,V3) \
13 struct outer_##NAME { \
14 int i; \
15 struct epoll_event_##NAME ee; \
16 }; \
18 unsigned int v1_##NAME = V1; \
19 unsigned int v2_##NAME = V2; \
20 unsigned long long v3_##NAME = V3; \
22 struct outer_##NAME s_##NAME[2] = \
23 { {V1, { V2, V3 } }, { V1, { V2, V3 } } }; \
25 extern void test_##NAME (void); \
26 extern void checkp_##NAME (struct outer_##NAME *); \
27 extern void checkg_##NAME (void); \
29 void \
30 pass_##NAME (struct outer_##NAME s) \
31 { \
32 checkp_##NAME (&s); \
33 } \
35 struct outer_##NAME \
36 return_##NAME (void) \
37 { \
38 return s_##NAME[0]; \
41 #define CHECK(NAME) \
42 test_##NAME()
44 SETUP (orig,101, 102, 0x0101010101010101ULL)
45 #ifndef SKIP_ATTRIBUTE
46 SETUP (structmax, 103, 104, 0x1212121212121212ULL)
47 SETUP (struct4, 105, 106, 0x2323232323232323ULL)
48 SETUP (struct8, 107, 108, 0x3434343434343434ULL)
49 SETUP (data4, 109, 110, 0x4545454545454545ULL)
50 SETUP (data8, 111, 112, 0x5656565656565656ULL)
51 SETUP (p, 113, 114, 0x6767676767676767ULL)
52 SETUP (pstruct4, 115, 116, 0x7878787878787878ULL)
53 SETUP (pstruct8, 117, 118, 0x8989898989898989ULL)
54 SETUP (pdata4, 119, 120, 0x9A9A9A9A9A9A9A9AULL)
55 SETUP (pdata8, 121, 122, 0xABABABABABABABABULL)
56 #endif
58 void
59 struct_align_2_x (void)
61 DEBUG_INIT
63 CHECK (orig);
64 #ifndef SKIP_ATTRIBUTE
65 CHECK (structmax);
66 CHECK (struct4);
67 CHECK (struct8);
68 CHECK (data4);
69 CHECK (data8);
70 CHECK (p);
71 CHECK (pstruct4);
72 CHECK (pstruct8);
73 CHECK (pdata4);
74 CHECK (pdata8);
75 #endif
77 DEBUG_FINI
79 if (fails != 0)
80 abort ();
83 #else
85 void struct_align_2_x (void) {}
87 #endif /* INT_MAX */