2018-02-09 Sebastian Perta <sebastian.perta@renesas.com>
[official-gcc.git] / gcc / testsuite / gcc.target / sh / pr55160.c
blob996c4ca90df9d5c54f1598643166edf4eb3d6876
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 } } */
6 int
7 test_00 (int* x, int c)
9 int s = 0;
10 int i;
11 for (i = 0; i < c; ++i)
12 s += x[i];
13 return s;
16 int
17 test_01 (int* x, int c)
19 int s = 0;
20 int i;
21 for (i = 0; i < c; ++i)
22 s += *--x;
23 return s;