2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.dg / compat / struct-align-2_y.c
blob0a5ec6ef31d11d021f21725aae7425c49e6b995e
1 /* Disable this test for 16-bit targets. */
3 #if __INT_MAX__ > 32767
5 #include "compat-common.h"
6 #include "struct-align-2.h"
8 #define TEST(NAME) \
9 struct outer_##NAME { \
10 int i; \
11 struct epoll_event_##NAME ee; \
12 }; \
14 extern unsigned int v1_##NAME; \
15 extern unsigned int v2_##NAME; \
16 extern unsigned long long v3_##NAME; \
18 extern struct outer_##NAME s_##NAME[2]; \
20 extern void pass_##NAME (struct outer_##NAME); \
21 extern struct outer_##NAME return_##NAME (void); \
23 void \
24 checkp_##NAME (struct outer_##NAME *p) \
25 { \
26 if (p->i != v1_##NAME) \
27 DEBUG_CHECK; \
28 if (p->ee.events != v2_##NAME) \
29 DEBUG_CHECK; \
30 if (p->ee.data != v3_##NAME) \
31 DEBUG_CHECK; \
32 } \
34 void \
35 test_##NAME (void) \
36 { \
37 struct outer_##NAME s; \
38 DEBUG_FPUTS (DESC_##NAME); \
39 DEBUG_NL; \
40 DEBUG_FPUTS (" global array"); \
41 checkp_##NAME (&s_##NAME[0]); \
42 checkp_##NAME (&s_##NAME[1]); \
43 DEBUG_NL; \
44 DEBUG_FPUTS (" argument"); \
45 pass_##NAME (s_##NAME[0]); \
46 DEBUG_NL; \
47 DEBUG_FPUTS (" function result"); \
48 s = return_##NAME (); \
49 checkp_##NAME (&s); \
50 DEBUG_NL; \
53 TEST (orig)
54 TEST (structmax)
55 TEST (struct4)
56 TEST (struct8)
57 TEST (data4)
58 TEST (data8)
59 TEST (p)
60 TEST (pstruct4)
61 TEST (pstruct8)
62 TEST (pdata4)
63 TEST (pdata8)
65 #else
67 int i; /* prevent compiling an empty file */
69 #endif /* __INT_MAX__ */