PR c/64856
[official-gcc.git] / gcc / testsuite / gcc.dg / pr53352.c
blob171bcd71ec1063a51c1689eb68cbe6aef87773d3
1 /* { dg-do run } */
2 /* { dg-options "-O1" } */
4 #include <stdlib.h>
6 typedef union
8 struct
10 unsigned char a;
11 unsigned char b;
12 unsigned char c;
13 unsigned char d;
14 } parts;
15 unsigned long whole;
16 } T;
18 T *g_t;
20 void bar (unsigned long x)
22 if (x != 0)
23 abort ();
26 int main ()
28 T one;
29 T two;
30 T tmp1, tmp2;
32 one.whole = 0xFFE0E0E0UL;
33 two.whole = 0xFF000000UL;
34 tmp1.parts = two.parts;
35 tmp2.parts = one.parts;
36 tmp2.parts.c = tmp1.parts.c;
37 one.parts = tmp2.parts;
39 g_t = &one;
40 bar (0);
41 return 0;