gcc/testsuite/gcc.target/sh/pr55160.c
raw| 1 | /* Check that the decrement-and-test instruction is generated. */ |
| 2 | /* { dg-do compile } */ |
| 3 | /* { dg-options "-O1" } */ |
| 4 | /* { dg-final { scan-assembler-times "dt\tr" 2 } } */ |
| 5 | |
| 6 | int |
| 7 | test_00 (int* x, int c) |
| 8 | { |
| 9 | int s = 0; |
| 10 | int i; |
| 11 | for (i = 0; i < c; ++i) |
| 12 | s += x[i]; |
| 13 | return s; |
| 14 | } |
| 15 | |
| 16 | int |
| 17 | test_01 (int* x, int c) |
| 18 | { |
| 19 | int s = 0; |
| 20 | int i; |
| 21 | for (i = 0; i < c; ++i) |
| 22 | s += *--x; |
| 23 | return s; |
| 24 | } |