https://gcc.gnu.org/g:1a4aff76a2b104ff0b103c685b6c2ce8006fe6bb

commit r15-9020-g1a4aff76a2b104ff0b103c685b6c2ce8006fe6bb
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Sat Mar 29 00:49:27 2025 +0100

    testsuite: Fix up musttail2.C test
    
    On Wed, Mar 26, 2025 at 10:10:07AM -0700, Andi Kleen wrote:
    > I think this needs to be target external_tailcall, otherwise you will
    > fail on targets that don't support that.
    >
    > Or alternatively make this not extern.
    
    You're right (although I don't remember which targets are
    non-external_musttail).
    
    Here is a patch to define the function.
    
    2025-03-28  Jakub Jelinek  <ja...@redhat.com>
    
            * g++.dg/opt/musttail2.C (foo): Define the function instead of
            just declaring it, add [[gnu::noipa]] attribute to it.

Diff:
---
 gcc/testsuite/g++.dg/opt/musttail2.C | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/g++.dg/opt/musttail2.C 
b/gcc/testsuite/g++.dg/opt/musttail2.C
index ee55c1a18df1..d12fcb2e397d 100644
--- a/gcc/testsuite/g++.dg/opt/musttail2.C
+++ b/gcc/testsuite/g++.dg/opt/musttail2.C
@@ -4,7 +4,12 @@
 // { dg-final { scan-tree-dump-times "  \[^\n\r]* = foo \\\(\[^\n\r]*\\\); 
\\\[tail call\\\] \\\[must tail call\\\]" 1 "optimized" } }
 
 struct S { S () {} };
-char *foo (S);
+
+[[gnu::noipa]] char *
+foo (S)
+{
+  return 0;
+}
 
 char *
 bar (S)

Reply via email to