gcc/testsuite/gcc.target/cris/pr93372-15.c
raw| 1 | /* Check that eliminable compare-instructions are eliminated. */ |
| 2 | /* { dg-do compile } */ |
| 3 | /* { dg-options "-O2" } */ |
| 4 | /* { dg-final { scan-assembler-times "\tcmp|\ttest" 1 } } */ |
| 5 | |
| 6 | int f(int a, int b, int *d) |
| 7 | { |
| 8 | int c = a + b; |
| 9 | |
| 10 | *d = (c == 0); |
| 11 | |
| 12 | /* See also pr93372-6.c. We should get exactly one compare |
| 13 | instruction for this condition. */ |
| 14 | return c <= 0; |
| 15 | } |