summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/loop-bound-6.c
blob: 8319434985db9f9f692f44a5c94b89bbd2b23497 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-ivopts-details" } */

int *a;

int
foo (signed char s)
{
  signed char i;
  int sum = 0;

  for (i = s; i > 0; i--)
    {
      sum += a[i];
    }

  return sum;
}

/* Check loop niter bound information.  */
/* { dg-final { scan-tree-dump "bounded by 126" "ivopts" } } */
/* { dg-final { scan-tree-dump-not "bounded by 127" "ivopts" } } */
/* { dg-final { scan-tree-dump-not "zero if " "ivopts" } } */