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

volatile int x;
volatile int y;
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
	  if (__builtin_expect (y, 0))
	    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 3" 4 "lim2" } } */
/* { dg-final { scan-tree-dump-times "out of loop 1" 3 "lim2" } } */