gcc/testsuite/gcc.c-torture/execute/pr40747.c
raw| 1 | /* PR middle-end/40747 */ |
| 2 | |
| 3 | extern void abort (void); |
| 4 | |
| 5 | int |
| 6 | foo (int i) |
| 7 | { |
| 8 | return (i < 4 && i >= 0) ? i : 4; |
| 9 | } |
| 10 | |
| 11 | int |
| 12 | main () |
| 13 | { |
| 14 | if (foo (-1) != 4) abort (); |
| 15 | if (foo (0) != 0) abort (); |
| 16 | if (foo (1) != 1) abort (); |
| 17 | if (foo (2) != 2) abort (); |
| 18 | if (foo (3) != 3) abort (); |
| 19 | if (foo (4) != 4) abort (); |
| 20 | if (foo (5) != 4) abort (); |
| 21 | return 0; |
| 22 | } |