[PATCH 1/2] ld/testsuite: skip bootstrap.exp when OFILES are missing

Clément Chigot chigot@adacore.com
Thu Sep 15 08:50:19 GMT 2022


OFILES are normally provided through an environment variable set by
Makefiles. However, when launching the testsuite directly through
runtest outside the build tree, it can be hard to retrieve them.
Thus, they can be missing.
Instead of letting tcl raise an error when trying to access this
OFILES variable, skip bootstrap.exp if it doesn't exist.

ld/ChangeLog:

	* testsuite/ld-bootstrap/bootstrap.exp: Skip if OFILES is
	missing
---
 ld/testsuite/ld-bootstrap/bootstrap.exp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/ld/testsuite/ld-bootstrap/bootstrap.exp b/ld/testsuite/ld-bootstrap/bootstrap.exp
index f6d38af5d40..52a91fc554e 100644
--- a/ld/testsuite/ld-bootstrap/bootstrap.exp
+++ b/ld/testsuite/ld-bootstrap/bootstrap.exp
@@ -29,6 +29,12 @@ if ![isnative] {
     return
 }
 
+# Skip if OFILES aren't provided, it can happen when lauching
+# the testsuites outside the build directory.
+if {![info exists OFILES]} {
+    return
+}
+
 # Skip for -fprofile-generate=.
 catch "exec $nm $plug_opt $OFILES" exec_output
 send_log "foo: $exec_output"
-- 
2.25.1



More information about the Binutils mailing list