PR testsuite/52641
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / loop-23.c
blob4f42491dad22f13556c5cba1a838005c730f82bc
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -funroll-loops -fdump-tree-cunroll-details" } */
4 __attribute__ ((pure))
5 int bla(int);
7 int foo(void)
9 int i;
10 int sum;
12 /* This loop used to appear to be too large for unrolling. */
13 for (i = 0; i < 4; i++)
15 sum += bla (i);
16 sum += bla (2*i);
17 sum += bla (3*i);
18 sum += bla (4*i);
19 sum += bla (5*i);
20 sum += bla (6*i);
21 sum += bla (7*i);
22 sum += bla (8*i);
24 return sum;
27 /* { dg-final { scan-tree-dump-times "Completely unroll loop 3 times" 1 "cunroll" } } */
29 /* { dg-final { cleanup-tree-dump "cunroll" } } */