aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/sh/pr55160.c
blob: dca15c9b5ab55dbed283fc32430343acc0f177f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* Check that the decrement-and-test instruction is generated.  */
/* { dg-do compile }  */
/* { dg-options "-O1" } */
/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } }  */
/* { dg-final { scan-assembler-times "dt\tr" 2 } } */

int
test_00 (int* x, int c)
{
  int s = 0;
  int i;
  for (i = 0; i < c; ++i)
    s += x[i];
  return s;
}

int
test_01 (int* x, int c)
{
  int s = 0;
  int i;
  for (i = 0; i < c; ++i)
    s += *--x;
  return s;
}