diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_3.C')
-rw-r--r-- | gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_3.C | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_3.C b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_3.C new file mode 100644 index 000000000..f316701c8 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_3.C @@ -0,0 +1,25 @@ +/* Check if the edge_cutoffp option to the function reordering plugin works as + expected. */ +/* { 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" } */ + +int __attribute__ ((noinline)) +foo () +{ + return 1; +} + +int main () +{ + int sum = 0; + for (int i = 0; i< 1000; i++) + { + sum += foo (); + } + return sum - 1000; +} + +/* { dg-final-use { scan-file linker.dump "Not considering edge with weight 1000 and below" } } */ +/* { dg-final-use { scan-file-not linker.dump "Callgraph group" } } */ +/* { dg-final-use { remove-build-file "linker.dump" } } */ |