aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-10.c
blob: f9c1c516ecef2da57822325860cdcfee4e6aa12a (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
27
28
29
30
/* APPLE LOCAL file lno */
/* { dg-do compile } */ 
/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */

void bar (int);

int foo (void)
{
  int a;
  int x;
  int c[100][100];
  
  /* loop_1 runs 39 times.  */
  for (a = 11; a < 50; a++)
    {
      /* Array access functions have to be analyzed.  */
      x = a + 5;
      c[x][a+1] = c[x+2][a+3] + c[x-1][a+2];
    }
  bar (c[1][2]);
}

/* The analyzer has to detect the scalar functions:
   a   ->  {11, +, 1}_1
   x   ->  {16, +, 1}_1
   x+2 ->  {18, +, 1}_1
   x-1 ->  {15, +, 1}_1
*/

/* { dg-final { scan-tree-dump-times "set_nb_iterations_in_loop = 39" 1 "lptest"} } */