diff options
Diffstat (limited to 'gcc/testsuite/c-c++-common/pr119535.c')
-rw-r--r-- | gcc/testsuite/c-c++-common/pr119535.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/pr119535.c b/gcc/testsuite/c-c++-common/pr119535.c new file mode 100644 index 0000000..fd88cc4 --- /dev/null +++ b/gcc/testsuite/c-c++-common/pr119535.c @@ -0,0 +1,31 @@ +/* PR gcov-profile/119535 +/* { dg-do compile { target musttail } } */ +/* { dg-options "-fprofile-generate -O2" } */ +/* { dg-require-profiling "-fprofile-generate" } */ + +[[gnu::noipa]] int +foo (int x) +{ + return 42 + x; +} + +int +bar (int x) +{ + foo (x); + foo (2); + [[clang::musttail]] return foo (3); +} + +int +baz (int x) +{ + if (x == 42) + return -1; + else if (x == 15) + return 25; + else if (x == 26) + [[clang::musttail]] return foo (4); + else + [[clang::musttail]] return foo (5); +} |