gcc/testsuite/gcc.target/riscv/gcse-const.c
raw| 1 | /* Slightly modified copy of gcc.target/arm/pr40956.c. */ |
| 2 | /* { dg-options "-Os" } */ |
| 3 | /* Make sure the constant "6" is loaded into register only once. */ |
| 4 | /* { dg-final { scan-assembler-times "\tli.*6" 1 } } */ |
| 5 | |
| 6 | int foo(int p, int* q) |
| 7 | { |
| 8 | if (p!=9) |
| 9 | *q = 6; |
| 10 | else |
| 11 | *(q+1) = 6; |
| 12 | return 3; |
| 13 | } |