]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/pragma-align.c
tm.texi.in (HANDLE_SYSV_PRAGMA, [...]): Remove.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / pragma-align.c
CommitLineData
24a57808 1/* Prove that pragma alignment handling works somewhat. */
a5de05b7 2
24a57808 3/* { dg-do run } */
a5de05b7 4
ee712eab
JM
5extern void abort (void);
6
a5de05b7
RL
7struct {
8 char one;
9 long two;
10} defaultalign;
11
d48b4987
EB
12#if defined(__LP64__)
13#pragma pack(8)
14#else
a5de05b7 15#pragma pack(4)
d48b4987 16#endif
a5de05b7
RL
17struct {
18 char one;
19 long two;
20} sixteen;
21
22#pragma pack(1)
23struct {
24 char one;
25 long two;
26} two;
27
28#pragma pack(2)
29struct {
30 char one;
31 long two;
32} three;
33
34#pragma pack()
35struct {
36 char one;
37 long two;
38} resetalign;
39
40main()
41{
42 if(sizeof(sixteen) < sizeof(defaultalign)) abort();
43 if(sizeof(two) >= sizeof(defaultalign)) abort();
44 if(sizeof(three) <= sizeof(two)) abort();
45 if(sizeof(resetalign) != sizeof(defaultalign)) abort();
c82fd9b8 46 return 0;
a5de05b7 47}