* gcc.dg/stack-check-5.c: Skip with -fstack-protector.
[official-gcc.git] / gcc / testsuite / gcc.dg / pragma-pack-2.c
blobf44f8dbba3330c5869407c59c0266ceca7f2265d
1 /* On Solaris, #pragma pack should accept macro expansion. */
3 /* { dg-do run { target *-*-solaris2.* } } */
5 extern void abort (void);
7 struct {
8 char one;
9 long two;
10 } defaultalign;
12 #define ALIGNHIGH 16
14 #pragma pack(ALIGNHIGH)
15 struct {
16 char one;
17 long two;
18 } sixteen;
20 #define ALIGN1(X) 1
21 #pragma pack(ALIGN1(4))
22 struct {
23 char one;
24 long two;
25 } two;
27 #define ALIGN2(X) X
28 #pragma pack(ALIGN2(2))
29 struct {
30 char one;
31 long two;
32 } three;
34 #define EMPTY
35 #pragma pack(EMPTY)
36 struct {
37 char one;
38 long two;
39 } resetalign;
41 main()
43 if(sizeof(sixteen) < sizeof(defaultalign)) abort();
44 if(sizeof(two) >= sizeof(defaultalign)) abort();
45 if(sizeof(three) <= sizeof(two)) abort();
46 if(sizeof(resetalign) != sizeof(defaultalign)) abort();
47 return 0;