2013-10-17 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / predict-1.c
blob5c9a5a930a5655b3384e126df358cec07081b690
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-profile_estimate" } */
4 extern int global;
6 int bar(int);
8 void foo (int bound)
10 int i, ret = 0;
11 for (i = 0; i < bound; i++)
13 if (i > bound)
14 global += bar (i);
15 if (i >= bound + 2)
16 global += bar (i);
17 if (i > bound - 2)
18 global += bar (i);
19 if (i + 2 > bound)
20 global += bar (i);
21 if (i == 10)
22 global += bar (i);
26 /* { dg-final { scan-tree-dump-times "loop iv compare heuristics: 0.0%" 5 "profile_estimate"} } */
27 /* { dg-final { cleanup-tree-dump "profile_estimate" } } */