diff options
Diffstat (limited to 'gcc-4.6/gcc/testsuite/g++.dg/tree-prof/callgraph-profiles.C')
-rw-r--r-- | gcc-4.6/gcc/testsuite/g++.dg/tree-prof/callgraph-profiles.C | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc-4.6/gcc/testsuite/g++.dg/tree-prof/callgraph-profiles.C b/gcc-4.6/gcc/testsuite/g++.dg/tree-prof/callgraph-profiles.C new file mode 100644 index 0000000..d958309 --- /dev/null +++ b/gcc-4.6/gcc/testsuite/g++.dg/tree-prof/callgraph-profiles.C @@ -0,0 +1,30 @@ +/* Verify if call-graph profile sections are created + with -fcallgraph-profiles-sections. */ +/* { dg-options "-O2 -fcallgraph-profiles-sections -ffunction-sections --save-temps" } */ +/* { dg-require-section-exclude "" } */ + +int __attribute__ ((noinline)) +foo () +{ + return 1; +} + +int __attribute__ ((noinline)) +bar () +{ + return 0; +} + +int main () +{ + int sum; + for (int i = 0; i< 1000; i++) + { + sum = foo () + bar(); + } + return sum * bar (); +} + +/* { dg-final-use { scan-assembler "\.gnu\.callgraph\.text\.main" } } */ +/* { dg-final-use { scan-assembler "\.string \"1000\"" } } */ +/* { dg-final-use { cleanup-saved-temps } } */ |