Reverting merge from trunk
[official-gcc.git] / gcc / testsuite / gcc.dg / packed-vla.c
blob04ccb96636dce064c17fea16a45b6d7285d109d8
1 /* PR middle-end/27945 */
2 /* { dg-do run } */
3 /* { dg-options "" } */
5 extern int printf (const char *, ...);
6 extern void abort ();
8 int func(int levels)
10 struct bar {
11 unsigned char a;
12 int b[levels];
13 } __attribute__ ((__packed__)) bar;
15 struct foo {
16 unsigned char a;
17 int b[4];
18 } __attribute__ ((__packed__)) foo;
20 printf("foo %d\n", sizeof(foo));
21 printf("bar %d\n", sizeof(bar));
23 if (sizeof (foo) != sizeof (bar))
24 abort ();
27 int main()
29 func(4);
30 return 0;