public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] sim: testsuite: rename global_sim_options to SIMFLAGS_FOR_TARGET
@ 2021-11-27  0:26 Mike Frysinger
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2021-11-27  0:26 UTC (permalink / raw)
  To: gdb-patches

Now that all the other toolchain settings have been renamed to match
the dejagnu settings of XXX_FOR_TARGET, rename global_sim_options to
SIMFLAGS_FOR_TARGET too.
---
 sim/testsuite/bpf/allinsn.exp           |  6 ++----
 sim/testsuite/cr16/allinsn.exp          | 10 ++--------
 sim/testsuite/cr16/misc.exp             | 10 ++--------
 sim/testsuite/cris/hw/rv-n-cris/rvc.exp | 22 +++++++++-------------
 sim/testsuite/lib/sim-defs.exp          |  8 ++++----
 5 files changed, 19 insertions(+), 37 deletions(-)

diff --git a/sim/testsuite/bpf/allinsn.exp b/sim/testsuite/bpf/allinsn.exp
index c138bb8f18aa..66e76f62fe9a 100644
--- a/sim/testsuite/bpf/allinsn.exp
+++ b/sim/testsuite/bpf/allinsn.exp
@@ -4,10 +4,8 @@ if [istarget bpf-unknown-none] {
     # all machines
     set all_machs "bpf"
 
-    global global_sim_options
-    if ![info exists global_sim_options] {
-	set global_sim_options "--memory-size=4Mb"
-    }
+    global SIMFLAGS_FOR_TARGET
+    set SIMFLAGS_FOR_TARGET "--memory-size=4Mb"
 
     global LDFLAGS_FOR_TARGET
     set LDFLAGS_FOR_TARGET "-Ttext=0x0"
diff --git a/sim/testsuite/cr16/allinsn.exp b/sim/testsuite/cr16/allinsn.exp
index d6602b4c6822..7105a1a8248f 100644
--- a/sim/testsuite/cr16/allinsn.exp
+++ b/sim/testsuite/cr16/allinsn.exp
@@ -4,14 +4,10 @@ if [istarget cr16*-*-*] {
     # all machines
     set all_machs "cr16"
 
-    global global_sim_options
-    if ![info exists global_sim_options] {
-	set global_sim_options ""
-    }
-    set saved_global_sim_options $global_sim_options
+    global SIMFLAGS_FOR_TARGET
     # The cr16 linker sets the default LMA base to 0, and all the code
     # expects the VMA when running, so use that when running the tests.
-    set global_sim_options "$saved_global_sim_options --load-vma"
+    set SIMFLAGS_FOR_TARGET "--load-vma"
 
     # The .cgs suffix is for "cgen .s".
     foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.cgs]] {
@@ -23,6 +19,4 @@ if [istarget cr16*-*-*] {
 
 	run_sim_test $src $all_machs
     }
-
-    set global_sim_options $saved_global_sim_options
 }
diff --git a/sim/testsuite/cr16/misc.exp b/sim/testsuite/cr16/misc.exp
index 5f9d68132b6a..bb1bef3f78bb 100644
--- a/sim/testsuite/cr16/misc.exp
+++ b/sim/testsuite/cr16/misc.exp
@@ -4,14 +4,10 @@ if [istarget cr16*-*-*] {
     # all machines
     set all_machs "cr16"
 
-    global global_sim_options
-    if ![info exists global_sim_options] {
-	set global_sim_options ""
-    }
-    set saved_global_sim_options $global_sim_options
+    global SIMFLAGS_FOR_TARGET
     # The cr16 linker sets the default LMA base to 0, and all the code
     # expects the VMA when running, so use that when running the tests.
-    set global_sim_options "$saved_global_sim_options --load-vma"
+    set SIMFLAGS_FOR_TARGET "--load-vma"
 
     # The .ms suffix is for "miscellaneous .s".
     foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.ms]] {
@@ -23,6 +19,4 @@ if [istarget cr16*-*-*] {
 
 	run_sim_test $src $all_machs
     }
-
-    set global_sim_options $saved_global_sim_options
 }
diff --git a/sim/testsuite/cris/hw/rv-n-cris/rvc.exp b/sim/testsuite/cris/hw/rv-n-cris/rvc.exp
index 82033634e936..5d7126cc6e3f 100644
--- a/sim/testsuite/cris/hw/rv-n-cris/rvc.exp
+++ b/sim/testsuite/cris/hw/rv-n-cris/rvc.exp
@@ -21,7 +21,7 @@
 proc sim_has_rv_and_cris {} {
     global srcdir
     global subdir
-    global global_sim_options
+    global SIMFLAGS_FOR_TARGET
 
     # We need to assemble and link a trivial program and pass that, in
     # order to test successful exit.
@@ -30,8 +30,8 @@ proc sim_has_rv_and_cris {} {
     # what we want to do it to run the simulator without affecting the
     # PASS/FAIL counters, and we can use e.g. run_sim_test for that.
 
-    if ![info exists global_sim_options] {
-        set global_sim_options ""
+    if ![info exists SIMFLAGS_FOR_TARGET] {
+	set SIMFLAGS_FOR_TARGET ""
     }
 
     set comp_output [target_assemble $srcdir/$subdir/quit.s quit.o \
@@ -53,7 +53,7 @@ proc sim_has_rv_and_cris {} {
 
     set result \
 	[sim_run quit.x \
-	     "$global_sim_options --hw-device rv --hw-device cris --hw-info" \
+	     "$SIMFLAGS_FOR_TARGET --hw-device rv --hw-device cris --hw-info" \
 	     "" "" ""]
     set return_code [lindex $result 0]
     set output [lindex $result 1]
@@ -111,10 +111,8 @@ proc slurp_rv { file } {
 if [istarget cris*-*-*] {
     global ASFLAGS_FOR_TARGET
     global LDFLAGS_FOR_TARGET
+    global SIMFLAGS_FOR_TARGET
     set has_rv_and_cris [sim_has_rv_and_cris]
-    global global_sim_options
-
-    set saved_global_sim_options $global_sim_options
 
     # See the logic in sim-defs.exp for more details.
     set sim [board_info target sim]
@@ -156,7 +154,9 @@ if [istarget cris*-*-*] {
 		continue
 	    }
 
-	    set sim_defaults "--hw-file $srcdir/$subdir/std.dev"
+	    # Unfortunately this seems like the only way to pass
+	    # additional sim, ld etc. options to run_sim_test.
+	    set SIMFLAGS_FOR_TARGET "--hw-file $srcdir/$subdir/std.dev"
 	    set LDFLAGS_FOR_TARGET "--section-start=.text=0"
 
 	    # We parse options an extra time besides in run_sim_test,
@@ -171,7 +171,7 @@ if [istarget cris*-*-*] {
 		# Allow concatenating to the default options by
 		# specifying a mach.
 		if { $opt_name == "sim" && $opt_machs == "" } {
-		    set sim_defaults ""
+		    set SIMFLAGS_FOR_TARGET ""
 		}
 	    }
 
@@ -208,11 +208,7 @@ if [istarget cris*-*-*] {
 		set rvdummy_id $spawn_id
 	    }
 
-	    # Unfortunately this seems like the only way to pass
-	    # additional sim, ld etc. options to run_sim_test.
-	    set global_sim_options "$saved_global_sim_options $sim_defaults"
 	    run_sim_test $src $mach
-	    set global_sim_options $saved_global_sim_options
 
 	    # Stop the rvdummy, if it's still running.  We need to
 	    # wait on it anyway to avoid it turning into a zombie.
diff --git a/sim/testsuite/lib/sim-defs.exp b/sim/testsuite/lib/sim-defs.exp
index a9431fc46090..d10246e52385 100644
--- a/sim/testsuite/lib/sim-defs.exp
+++ b/sim/testsuite/lib/sim-defs.exp
@@ -185,7 +185,7 @@ proc run_sim_test { name requested_machs } {
     global opts
     global cpu_option
     global cpu_option_sep
-    global global_sim_options
+    global SIMFLAGS_FOR_TARGET
 
     if ![file exists [sim_tool_path]] {
 	unsupported "$name: missing simulator [sim_tool_path]"
@@ -219,8 +219,8 @@ proc run_sim_test { name requested_machs } {
     set opts(kfail) ""
     set seen_output 0
 
-    if ![info exists global_sim_options] {
-        set global_sim_options ""
+    if ![info exists SIMFLAGS_FOR_TARGET] {
+	set SIMFLAGS_FOR_TARGET ""
     }
 
     # Clear any machine specific options specified in a previous test case
@@ -368,7 +368,7 @@ proc run_sim_test { name requested_machs } {
 	    set options "$options timeout=$opts(timeout)"
 	}
 
-	set result [sim_run ${name}.x "$opts(sim,$mach) $global_sim_options" "$opts(progopts)" "" "$options"]
+	set result [sim_run ${name}.x "$opts(sim,$mach) $SIMFLAGS_FOR_TARGET" "$opts(progopts)" "" "$options"]
 	set return_code [lindex $result 0]
 	set output [lindex $result 1]
 
-- 
2.33.0


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

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

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-27  0:26 [PATCH] sim: testsuite: rename global_sim_options to SIMFLAGS_FOR_TARGET 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).