]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/predict-3.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / predict-3.c
CommitLineData
9c04723a
DC
1/* { dg-do compile } */
2/* { dg-options "-O2 -fdump-tree-profile_estimate" } */
3
4extern int global;
5
6int bar(int);
7
8void foo (int bound)
9{
10 int i, ret = 0;
11 for (i = 0; i <= bound; i++)
12 {
13 if (i < bound - 2)
14 global += bar (i);
7fd9012e
RB
15 /* The following test is redundant with the loop bound check in the
16 for stmt and thus eliminated by FRE which makes the controlled
17 stmt always executed and thus equivalent to 100%. Thus the
18 heuristic only applies three times. */
9c04723a
DC
19 if (i <= bound)
20 global += bar (i);
21 if (i + 1 < bound)
22 global += bar (i);
23 if (i != bound)
24 global += bar (i);
25 }
26}
27
a77e3a39 28/* { dg-final { scan-tree-dump-times "guess loop iv compare heuristics of edge\[^:\]*: 64.00%" 3 "profile_estimate"} } */