1 /* { dg-do compile { target { musttail } } } */
2 /* { dg-options "-std=gnu++11" } */
3 /* { dg-additional-options "-fdelayed-branch" { target sparc*-*-* } } */
5 template <class T> T f();
7 double g() { [[gnu::musttail]] return f<int>(); } /* { dg-error "cannot tail-call" } */
10 __attribute__((noinline, noclone, noipa))
11 T g1() { [[gnu::musttail]] return f<T>(); } /* { dg-error "target is not able" "" { target { ! external_musttail } } } */
14 __attribute__((noinline, noclone, noipa))
15 T g2() { [[gnu::musttail]] return f<T>(); } /* { dg-error "target is not able" "" { target { ! external_musttail } } } */
18 __attribute__((noinline, noclone, noipa))
19 /* Would work with -O1. */
20 T g3() { [[gnu::musttail]] return f<T>(); } /* { dg-error "cannot tail-call" } */
23 __attribute__((noinline, noclone, noipa))
24 T g4() { [[gnu::musttail]] return f<double>(); } /* { dg-error "cannot tail-call" } */
31 ~C() { asm("":::"memory"); }