C99 testsuite readiness: Compile more tests with -std=gnu89
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / strct-pack-3.c
blob69adf576bf8ba8f1dd99099c8f8d1dc5660d3068
1 /* { dg-additional-options "-std=gnu89" } */
3 typedef struct
5 short i __attribute__ ((aligned (2),packed));
6 int f[2] __attribute__ ((aligned (2),packed));
7 } A;
9 f (ap)
10 A *ap;
12 short i, j = 1;
14 i = ap->f[1];
15 i += ap->f[j];
16 for (j = 0; j < 2; j++)
17 i += ap->f[j];
19 return i;
22 main ()
24 A a;
25 a.f[0] = 100;
26 a.f[1] = 13;
27 if (f (&a) != 139)
28 abort ();
29 exit (0);