Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.c-torture/execute/pr86492.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
1 /* PR tree-optimization/86492 */ | |
2 | |
3 union U | |
4 { | |
5 unsigned int r; | |
6 struct S | |
7 { | |
8 unsigned int a:12; | |
9 unsigned int b:4; | |
10 unsigned int c:16; | |
11 } f; | |
12 }; | |
13 | |
14 __attribute__((noipa)) unsigned int | |
15 foo (unsigned int x) | |
16 { | |
17 union U u; | |
18 u.r = 0; | |
19 u.f.c = x; | |
20 u.f.b = 0xe; | |
21 return u.r; | |
22 } | |
23 | |
24 int | |
25 main () | |
26 { | |
27 union U u; | |
28 if (__CHAR_BIT__ * __SIZEOF_INT__ != 32 || sizeof (u.r) != sizeof (u.f)) | |
29 return 0; | |
30 u.r = foo (0x72); | |
31 if (u.f.a != 0 || u.f.b != 0xe || u.f.c != 0x72) | |
32 __builtin_abort (); | |
33 return 0; | |
34 } |