PR c/64856
[official-gcc.git] / gcc / testsuite / gcc.dg / predict-5.c
blobf2fe339b6cbc8a7883307f16160e4668df5c1a6d
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-profile_estimate" } */
4 extern int global;
6 int bar (int);
8 void foo (int base, int bound)
10 int i, ret = 0;
11 for (i = base; i <= bound; i++)
13 if (i > base)
14 global += bar (i);
15 if (i > base + 1)
16 global += bar (i);
17 if (i >= base + 3)
18 global += bar (i);
19 if (i - 2 >= base)
20 global += bar (i);
24 /* { dg-final { scan-tree-dump-times "loop iv compare heuristics: 100.0%" 4 "profile_estimate"} } */
25 /* { dg-final { cleanup-tree-dump "profile_estimate" } } */