aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-19.c
blob: 51c1913d003a8f651170c1f77aa22fc2b2d24a91 (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
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-lim2-details" } */

volatile int x;
void
bar (int, char *, char *);
void
foo (int *a, int n, int m, int s, int t)
{
  int i;
  int j;
  int k;

  for (i = 0; i < m; i++) // Loop 1
    {
      if (__builtin_expect (x, 0))
	for (j = 0; j < n; j++) // Loop 2
	  for (k = 0; k < n; k++) // Loop 3
	    {
	      bar (s / 5, "one", "two");
	      a[t] = s;
	    }
      a[t] = t;
    }
}

/* { dg-final { scan-tree-dump-times "out of loop 2" 4 "lim2" } } */
/* { dg-final { scan-tree-dump-times "out of loop 1" 3 "lim2" } } */