gcc/testsuite/gcc.c-torture/execute/pr78477.c
raw| 1 | /* PR rtl-optimization/78477 */ |
| 2 | |
| 3 | unsigned a; |
| 4 | unsigned short b; |
| 5 | |
| 6 | unsigned |
| 7 | foo (unsigned x) |
| 8 | { |
| 9 | b = x; |
| 10 | a >>= (b & 1); |
| 11 | b = 1 | (b << 5); |
| 12 | b >>= 15; |
| 13 | x = (unsigned char) b > ((2 - (unsigned char) b) & 1); |
| 14 | b = 0; |
| 15 | return x; |
| 16 | } |
| 17 | |
| 18 | int |
| 19 | main () |
| 20 | { |
| 21 | if (__CHAR_BIT__ != 8 || sizeof (short) != 2 || sizeof (int) < 4) |
| 22 | return 0; |
| 23 | unsigned x = foo (12345); |
| 24 | if (x != 0) |
| 25 | __builtin_abort (); |
| 26 | return 0; |
| 27 | } |