aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/arm/ivopts-5.c
blob: c8b9f4f0e5da8f079d4c61f70ecadfcd9f1992ac (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
26
/* { dg-do assemble } */
/* { dg-options "-Os -mthumb -fdump-tree-ivopts -save-temps" } */

extern unsigned int foo (int*) __attribute__((pure));

unsigned int
tr1 (int array[], unsigned int n)
{
  int sum = 0;
  unsigned int x;
  x = 0;
  while (1)
    {
      sum += foo (&array[x]);
      if (!(x < n))
        break;
      x++;
    }
  return sum;
}

/* { dg-final { scan-tree-dump-times "PHI <ivtmp" 1 "ivopts"} } */
/* { dg-final { scan-tree-dump-times "PHI <x" 0 "ivopts"} } */
/* { dg-final { scan-tree-dump-times ", x" 0 "ivopts"} } */
/* { dg-final { object-size text <= 30 { target arm_thumb2_ok } } } */
/* { dg-final { cleanup-tree-dump "ivopts" } } */