sim: testsuite: replace global_as_options with ASFLAGS_FOR_TARGET

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.
This commit is contained in:
Mike Frysinger
2021-11-21 23:05:32 -05:00
parent f8080fb7a4
commit 0e87783408
4 changed files with 8 additions and 18 deletions

View File

@@ -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

View File

@@ -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"
}

View File

@@ -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

View File

@@ -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" }
}
}