PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / 20010518-2.c
blob1990f8e63bcf1ec2579c3265ff03ffffb7a76a8b
1 /* Mis-aligned packed structures. */
3 typedef struct
5 char b0;
6 char b1;
7 char b2;
8 char b3;
9 char b4;
10 char b5;
11 } __attribute__ ((packed)) b_struct;
14 typedef struct
16 short a;
17 long b;
18 short c;
19 short d;
20 b_struct e;
21 } __attribute__ ((packed)) a_struct;
24 int
25 main(void)
27 volatile a_struct *a;
28 volatile a_struct b;
30 a = &b;
31 *a = (a_struct){1,2,3,4};
32 a->e.b4 = 'c';
34 if (a->a != 1 || a->b != 2 || a->c != 3 || a->d != 4 || a->e.b4 != 'c')
35 abort ();
37 exit (0);