gcc/testsuite/gcc.c-torture/execute/pr78675.c
raw| 1 | /* PR tree-optimization/78675 */ |
| 2 | |
| 3 | long int a; |
| 4 | |
| 5 | __attribute__((noinline, noclone)) long int |
| 6 | foo (long int x) |
| 7 | { |
| 8 | long int b; |
| 9 | while (a < 1) |
| 10 | { |
| 11 | b = a && x; |
| 12 | ++a; |
| 13 | } |
| 14 | return b; |
| 15 | } |
| 16 | |
| 17 | int |
| 18 | main () |
| 19 | { |
| 20 | if (foo (0) != 0) |
| 21 | __builtin_abort (); |
| 22 | a = 0; |
| 23 | if (foo (1) != 0) |
| 24 | __builtin_abort (); |
| 25 | a = 0; |
| 26 | if (foo (25) != 0) |
| 27 | __builtin_abort (); |
| 28 | a = -64; |
| 29 | if (foo (0) != 0) |
| 30 | __builtin_abort (); |
| 31 | a = -64; |
| 32 | if (foo (1) != 0) |
| 33 | __builtin_abort (); |
| 34 | a = -64; |
| 35 | if (foo (25) != 0) |
| 36 | __builtin_abort (); |
| 37 | return 0; |
| 38 | } |