aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/attr-ms_struct-packed1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/attr-ms_struct-packed1.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-ms_struct-packed1.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-ms_struct-packed1.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-ms_struct-packed1.c
new file mode 100644
index 000000000..d885c6ff3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-ms_struct-packed1.c
@@ -0,0 +1,25 @@
+/* Test for MS structure with packed attribute. */
+/* { dg-do run { target *-*-interix* *-*-mingw* *-*-cygwin* i?86-*-darwin* } }
+/* { dg-options "-std=gnu99" } */
+
+extern void abort ();
+
+union u
+{
+ int a;
+} __attribute__((__ms_struct__, __packed__));
+
+struct s
+{
+ char c;
+ union u u;
+};
+
+int
+main (void)
+{
+ if (sizeof (struct s) != (sizeof (char) + sizeof (union u)))
+ abort ();
+
+ return 0;
+}