gcc/testsuite/gcc.c-torture/execute/pr58726.c
raw| 1 | /* PR rtl-optimization/58726 */ |
| 2 | |
| 3 | int a, c; |
| 4 | union { int f1; int f2 : 1; } b; |
| 5 | |
| 6 | short |
| 7 | foo (short p) |
| 8 | { |
| 9 | return p < 0 ? p : a; |
| 10 | } |
| 11 | |
| 12 | int |
| 13 | main () |
| 14 | { |
| 15 | if (sizeof (short) * __CHAR_BIT__ != 16 |
| 16 | || sizeof (int) * __CHAR_BIT__ != 32) |
| 17 | return 0; |
| 18 | b.f1 = 56374; |
| 19 | unsigned short d; |
| 20 | int e = b.f2; |
| 21 | d = e == 0 ? b.f1 : 0; |
| 22 | c = foo (d); |
| 23 | if (c != (short) 56374) |
| 24 | __builtin_abort (); |
| 25 | return 0; |
| 26 | } |