[3/3] testsuite: Gate gcc.dg/plugin/must-tail-call-1.c and -2.c on tail_call

Message ID 20230306185008.538C7203D7@pchp3.se.axis.com
State Unresolved
Headers
Series [1/3] testsuite: Add tail_call effective target |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Hans-Peter Nilsson March 6, 2023, 6:50 p.m. UTC
  Borderline obvious when tail_call is available, so I'll then apply.
-- >8 --
While gcc.dg/plugin/must-tail-call-2.c passes for all targets even
without this, the error message is, for a target like cris-elf that
doesn't implement sibling calls: "error: cannot tail-call: machine
description does not have a sibcall_epilogue instruction pattern"
rather than "error: cannot tail-call: callee returns a structure".
Also, it'd be confusing to exclude must-tail-call-1.c but not
must-tail-call-2.c

	* gcc.dg/plugin/must-tail-call-1.c, gcc.dg/plugin/must-tail-call-2.c:
	Gate on effective target tail_call.
---
 gcc/testsuite/gcc.dg/plugin/must-tail-call-1.c | 1 +
 gcc/testsuite/gcc.dg/plugin/must-tail-call-2.c | 1 +
 2 files changed, 2 insertions(+)
  

Patch

diff --git a/gcc/testsuite/gcc.dg/plugin/must-tail-call-1.c b/gcc/testsuite/gcc.dg/plugin/must-tail-call-1.c
index 1495a48232a6..3a6d4cceaba7 100644
--- a/gcc/testsuite/gcc.dg/plugin/must-tail-call-1.c
+++ b/gcc/testsuite/gcc.dg/plugin/must-tail-call-1.c
@@ -1,3 +1,4 @@ 
+/* { dg-do compile { target tail_call } } */
 /* { dg-options "-fdelayed-branch" { target sparc*-*-* } } */
 
 extern void abort (void);
diff --git a/gcc/testsuite/gcc.dg/plugin/must-tail-call-2.c b/gcc/testsuite/gcc.dg/plugin/must-tail-call-2.c
index c6dfecd32458..d51d15cc0879 100644
--- a/gcc/testsuite/gcc.dg/plugin/must-tail-call-2.c
+++ b/gcc/testsuite/gcc.dg/plugin/must-tail-call-2.c
@@ -1,3 +1,4 @@ 
+/* { dg-do compile { target tail_call } } */
 /* Allow nested functions.  */
 /* { dg-options "-Wno-pedantic" } */