gcc/testsuite/c-c++-common/pr119616.c
raw| 1 | /* PR tree-optimization/119616 */ |
| 2 | /* { dg-do compile { target external_musttail } } */ |
| 3 | /* { dg-options "-O2" } */ |
| 4 | |
| 5 | int foo (int *); |
| 6 | int bar (int); |
| 7 | |
| 8 | int |
| 9 | baz (int x) |
| 10 | { |
| 11 | if (!x) |
| 12 | [[gnu::musttail]] return bar (x); |
| 13 | return foo (&x); |
| 14 | } |
| 15 | |
| 16 | int |
| 17 | qux (int x) |
| 18 | { |
| 19 | if (!x) |
| 20 | [[gnu::musttail]] return bar (x); |
| 21 | foo (&x); |
| 22 | return 1; |
| 23 | } |