public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] testsuite: Tweak check_fork_available for CRIS
@ 2023-03-10 22:54 Hans-Peter Nilsson
  0 siblings, 0 replies; only message in thread
From: Hans-Peter Nilsson @ 2023-03-10 22:54 UTC (permalink / raw)
  To: gcc-patches

This takes care of the failing gcc.dg/torture/ftrapv-1.c and
-ftrapv-2.c for cris-elf.

For simplicity, assume simulators are the GNU simulator (in the gdb
repo).  But cris-elf is newlib, so a newlib target forking?  Yes: the
I/O, etc. interface to the simulator uses the Linux/CRIS ABI.

	* lib/target-supports.exp (check_fork_available): Don't signal
	true for CRIS running on a simulator.
---
 gcc/testsuite/lib/target-supports.exp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index a4fbc1998c70..335e24b23b12 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -2880,6 +2880,12 @@ proc check_fork_available {} {
 	# tell as we're doing partial links for kernel modules.
 	return 0
      }    
+    if { [istarget cris-*-*] } {
+	# Compiling and linking works, and an executable running e.g.
+	# gcc.dg/torture/ftrapv-1.c works on now-historical hardware,
+	# but the GNU simulator emits an error for the fork syscall.
+	return [check_effective_target_hw]
+    }
     return [check_function_available "fork"]
 }
 
-- 
2.30.2


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-10 22:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-10 22:54 [committed] testsuite: Tweak check_fork_available for CRIS Hans-Peter Nilsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).