Jakub Jelinek <[email protected]> writes:
> --- gcc/testsuite/g++.dg/opt/musttail2.C.jj 2025-03-24 13:27:44.329204196
> +0100
> +++ gcc/testsuite/g++.dg/opt/musttail2.C 2025-03-24 13:28:08.975867389
> +0100
> @@ -0,0 +1,14 @@
> +// PR ipa/119376
> +// { dg-do compile { target musttail } }
I think this needs to be target external_tailcall, otherwise you will
fail on targets that don't support that.
> +// { dg-options "-O2 -fno-early-inlining -fdump-tree-optimized" }
> +// { dg-final { scan-tree-dump-times " \[^\n\r]* = foo \\\(\[^\n\r]*\\\);
> \\\[tail call\\\] \\\[must tail call\\\]" 1 "optimized" } }
> +
> +struct S { S () {} };
> +char *foo (S);
Or alternatively make this not extern.
> +
> +char *
> +bar (S)
> +{
> + S t;
> + [[clang::musttail]] return foo (t);
> +}
>
> Jakub