public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] sim: testsuite: clean up arch specific toolchain settings
@ 2021-11-27  7:56 Mike Frysinger
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2021-11-27  7:56 UTC (permalink / raw)
  To: gdb-patches

In a multitarget build, we process all targets in order, so make sure
the toolchain settings from one don't leak into the next.
---
 sim/testsuite/example-synacor/allinsn.exp |  2 --
 sim/testsuite/lib/sim-defs.exp            | 14 ++++++++++++++
 sim/testsuite/v850/allinsns.exp           |  2 --
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/sim/testsuite/example-synacor/allinsn.exp b/sim/testsuite/example-synacor/allinsn.exp
index 2f1fc74d239e..07401ced9bb4 100644
--- a/sim/testsuite/example-synacor/allinsn.exp
+++ b/sim/testsuite/example-synacor/allinsn.exp
@@ -17,6 +17,4 @@ if [istarget *] {
 	}
 	run_sim_test $src $all_machs
     }
-
-    unset LDFLAGS_FOR_TARGET
 }
diff --git a/sim/testsuite/lib/sim-defs.exp b/sim/testsuite/lib/sim-defs.exp
index 535f76cbae34..fca66af26a86 100644
--- a/sim/testsuite/lib/sim-defs.exp
+++ b/sim/testsuite/lib/sim-defs.exp
@@ -46,10 +46,24 @@ proc sim_init { args } {
 proc sim_init_toolchain {} {
     global objdir
     global srcdir
+    global cpu_option
+    global cpu_option_sep
+    global ASFLAGS_FOR_TARGET
+    global CFLAGS_FOR_TARGET
+    global LDFLAGS_FOR_TARGET
+    global SIMFLAGS_FOR_TARGET
     global global_cpp_works
     global global_cc_works
     global global_cc_os
 
+    # Reset all the toolchain settings.  This provides a clean slate when
+    # starting the next set of tests.
+    set ASFLAGS_FOR_TARGET ""
+    set CFLAGS_FOR_TARGET ""
+    set LDFLAGS_FOR_TARGET ""
+    set SIMFLAGS_FOR_TARGET ""
+    unset -nocomplain cpu_option cpu_option_sep
+
     # See if we have a preprocessor available.
     set result [target_compile $srcdir/lib/compilercheck.c \
 		$objdir/compilercheck.x "preprocess" ""]
diff --git a/sim/testsuite/v850/allinsns.exp b/sim/testsuite/v850/allinsns.exp
index c4c15b066f81..f2a43cab1d36 100644
--- a/sim/testsuite/v850/allinsns.exp
+++ b/sim/testsuite/v850/allinsns.exp
@@ -21,6 +21,4 @@ if [istarget v850*-*] {
 	}
 	run_sim_test $src $all_machs
     }
-
-    unset cpu_option cpu_option_sep
 }
-- 
2.33.0


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

only message in thread, other threads:[~2021-11-27  7:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-27  7:56 [PATCH] sim: testsuite: clean up arch specific toolchain settings Mike Frysinger

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).