]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Tweak check_fork_available for CRIS
authorHans-Peter Nilsson <hp@axis.com>
Fri, 10 Mar 2023 18:08:53 +0000 (19:08 +0100)
committerHans-Peter Nilsson <hp@bitrange.com>
Fri, 10 Mar 2023 22:48:22 +0000 (23:48 +0100)
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

index a4fbc1998c708b7f97bff9d3201412cb149d36c9..84ac737152313fb8004762a7fb89ea021fc2adde 100644 (file)
@@ -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"]
 }