diff options
Diffstat (limited to 'gcc/testsuite/c-c++-common/musttail27.c')
-rw-r--r-- | gcc/testsuite/c-c++-common/musttail27.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/musttail27.c b/gcc/testsuite/c-c++-common/musttail27.c new file mode 100644 index 0000000..2a92bcb --- /dev/null +++ b/gcc/testsuite/c-c++-common/musttail27.c @@ -0,0 +1,31 @@ +/* PR ipa/119376 */ +/* { dg-do compile { target musttail } } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ +/* { dg-final { scan-tree-dump-times " \[^\n\r]* = foo \\\(\[^\n\r]*\\\); \\\[tail call\\\] \\\[must tail call\\\]" 2 "optimized" } } */ +/* { dg-final { scan-tree-dump-times " \[^\n\r]* = foo \\\(\[^\n\r]*\\\); \\\[tail call\\\]" 4 "optimized" } } */ + +int foo (int); + +int +bar (int x) +{ + [[gnu::musttail]] return foo (x + 1); +} + +int +baz (int x) +{ + return foo (x + 1); +} + +int +qux (int x) +{ + return foo (x + 2); +} + +int +corge (int x) +{ + [[gnu::musttail]] return foo (x + 2); +} |