* tree-loop-distribution.c (INCLUDE_ALGORITHM): New header file.
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / loop-15.c
blobdce6ad57a04938a955141cfe1814b861b07866ca
1 /* A test for # of iterations analysis (signed counter cannot wrap) and final
2 value replacement. */
4 /* { dg-options "-O2 -fdump-tree-optimized" } */
6 int foo(void);
8 int bla(void)
10 int i, n = foo (), j;
12 j = 0;
13 /* The loop should be removed completely. */
14 for (i = 1; i <= n; i++)
15 j += n;
17 /* Should be replaced with return n * n; */
18 return j;
21 /* Since the loop is removed, there should be no addition. */
22 /* { dg-final { scan-tree-dump-times " \\+ " 0 "optimized" } } */
23 /* { dg-final { scan-tree-dump-times " \\* " 1 "optimized" } } */
25 /* The if from the loop header copying remains in the code. */
26 /* { dg-final { scan-tree-dump-times "if " 1 "optimized" } } */