gcc/testsuite/gcc.c-torture/execute/pr120677.c
raw| 1 | /* PR tree-optimization/120677 */ |
| 2 | /* { dg-do run { target int32plus } } */ |
| 3 | |
| 4 | unsigned a; |
| 5 | int b, e; |
| 6 | |
| 7 | int |
| 8 | foo (int d) |
| 9 | { |
| 10 | switch (d) |
| 11 | { |
| 12 | case 0: |
| 13 | case 2: |
| 14 | return 0; |
| 15 | default: |
| 16 | return 1; |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | int |
| 21 | main () |
| 22 | { |
| 23 | for (b = 8; b; b--) |
| 24 | if (a & 1) |
| 25 | a = a >> 1 ^ 20000000; |
| 26 | else |
| 27 | a >>= 1; |
| 28 | e = foo (0); |
| 29 | if (e || a) |
| 30 | __builtin_abort (); |
| 31 | } |