* [PATCH] sim: testsuite: replace global_as_options with ASFLAGS_FOR_TARGET
@ 2021-11-26 20:06 Mike Frysinger
0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2021-11-26 20:06 UTC (permalink / raw)
To: gdb-patches
Only a few tests actually use global_as_options, but we can replace the
sim-specific settings with the dejagnu common ASFLAGS_FOR_TARGET and get
the same result.
---
sim/testsuite/cris/hw/rv-n-cris/rvc.exp | 7 +------
sim/testsuite/lib/sim-defs.exp | 8 ++------
sim/testsuite/mips/basic.exp | 7 +++----
sim/testsuite/sh/allinsn.exp | 4 ++--
4 files changed, 8 insertions(+), 18 deletions(-)
diff --git a/sim/testsuite/cris/hw/rv-n-cris/rvc.exp b/sim/testsuite/cris/hw/rv-n-cris/rvc.exp
index 24371d96bc42..908d56ab92d9 100644
--- a/sim/testsuite/cris/hw/rv-n-cris/rvc.exp
+++ b/sim/testsuite/cris/hw/rv-n-cris/rvc.exp
@@ -21,7 +21,6 @@
proc sim_has_rv_and_cris {} {
global srcdir
global subdir
- global global_as_options
global global_ld_options
global global_sim_options
@@ -32,9 +31,6 @@ 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_as_options] {
- set global_as_options ""
- }
if ![info exists global_ld_options] {
set global_ld_options ""
}
@@ -43,7 +39,7 @@ proc sim_has_rv_and_cris {} {
}
set comp_output [target_assemble $srcdir/$subdir/quit.s quit.o \
- "-I$srcdir/$subdir $global_as_options"]
+ "-I$srcdir/$subdir"]
if ![string match "" $comp_output] {
verbose -log "$comp_output" 3
@@ -119,7 +115,6 @@ proc slurp_rv { file } {
if [istarget cris*-*-*] {
global ASFLAGS_FOR_TARGET
set has_rv_and_cris [sim_has_rv_and_cris]
- global global_as_options
global global_ld_options
global global_sim_options
diff --git a/sim/testsuite/lib/sim-defs.exp b/sim/testsuite/lib/sim-defs.exp
index 91b8b5a7b101..68fe2ef3324a 100644
--- a/sim/testsuite/lib/sim-defs.exp
+++ b/sim/testsuite/lib/sim-defs.exp
@@ -185,7 +185,6 @@ proc run_sim_test { name requested_machs } {
global opts
global cpu_option
global cpu_option_sep
- global global_as_options
global global_ld_options
global global_sim_options
@@ -221,9 +220,6 @@ proc run_sim_test { name requested_machs } {
set opts(kfail) ""
set seen_output 0
- if ![info exists global_as_options] {
- set global_as_options ""
- }
if ![info exists global_ld_options] {
set global_ld_options ""
}
@@ -324,7 +320,7 @@ proc run_sim_test { name requested_machs } {
}
set as_options "$as_options $cpu_option$sep$mach"
}
- regsub {(^ *| +)([^ ]+)} "$as_options $global_as_options" { -Wa,\2} c_as_options
+ regsub {(^ *| +)([^ ]+)} "$as_options" { -Wa,\2} c_as_options
if ![info exists opts(ld,$mach)] {
set opts(ld,$mach) $opts(ld)
@@ -345,7 +341,7 @@ proc run_sim_test { name requested_machs } {
[list "incdir=$srcdir/$subdir" "additional_flags=$c_as_options"]]
set method "compiling"
} else {
- set comp_output [target_assemble $sourcefile ${name}.o "$as_options $global_as_options"]
+ set comp_output [target_assemble $sourcefile ${name}.o "$as_options"]
set method "assembling"
}
diff --git a/sim/testsuite/mips/basic.exp b/sim/testsuite/mips/basic.exp
index 352b3b4e7193..ff96a683589b 100644
--- a/sim/testsuite/mips/basic.exp
+++ b/sim/testsuite/mips/basic.exp
@@ -27,11 +27,10 @@ proc run_hilo_test {testfile models nops} {
# Runs micromips tests by adding -mmicromips to as options
proc run_micromips_test { name requested_machs } {
- global global_as_options;
- set gas_old $global_as_options;
- append global_as_options " -mmicromips "
+ global ASFLAGS_FOR_TARGET
+ set ASFLAGS_FOR_TARGET "-mmicromips"
run_sim_test $name $requested_machs
- set global_as_options $gas_old
+ unset ASFLAGS_FOR_TARGET
}
# Runs all specified tests
diff --git a/sim/testsuite/sh/allinsn.exp b/sim/testsuite/sh/allinsn.exp
index ef2c59f23013..233cd9a6ff99 100644
--- a/sim/testsuite/sh/allinsn.exp
+++ b/sim/testsuite/sh/allinsn.exp
@@ -2,12 +2,12 @@
set all_machs "sh shdsp"
-set global_as_options ""
+global ASFLAGS_FOR_TARGET
set global_ld_options ""
foreach opt $board_variant_list {
switch "x$opt" {
- x-ml { set global_as_options "-little --defsym LITTLE=1"
+ x-ml { set ASFLAGS_FOR_TARGET "-little --defsym LITTLE=1"
set global_ld_options "-EL" }
}
}
--
2.33.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-11-26 20:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-26 20:06 [PATCH] sim: testsuite: replace global_as_options with ASFLAGS_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).