aboutsummaryrefslogtreecommitdiff
path: root/sim/testsuite/cr16
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-11-21 03:41:39 -0500
committerMike Frysinger <vapier@gentoo.org>2021-11-26 19:48:05 -0500
commitc0d6a6e5828882040bbb55bafea6b188a18fc000 (patch)
treed8cf4615c587d48caa174be280f30eb622d167b7 /sim/testsuite/cr16
parent4c721b266fdae6e2761cc122fac4cfb42932e295 (diff)
downloadgdb-c0d6a6e5828882040bbb55bafea6b188a18fc000.zip
gdb-c0d6a6e5828882040bbb55bafea6b188a18fc000.tar.gz
gdb-c0d6a6e5828882040bbb55bafea6b188a18fc000.tar.bz2
sim: testsuite: rework sim_init usage
The sim_init function was called by runtest for each test when --tool was set to sim. When we changed to --tool '' to collapse the testsuite dir, the init function was no longer called on every test. However, it was still being called explicitly by config/default.exp. It's not clear why that explicit call ever existed since, in the past, it meant it was redundant. Lets drop the single sim_init call in config/default.exp and move it out to all our tests. This replicates the runtest behavior so we can setup variables on a per-test basis which allows us to recollapse the sim_path logic back. We'll also leverage this in the future for toolchain setup. Also add a few comments clarifying the overall runtime behavior.
Diffstat (limited to 'sim/testsuite/cr16')
-rw-r--r--sim/testsuite/cr16/allinsn.exp2
-rw-r--r--sim/testsuite/cr16/misc.exp2
2 files changed, 4 insertions, 0 deletions
diff --git a/sim/testsuite/cr16/allinsn.exp b/sim/testsuite/cr16/allinsn.exp
index 7105a1a..3f05fb9 100644
--- a/sim/testsuite/cr16/allinsn.exp
+++ b/sim/testsuite/cr16/allinsn.exp
@@ -1,5 +1,7 @@
# CR16 simulator testsuite.
+sim_init
+
if [istarget cr16*-*-*] {
# all machines
set all_machs "cr16"
diff --git a/sim/testsuite/cr16/misc.exp b/sim/testsuite/cr16/misc.exp
index bb1bef3..136b0e7 100644
--- a/sim/testsuite/cr16/misc.exp
+++ b/sim/testsuite/cr16/misc.exp
@@ -1,5 +1,7 @@
# Miscellaneous CR16 simulator testcases
+sim_init
+
if [istarget cr16*-*-*] {
# all machines
set all_machs "cr16"