Wattributes-10.c: Add -fno-common option on hppa*-*-hpux*.
[official-gcc.git] / gcc / testsuite / gcc.dg / compat / struct-align-2_y.c
blob2727015a0b8bd3c20d367e36d07f1e23cc12cce2
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 TEST(NAME) \
13 struct outer_##NAME { \
14 int i; \
15 struct epoll_event_##NAME ee; \
16 }; \
18 extern unsigned int v1_##NAME; \
19 extern unsigned int v2_##NAME; \
20 extern unsigned long long v3_##NAME; \
22 extern struct outer_##NAME s_##NAME[2]; \
24 extern void pass_##NAME (struct outer_##NAME); \
25 extern struct outer_##NAME return_##NAME (void); \
27 void \
28 checkp_##NAME (struct outer_##NAME *p) \
29 { \
30 if (p->i != v1_##NAME) \
31 DEBUG_CHECK; \
32 if (p->ee.events != v2_##NAME) \
33 DEBUG_CHECK; \
34 if (p->ee.data != v3_##NAME) \
35 DEBUG_CHECK; \
36 } \
38 void \
39 test_##NAME (void) \
40 { \
41 struct outer_##NAME s; \
42 DEBUG_FPUTS (DESC_##NAME); \
43 DEBUG_NL; \
44 DEBUG_FPUTS (" global array"); \
45 checkp_##NAME (&s_##NAME[0]); \
46 checkp_##NAME (&s_##NAME[1]); \
47 DEBUG_NL; \
48 DEBUG_FPUTS (" argument"); \
49 pass_##NAME (s_##NAME[0]); \
50 DEBUG_NL; \
51 DEBUG_FPUTS (" function result"); \
52 s = return_##NAME (); \
53 checkp_##NAME (&s); \
54 DEBUG_NL; \
57 TEST (orig)
58 #ifndef SKIP_ATTRIBUTE
59 TEST (structmax)
60 TEST (struct4)
61 TEST (struct8)
62 TEST (data4)
63 TEST (data8)
64 TEST (p)
65 TEST (pstruct4)
66 TEST (pstruct8)
67 TEST (pdata4)
68 TEST (pdata8)
69 #endif
71 #else
73 int i; /* prevent compiling an empty file */
75 #endif /* INT_MAX */