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_8.C
blob3f1a0156edc2eedef22aab3441771f0a00bc969f
1 /* Check if unlikely_cutoff works as expected.  Function foo is unlikely because of the cutoff.  */
2 /* { dg-require-section-exclude "" } */
3 /* { dg-require-linker-function-reordering-plugin "" } */
4 /* { dg-options "-O2 -freorder-functions=callgraph -ffunction-sections -Wl,-plugin-opt,file=linker.dump -Wl,-plugin-opt,edge_cutoff=p100,-plugin-opt,unlikely_cutoff=1" } */
6 int __attribute__ ((noinline,section(".text.hot._Z3foov")))
7 foo ()
9   return 0;
12 int main()
14   return foo ();
17 /* { dg-final-use { scan-file-not linker.dump "Callgraph group" } }  */
18 /* { dg-final-use { scan-file linker.dump "=== Unlikely sections start ===\n.*\.text\.hot\._Z3foov.* entry count = 1 computed = 1 max count = 1 split = 0\n.*=== Unlikely sections end ===" } }  */
19 /* { dg-final-use { remove-build-file "linker.dump" } }  */