From: Mike Frysinger Date: Sat, 27 Nov 2021 00:30:46 +0000 (-0500) Subject: sim: cris: fix testsuite hang when sim is missing X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4c721b266fdae6e2761cc122fac4cfb42932e295;p=binutils-gdb.git sim: cris: fix testsuite hang when sim is missing 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. --- diff --git a/sim/testsuite/cris/c/c.exp b/sim/testsuite/cris/c/c.exp index bd51d73432f..25d812ea735 100644 --- a/sim/testsuite/cris/c/c.exp +++ b/sim/testsuite/cris/c/c.exp @@ -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) "" diff --git a/sim/testsuite/cris/hw/rv-n-cris/rvc.exp b/sim/testsuite/cris/hw/rv-n-cris/rvc.exp index 42de37d896c..847d906d497 100644 --- a/sim/testsuite/cris/hw/rv-n-cris/rvc.exp +++ b/sim/testsuite/cris/hw/rv-n-cris/rvc.exp @@ -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.