PR tree-optimization/33562
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-lim-10.c
blobec609d81c68104c4a9f1b927eec5b50b15f9038c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-lim2-details" } */
4 int *l, *r;
5 int test_func(void)
7 int i;
8 int direction;
9 static int pos;
11 pos = 0;
12 direction = 1;
14 for ( i = 0; i <= 400; i++ )
16 if ( direction == 0 )
17 pos = l[pos];
18 else
19 pos = r[pos];
21 if ( pos == -1 )
23 pos = 0;
24 direction = !direction;
27 return i;
30 /* { dg-final { scan-tree-dump "Executing store motion of pos" "lim2" } } */