aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-50.c
blob: 3da547ccd111b11e562486f88c00bbf7ee5045e9 (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 compile } */ 
/* { dg-options "-O1 -fscalar-evolutions -fdump-tree-scev-details" } */

int 
foo (int *c)
{
  int i = 0;
  int j = 10;
  
  while (1)
    {
      /* This case exercises the number of iterations detector for 
	 {0, +, 1}_1 == {10, +, -1}_1
      */
      if (i == j)
	break;
      
      i++;
      j--;
    }
  
  return j;
}

/* FIXME. */