aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_8.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_8.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_8.C19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_8.C b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_8.C
new file mode 100644
index 000000000..3f1a0156e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_8.C
@@ -0,0 +1,19 @@
+/* Check if unlikely_cutoff works as expected. Function foo is unlikely because of the cutoff. */
+/* { dg-require-section-exclude "" } */
+/* { dg-require-linker-function-reordering-plugin "" } */
+/* { 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" } */
+
+int __attribute__ ((noinline,section(".text.hot._Z3foov")))
+foo ()
+{
+ return 0;
+}
+
+int main()
+{
+ return foo ();
+}
+
+/* { dg-final-use { scan-file-not linker.dump "Callgraph group" } } */
+/* { 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 ===" } } */
+/* { dg-final-use { remove-build-file "linker.dump" } } */