Adjust scan string for PIE
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-prof / inliner-1.c
blobd95ff6b11260ad5d5392029053b730a437e4544e
1 /* { dg-options "-O2 -fdump-tree-optimized -fgnu89-inline" } */
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 int
25 main ()
27 int i;
28 for (i = 0; i < 100; i++)
30 if (a)
31 cold_function ();
32 else
33 hot_function ();
35 return 0;
38 /* cold function should be inlined, while hot function should not.
39 Look for "cold_function () [tail call];" call statement not for the
40 declaration or other appearances of the string in dump. */
41 /* { dg-final-use { scan-tree-dump "cold_function ..;" "optimized"} } */
42 /* { dg-final-use { scan-tree-dump-not "hot_function ..;" "optimized"} } */
43 /* { dg-final-use { cleanup-tree-dump "optimized" } } */