[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / gcc.dg / pr56341-1.c
blob91cf80ba286d17ddce6dc3b4492de0fe0a76a0da
1 /* { dg-do run } */
2 /* { dg-options "-fstrict-volatile-bitfields" } */
4 extern void abort (void);
6 struct test0
8 unsigned char b1[2];
9 } __attribute__((packed, aligned(2)));
11 struct test1
13 volatile unsigned long a1;
14 unsigned char b1[4];
15 } __attribute__((packed, aligned(2)));
17 struct test2
19 struct test0 t0;
20 struct test1 t1;
21 struct test0 t2;
22 } __attribute__((packed, aligned(2)));
24 struct test2 xx;
25 struct test2 *x1 = &xx;
27 #define MAGIC 0x12345678
29 void test0 (struct test2* x1)
31 x1->t1.a1 = MAGIC;
34 int main()
36 test0 (x1);
37 if (xx.t1.a1 != MAGIC)
38 abort ();
39 return 0;