Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.dg / tree-prof / inliner-1.c
blobb5340b56d74913659556745653df9183d9bce86b
1 /* { dg-options "-O2 -fdump-tree-optimized" } */
2 int a;
3 int b[100];
4 void abort (void);
6 inline void
7 cold_function ()
9 int i;
10 for (i = 0; i < 99; i++)
11 if (b[i] / (b[i+1] + 1))
12 abort ();
15 inline void
16 hot_function ()
18 int i;
19 for (i = 0; i < 99; i++)
20 if (b[i] / (b[i+1] + 1))
21 abort ();
24 main ()
26 int i;
27 for (i = 0; i < 100; i++)
29 if (a)
30 cold_function ();
31 else
32 hot_function ();
34 return 0;
37 /* cold function should be inlined, while hot function should not.
38 Look for "cold_function () [tail call];" call statement not for the
39 declaration or other apperances of the string in dump. */
40 /* { dg-final-use { scan-tree-dump "cold_function ..;" "optimized"} } */
41 /* { dg-final-use { scan-tree-dump-not "hot_function ..;" "optimized"} } */
42 /* { dg-final-use { cleanup-tree-dump "optimized" } } */