aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/i386/bitfield3.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.target/i386/bitfield3.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/i386/bitfield3.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/bitfield3.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/bitfield3.c
new file mode 100644
index 000000000..1a161597c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/bitfield3.c
@@ -0,0 +1,25 @@
+// Test for bitfield alignment in structs on IA-32
+// { dg-do run }
+// { dg-options "-O2" }
+// { dg-additional-options "-mno-align-double -mno-ms-bitfields" { target *-*-interix* } }
+// { dg-additional-options "-mno-ms-bitfields" { target *-*-mingw* } }
+
+extern void abort (void);
+extern void exit (int);
+
+struct X {
+ int : 32;
+};
+
+struct Y {
+ int i : 32;
+};
+
+int main () {
+ if (__alignof__(struct X) != 1)
+ abort ();
+ if (__alignof__(struct Y) != 4)
+ abort ();
+
+ exit (0);
+}