Port revisions 199218 and 207709 from google/gcc-4_8 to bring the function
[official-gcc.git] / main / gcc / testsuite / g++.dg / tree-prof / func_reorder_gold_plugin_3.C
blobf316701c801a2060300dd7a4fbbc9fcb8b122903
1 /* Check if the edge_cutoffp option to the function reordering plugin works as
2    expected.  */
3 /* { dg-require-section-exclude "" } */
4 /* { dg-require-linker-function-reordering-plugin "" } */
5 /* { dg-options "-O2 -freorder-functions=callgraph -ffunction-sections -Wl,-plugin-opt,file=linker.dump -Wl,-plugin-opt,edge_cutoff=p100" } */
7 int __attribute__ ((noinline))
8 foo ()
10   return 1;
13 int main ()
15   int sum = 0;
16   for (int i = 0; i< 1000; i++)
17     {
18       sum += foo ();
19     }
20   return sum - 1000;
23 /* { dg-final-use { scan-file linker.dump "Not considering edge with weight 1000 and below" } }  */
24 /* { dg-final-use { scan-file-not linker.dump "Callgraph group" } }  */
25 /* { dg-final-use { remove-build-file "linker.dump" } }  */