aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_3.C
blob: f316701c801a2060300dd7a4fbbc9fcb8b122903 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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" } }  */