aboutsummaryrefslogtreecommitdiff
path: root/sim/testsuite
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-11-20 22:46:52 -0500
committerMike Frysinger <vapier@gentoo.org>2021-11-20 23:13:50 -0500
commitbbda248c504815990c07c8a9c411ae6c124d7c4b (patch)
tree4dbceafc3299729a11d188ddb7ba06d82f49cf95 /sim/testsuite
parentc2851b66eb8cb6d486c03e90bedb3403c5b1294e (diff)
downloadgdb-bbda248c504815990c07c8a9c411ae6c124d7c4b.zip
gdb-bbda248c504815990c07c8a9c411ae6c124d7c4b.tar.gz
gdb-bbda248c504815990c07c8a9c411ae6c124d7c4b.tar.bz2
sim: v850: fix cpu_option testsuite handling
The v850 testsuite code has been testing the $opt variable, but this was never actually set anywhere globally or v850-specific. Instead, this was a random variable leaking out of the sh testsuite code. As far as I can tell, it has always been this way. That means the code only ever tested the v850 cpu target (which is the default). This failure can be easily seen in practice by running the v850 code in isolation and seeing it crash: $ runtest v850/allinsns.exp ... Running target unix Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target. Using /usr/share/dejagnu/config/unix.exp as generic interface file for target. Using ../../../sim/testsuite/config/default.exp as tool-and-target-specific interface file. WARNING: Assuming target board is the local machine (which is probably wrong). You may need to set your DEJAGNU environment variable. Running ../../../sim/testsuite/v850/allinsns.exp ... ERROR: tcl error sourcing ../../../sim/testsuite/v850/allinsns.exp. ERROR: tcl error code TCL LOOKUP VARNAME opt ERROR: can't read "opt": no such variable while executing "switch -regexp -- $opt { Backing up a bit, the reason for this logic in the first place is because the common sim testsuite code makes an assumption about the assembler options with cpu_option -- the option and its value are always separated by an =. This is not the case with v850. So tweak the core sim logic a bit to support omitting the = so that we can switch v850 to the standard all_machs setting and avoid opt entirely.
Diffstat (limited to 'sim/testsuite')
-rw-r--r--sim/testsuite/lib/sim-defs.exp8
-rw-r--r--sim/testsuite/v850/allinsns.exp27
2 files changed, 15 insertions, 20 deletions
diff --git a/sim/testsuite/lib/sim-defs.exp b/sim/testsuite/lib/sim-defs.exp
index 0ddc4d5..b3dff9e 100644
--- a/sim/testsuite/lib/sim-defs.exp
+++ b/sim/testsuite/lib/sim-defs.exp
@@ -187,6 +187,7 @@ proc run_sim_test { name requested_machs } {
global SIMFLAGS
global opts
global cpu_option
+ global cpu_option_sep
global global_as_options
global global_ld_options
global global_cc_options
@@ -323,7 +324,12 @@ proc run_sim_test { name requested_machs } {
set as_options "$opts(as,$mach) -I$srcdir/$subdir"
if [info exists cpu_option] {
- set as_options "$as_options $cpu_option=$mach"
+ if ![info exists cpu_option_sep] {
+ set sep "="
+ } {
+ set sep $cpu_option_sep
+ }
+ set as_options "$as_options $cpu_option$sep$mach"
}
regsub {(^ *| +)([^ ]+)} "$as_options $global_as_options" { -Wa,\2} c_as_options
diff --git a/sim/testsuite/v850/allinsns.exp b/sim/testsuite/v850/allinsns.exp
index 93dcffc..2dc8d60 100644
--- a/sim/testsuite/v850/allinsns.exp
+++ b/sim/testsuite/v850/allinsns.exp
@@ -1,19 +1,14 @@
# v850 simulator testsuite.
if [istarget v850*-*] {
- global opt
+ # All machines.
+ # Should add more cpus if the testsuite adds coverage for their insns, but
+ # at the core level, there's no deviation beyond these two.
+ set all_machs "v850e v850"
- # all machines
- switch -regexp -- $opt {
- .*v850e.* {
- set all_machs "v850e"
- }
- default {
- set all_machs "v850"
- }
- }
# gas doesn't support any '=' option for v850.
- #set cpu_option -m
+ set cpu_option_sep ""
+ set cpu_option -m
# The .cgs suffix is for "cgen .s".
foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.cgs]] {
@@ -24,12 +19,6 @@ if [istarget v850*-*] {
}
run_sim_test $src $all_machs
}
-}
-#foreach var [lsort [info globals]] {
-# if [array exists ::$var] {
-# puts [format "%-27s %s" $var Array:]
-# continue
-# }
-# puts [format "%-30s %s" $var "[set ::$var]"]
-#}
+ unset cpu_option cpu_option_sep
+}