gcc/testsuite/g++.dg/torture/musttail1.C
raw| 1 | // PR ipa/119376 |
| 2 | // { dg-do compile { target musttail } } |
| 3 | // { dg-additional-options "-ffat-lto-objects -fdump-tree-optimized" } |
| 4 | /* { dg-final { scan-tree-dump-times " \[^\n\r]* = foo \\\(\[^\n\r]*\\\); \\\[tail call\\\] \\\[must tail call\\\]" 1 "optimized" } } */ |
| 5 | |
| 6 | struct S { int s; }; |
| 7 | int foo (int); |
| 8 | |
| 9 | int |
| 10 | bar (int a) |
| 11 | { |
| 12 | S b = {a}; |
| 13 | b.s++; |
| 14 | [[gnu::musttail]] return foo (a); |
| 15 | } |