2015-12-10 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / bitfield3.c
blob1a161597cfeb36377cb6c8ab3afaf0bd39b4bebd
1 // Test for bitfield alignment in structs on IA-32
2 // { dg-do run }
3 // { dg-options "-O2" }
4 // { dg-additional-options "-mno-align-double -mno-ms-bitfields" { target *-*-interix* } }
5 // { dg-additional-options "-mno-ms-bitfields" { target *-*-mingw* } }
7 extern void abort (void);
8 extern void exit (int);
10 struct X {
11 int : 32;
14 struct Y {
15 int i : 32;
18 int main () {
19 if (__alignof__(struct X) != 1)
20 abort ();
21 if (__alignof__(struct Y) != 4)
22 abort ();
24 exit (0);