gcc/testsuite/gcc.dg/torture/pr45017.c
raw| 1 | /* { dg-do run { target i?86-*-* x86_64-*-* } } */ |
| 2 | |
| 3 | int tester(char *bytes) |
| 4 | { |
| 5 | union { |
| 6 | struct { |
| 7 | unsigned int r1:4; |
| 8 | unsigned int r2:4; |
| 9 | } fmt; |
| 10 | char value[1]; |
| 11 | } ovl; |
| 12 | |
| 13 | ovl.value[0] = bytes[0]; |
| 14 | return ovl.fmt.r1; |
| 15 | } |
| 16 | extern void abort (void); |
| 17 | int main() |
| 18 | { |
| 19 | char buff = 0x2f; |
| 20 | if (tester(&buff) != 0x0f) |
| 21 | abort (); |
| 22 | return 0; |
| 23 | } |
| 24 |