Merge to HEAD at tree-cleanup-merge-20041024 .
[official-gcc.git] / gcc / testsuite / gcc.dg / compat / struct-align-2_y.c
blob0ca2e40c4c1e092b43e82c333b9c02a32c60b558
1 /* Disable this test for 16-bit targets. */
3 #include <limits.h>
5 #if !(defined __GNUC__) || (INT_MAX > 32767)
7 #include "compat-common.h"
8 #include "struct-align-2.h"
10 #define TEST(NAME) \
11 struct outer_##NAME { \
12 int i; \
13 struct epoll_event_##NAME ee; \
14 }; \
16 extern unsigned int v1_##NAME; \
17 extern unsigned int v2_##NAME; \
18 extern unsigned long long v3_##NAME; \
20 extern struct outer_##NAME s_##NAME[2]; \
22 extern void pass_##NAME (struct outer_##NAME); \
23 extern struct outer_##NAME return_##NAME (void); \
25 void \
26 checkp_##NAME (struct outer_##NAME *p) \
27 { \
28 if (p->i != v1_##NAME) \
29 DEBUG_CHECK; \
30 if (p->ee.events != v2_##NAME) \
31 DEBUG_CHECK; \
32 if (p->ee.data != v3_##NAME) \
33 DEBUG_CHECK; \
34 } \
36 void \
37 test_##NAME (void) \
38 { \
39 struct outer_##NAME s; \
40 DEBUG_FPUTS (DESC_##NAME); \
41 DEBUG_NL; \
42 DEBUG_FPUTS (" global array"); \
43 checkp_##NAME (&s_##NAME[0]); \
44 checkp_##NAME (&s_##NAME[1]); \
45 DEBUG_NL; \
46 DEBUG_FPUTS (" argument"); \
47 pass_##NAME (s_##NAME[0]); \
48 DEBUG_NL; \
49 DEBUG_FPUTS (" function result"); \
50 s = return_##NAME (); \
51 checkp_##NAME (&s); \
52 DEBUG_NL; \
55 TEST (orig)
56 #ifndef SKIP_ATTRIBUTE
57 TEST (structmax)
58 TEST (struct4)
59 TEST (struct8)
60 TEST (data4)
61 TEST (data8)
62 TEST (p)
63 TEST (pstruct4)
64 TEST (pstruct8)
65 TEST (pdata4)
66 TEST (pdata8)
67 #endif
69 #else
71 int i; /* prevent compiling an empty file */
73 #endif /* INT_MAX */