| 1 |
/* PR ipa/119376 */ |
| 2 |
/* { dg-do compile { target musttail } } */ |
| 3 |
/* { dg-options "-O2 -fdump-tree-optimized" } */ |
| 4 |
/* { dg-final { scan-tree-dump-times " \[^\n\r]* = foo \\\(\[^\n\r]*\\\); \\\[tail call\\\] \\\[must tail call\\\]" 2 "optimized" } } */ |
| 5 |
/* { dg-final { scan-tree-dump-times " \[^\n\r]* = foo \\\(\[^\n\r]*\\\); \\\[tail call\\\]" 4 "optimized" } } */ |
| 6 |
|
| 7 |
int foo (int); |
| 8 |
|
| 9 |
int |
| 10 |
bar (int x) |
| 11 |
{ |
| 12 |
[[gnu::musttail]] return foo (x + 1); |
| 13 |
} |
| 14 |
|
| 15 |
int |
| 16 |
baz (int x) |
| 17 |
{ |
| 18 |
return foo (x + 1); |
| 19 |
} |
| 20 |
|
| 21 |
int |
| 22 |
qux (int x) |
| 23 |
{ |
| 24 |
return foo (x + 2); |
| 25 |
} |
| 26 |
|
| 27 |
int |
| 28 |
corge (int x) |
| 29 |
{ |
| 30 |
[[gnu::musttail]] return foo (x + 2); |
| 31 |
} |