Debian Codegraph @

gcc/testsuite/g++.dg/ext/alias-canon2.C

raw
1 // { dg-do compile }
2 // PR c++/37553
3 typedef unsigned int ui32;
4 __extension__ typedef unsigned long long int ui64;
5
6 typedef ui32 __attribute__ ((__may_alias__)) ui32a;
7 typedef ui64 __attribute__ ((__may_alias__)) ui64a;
8
9 union u_u32
10 {
11 ui32a v;
12 } __attribute__ ((__may_alias__));
13
14 union u_u64
15 {
16 ui64a v;
17 struct
18 {
19 union u_u32 lo32, hi32;
20 } u;
21 } __attribute__ ((__may_alias__));
22
23 void
24 out_long (ui64 longVal)
25 {
26 if ((*(union u_u64 *) &longVal).u.lo32.v < 0x10000000ul)
27 {
28 if ((ui32) ((*(union u_u64 *) &longVal).u.lo32.v) < 0x4000u)
29 {
30 /* do something useful */
31 }
32 }
33 }