gcc/testsuite/gcc.target/aarch64/cmpelim_mult_uses_1.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O2" } */ |
| 3 | |
| 4 | /* X is both compared against zero and used. Make sure we can still |
| 5 | generate an ADDS and avoid an explicit comparison against zero. */ |
| 6 | |
| 7 | int |
| 8 | foo (int x, int y) |
| 9 | { |
| 10 | x += y; |
| 11 | if (x != 0) |
| 12 | x = x + 2; |
| 13 | return x; |
| 14 | } |
| 15 | |
| 16 | /* { dg-final { scan-assembler-times "adds\\tw\[0-9\]+, w\[0-9\]+, w\[0-9\]+" 1 } } */ |
| 17 | /* { dg-final { scan-assembler-not "cmp\\tw\[0-9\]+, 0" } } */ |