OSDN Git Service

PR c/36507
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / attr-ms_struct-packed1.c
1 /* Test for MS structure with packed attribute.  */
2 /* { dg-do run { target *-*-interix* *-*-mingw* *-*-cygwin* i?86-*-darwin* } }
3 /* { dg-options "-std=gnu99" } */
4
5 extern void abort ();
6
7 union u
8 {
9   int a;
10 } __attribute__((__ms_struct__, __packed__));
11
12 struct s
13 {
14   char c;
15   union u u;
16 };
17
18 int
19 main (void)
20 {
21   if (sizeof (struct s) != (sizeof (char) + sizeof (union u))) 
22     abort ();
23
24   return 0;
25 }