OSDN Git Service

2005-10-01 Paul Thomas <pault@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / i386-bitfield3.c
1 // Test for bitfield alignment in structs on IA-32
2 // { dg-do run { target i?86-*-* x86_64-*-* } }
3 // { dg-options "-O2" }
4 // { dg-options "-mno-align-double -mno-ms-bitfields" { target *-*-interix* } }
5
6 extern void abort (void);
7 extern void exit (int);
8
9 struct X {
10   int : 32;
11 };
12
13 struct Y {
14   int i : 32;
15 };
16
17 int main () {
18   if (__alignof__(struct X) != 1)
19     abort ();
20   if (__alignof__(struct Y) != 4)
21     abort ();
22   
23   exit (0);
24 }