sim: cris: fix testsuite hang when sim is missing
authorMike Frysinger <vapier@gentoo.org>
Sat, 27 Nov 2021 00:30:46 +0000 (19:30 -0500)
committerMike Frysinger <vapier@gentoo.org>
Sat, 27 Nov 2021 00:37:31 +0000 (19:37 -0500)
If the cris sim hasn't been built yet, trying to run its testsuite
will hang indefinitely.  The common sim APIs already have this, so
copy it over to the cris forks of the test+run functions.

sim/testsuite/cris/c/c.exp
sim/testsuite/cris/hw/rv-n-cris/rvc.exp

index bd51d73432fb0f3bb64f1c49e692ce55da2ab34c..25d812ea7356a7d0a06e289b5ab2d9547e69fbd4 100644 (file)
@@ -94,6 +94,11 @@ foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c]] {
        continue
     }
 
+    if ![file exists [sim_tool_path]] {
+       untested $testname
+       return 0
+    }
+
     # Clear default options
     set opts(cc) ""
     set opts(sim) ""
index 42de37d896cdcccd7743fc0cd89651ff6e705597..847d906d497f769c321a4bfa3bf8b357fef5c06b 100644 (file)
@@ -24,6 +24,10 @@ proc sim_has_rv_and_cris {} {
     global objdir
     global SIMFLAGS_FOR_TARGET
 
+    if ![file exists [sim_tool_path]] {
+       return 0
+    }
+
     # We need to assemble and link a trivial program and pass that, in
     # order to test successful exit.