| 1 |
/* PR tree-optimization/119483 */ |
| 2 |
/* { dg-do compile { target musttail } } */ |
| 3 |
/* { dg-options "-O2 -fdump-tree-optimized" } */ |
| 4 |
/* { dg-final { scan-tree-dump-times "bar\[.a-z0-9]* \\\(\[^\n\r]*\\\); \\\[tail call\\\] \\\[must tail call\\\]" 1 "optimized" } } */ |
| 5 |
/* { dg-final { scan-tree-dump-times "baz \\\(\[^\n\r]*\\\); \\\[tail call\\\] \\\[must tail call\\\]" 1 "optimized" } } */ |
| 6 |
|
| 7 |
[[gnu::noreturn]] extern void foo (void); |
| 8 |
|
| 9 |
[[gnu::noinline]] static int |
| 10 |
bar (int x) |
| 11 |
{ |
| 12 |
(void) x; |
| 13 |
foo (); |
| 14 |
return 0; |
| 15 |
} |
| 16 |
|
| 17 |
[[gnu::noipa]] int |
| 18 |
baz (int x) |
| 19 |
{ |
| 20 |
return x + 42; |
| 21 |
} |
| 22 |
|
| 23 |
int |
| 24 |
qux (int x) |
| 25 |
{ |
| 26 |
if (x == 1) |
| 27 |
[[gnu::musttail]] return bar (1); |
| 28 |
[[gnu::musttail]] return baz (x); |
| 29 |
} |