Merge reload-branch up to revision 101000
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-prof / inliner-1.c
blob9a1cd01f337e336a516e08d56564a15f7bb501e8
1 /* { dg-options "-O2 -fdump-tree-optimized -fdump-tree-all" } */
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 if (a)
27 cold_function ();
28 else
29 hot_function ();
30 return 0;
33 /* cold function should be inlined, while hot function should not.
34 Look for "cold_function () [tail call];" call statement not for the
35 declaration or other apperances of the string in dump. */
36 /* { dg-final-use { scan-tree-dump "cold_function ..;" "optimized"} } */
37 /* { dg-final-use { scan-tree-dump-not "hot_function ..;" "optimized"} } */