* [PATCH 1/3] sim: testsuite: calculate $arch from $subdir
@ 2021-04-04 14:35 Mike Frysinger
2021-04-04 14:35 ` [PATCH 2/3] sim: testsuite: skip tests when the port is disabled Mike Frysinger
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Mike Frysinger @ 2021-04-04 14:35 UTC (permalink / raw)
To: gdb-patches
Since we require ports to use a matching subdir name in the testsuite
tree, we can use that to calculate the $arch value.
---
sim/testsuite/aarch64/allinsn.exp | 4 ----
sim/testsuite/arm/allinsn.exp | 4 ----
sim/testsuite/arm/iwmmxt/iwmmxt.exp | 4 ----
sim/testsuite/arm/misc.exp | 4 ----
sim/testsuite/arm/thumb/allthumb.exp | 4 ----
sim/testsuite/arm/xscale/xscale.exp | 4 ----
sim/testsuite/avr/allinsn.exp | 4 ----
sim/testsuite/bfin/allinsn.exp | 4 ----
sim/testsuite/bpf/allinsn.exp | 4 ----
sim/testsuite/cr16/allinsn.exp | 4 ----
sim/testsuite/cr16/misc.exp | 4 ----
sim/testsuite/cris/asm/asm.exp | 4 ----
sim/testsuite/cris/c/c.exp | 4 ----
sim/testsuite/cris/hw/rv-n-cris/rvc.exp | 7 +-----
sim/testsuite/d10v/allinsn.exp | 4 ----
sim/testsuite/example-synacor/allinsn.exp | 4 ----
sim/testsuite/frv/allinsn.exp | 4 ----
sim/testsuite/frv/fr400/allinsn.exp | 4 ----
sim/testsuite/frv/fr500/allinsn.exp | 4 ----
sim/testsuite/frv/fr550/allinsn.exp | 4 ----
sim/testsuite/frv/interrupts.exp | 4 ----
sim/testsuite/frv/misc.exp | 4 ----
sim/testsuite/frv/parallel.exp | 4 ----
sim/testsuite/ft32/allinsn.exp | 4 ----
sim/testsuite/h8300/allinsn.exp | 4 ----
sim/testsuite/iq2000/allinsn.exp | 4 ----
sim/testsuite/lib/sim-defs.exp | 27 ++++++++++++++---------
sim/testsuite/lm32/allinsn.exp | 4 ----
sim/testsuite/m32c/allinsn.exp | 4 ----
sim/testsuite/m32r/allinsn.exp | 4 ----
sim/testsuite/m32r/misc.exp | 4 ----
sim/testsuite/m68hc11/allinsn.exp | 4 ----
sim/testsuite/mcore/allinsn.exp | 4 ----
sim/testsuite/microblaze/allinsn.exp | 4 ----
sim/testsuite/mips/basic.exp | 4 ----
sim/testsuite/mn10300/allinsn.exp | 4 ----
sim/testsuite/moxie/allinsn.exp | 4 ----
sim/testsuite/msp430/allinsn.exp | 4 ----
sim/testsuite/or1k/alltests.exp | 4 ----
sim/testsuite/pru/allinsn.exp | 4 ----
sim/testsuite/riscv/allinsn.exp | 4 ----
sim/testsuite/sh/allinsn.exp | 4 ----
sim/testsuite/v850/allinsns.exp | 4 ----
43 files changed, 18 insertions(+), 180 deletions(-)
diff --git a/sim/testsuite/aarch64/allinsn.exp b/sim/testsuite/aarch64/allinsn.exp
index 04a234f53577..54d64784c230 100644
--- a/sim/testsuite/aarch64/allinsn.exp
+++ b/sim/testsuite/aarch64/allinsn.exp
@@ -1,10 +1,6 @@
# AArch64 simulator testsuite
if [istarget aarch64*-*] {
- # Used to locate the `run` program.
- global arch
- set arch "aarch64"
-
# all machines
set all_machs "aarch64"
diff --git a/sim/testsuite/arm/allinsn.exp b/sim/testsuite/arm/allinsn.exp
index 89ff96594793..c4d1ccecc3c6 100644
--- a/sim/testsuite/arm/allinsn.exp
+++ b/sim/testsuite/arm/allinsn.exp
@@ -1,10 +1,6 @@
# ARM simulator testsuite.
if { [istarget arm*-*-*] } {
- # Used to locate the `run` program.
- global arch
- set arch "arm"
-
# all machines
set all_machs "xscale"
diff --git a/sim/testsuite/arm/iwmmxt/iwmmxt.exp b/sim/testsuite/arm/iwmmxt/iwmmxt.exp
index 9710f3670ba7..4aff9c7d0287 100644
--- a/sim/testsuite/arm/iwmmxt/iwmmxt.exp
+++ b/sim/testsuite/arm/iwmmxt/iwmmxt.exp
@@ -1,10 +1,6 @@
# Intel(r) Wireless MMX(tm) technology simulator testsuite.
if { [istarget arm*-*-*] } {
- # Used to locate the `run` program.
- global arch
- set arch "arm"
-
# all machines
set all_machs "xscale"
diff --git a/sim/testsuite/arm/misc.exp b/sim/testsuite/arm/misc.exp
index ea6fd3c3c9a0..818ee58adec3 100644
--- a/sim/testsuite/arm/misc.exp
+++ b/sim/testsuite/arm/misc.exp
@@ -1,10 +1,6 @@
# Miscellaneous ARM simulator testcases
if { [istarget arm*-*-*] } {
- # Used to locate the `run` program.
- global arch
- set arch "arm"
-
# all machines
set all_machs "arm7tdmi"
diff --git a/sim/testsuite/arm/thumb/allthumb.exp b/sim/testsuite/arm/thumb/allthumb.exp
index eca5fa18c719..ec09a0da8294 100644
--- a/sim/testsuite/arm/thumb/allthumb.exp
+++ b/sim/testsuite/arm/thumb/allthumb.exp
@@ -1,10 +1,6 @@
# ARM simulator testsuite.
if { [istarget arm*-*-*] } {
- # Used to locate the `run` program.
- global arch
- set arch "arm"
-
# all machines
set all_machs "arm7tdmi"
diff --git a/sim/testsuite/arm/xscale/xscale.exp b/sim/testsuite/arm/xscale/xscale.exp
index 20c9df80351c..e65a952dadb0 100644
--- a/sim/testsuite/arm/xscale/xscale.exp
+++ b/sim/testsuite/arm/xscale/xscale.exp
@@ -1,10 +1,6 @@
# XSCALE simulator testsuite.
if { [istarget arm*-*-*] } {
- # Used to locate the `run` program.
- global arch
- set arch "arm"
-
# all machines
set all_machs "xscale"
diff --git a/sim/testsuite/avr/allinsn.exp b/sim/testsuite/avr/allinsn.exp
index a5c16b629b76..584a93da9305 100644
--- a/sim/testsuite/avr/allinsn.exp
+++ b/sim/testsuite/avr/allinsn.exp
@@ -1,10 +1,6 @@
# avr simulator testsuite
if [istarget avr-*] {
- # Used to locate the `run` program.
- global arch
- set arch "avr"
-
# all machines
set all_machs "avr"
diff --git a/sim/testsuite/bfin/allinsn.exp b/sim/testsuite/bfin/allinsn.exp
index 3d3378171c6d..aa304eaa9b4a 100644
--- a/sim/testsuite/bfin/allinsn.exp
+++ b/sim/testsuite/bfin/allinsn.exp
@@ -1,10 +1,6 @@
# Analog Devices Blackfin simulator testsuite
if [istarget bfin-*-elf] {
- # Used to locate the `run` program.
- global arch
- set arch "bfin"
-
# all machines
set all_machs "bfin"
diff --git a/sim/testsuite/bpf/allinsn.exp b/sim/testsuite/bpf/allinsn.exp
index ffffd8a68928..2cca77021afe 100644
--- a/sim/testsuite/bpf/allinsn.exp
+++ b/sim/testsuite/bpf/allinsn.exp
@@ -1,10 +1,6 @@
# eBPF simulator testsuite
if [istarget bpf-unknown-none] {
- # Used to locate the `run` program.
- global arch
- set arch "bpf"
-
# all machines
set all_machs "bpf"
diff --git a/sim/testsuite/cr16/allinsn.exp b/sim/testsuite/cr16/allinsn.exp
index 1b6847c78150..d6602b4c6822 100644
--- a/sim/testsuite/cr16/allinsn.exp
+++ b/sim/testsuite/cr16/allinsn.exp
@@ -1,10 +1,6 @@
# CR16 simulator testsuite.
if [istarget cr16*-*-*] {
- # Used to locate the `run` program.
- global arch
- set arch "cr16"
-
# all machines
set all_machs "cr16"
diff --git a/sim/testsuite/cr16/misc.exp b/sim/testsuite/cr16/misc.exp
index 67fa4c2d7d38..5f9d68132b6a 100644
--- a/sim/testsuite/cr16/misc.exp
+++ b/sim/testsuite/cr16/misc.exp
@@ -1,10 +1,6 @@
# Miscellaneous CR16 simulator testcases
if [istarget cr16*-*-*] {
- # Used to locate the `run` program.
- global arch
- set arch "cr16"
-
# all machines
set all_machs "cr16"
diff --git a/sim/testsuite/cris/asm/asm.exp b/sim/testsuite/cris/asm/asm.exp
index b8c14c8d05cb..415bbf1082a9 100644
--- a/sim/testsuite/cris/asm/asm.exp
+++ b/sim/testsuite/cris/asm/asm.exp
@@ -16,10 +16,6 @@
# Miscellaneous CRIS simulator testcases in assembly code.
if [istarget cris*-*-*] {
- # Used to locate the `run` program.
- global arch
- set arch "cris"
-
global ASFLAGS_FOR_TARGET
# All machines we test and the corresponding assembler option. Needs
# update if we build the simulator for crisv0 crisv3 and crisv8 too.
diff --git a/sim/testsuite/cris/c/c.exp b/sim/testsuite/cris/c/c.exp
index 3d493b7c1449..08ea18812ec5 100644
--- a/sim/testsuite/cris/c/c.exp
+++ b/sim/testsuite/cris/c/c.exp
@@ -19,10 +19,6 @@ if ![istarget cris*-*-*] {
return
}
-# Used to locate the `run` program.
-global arch
-set arch "cris"
-
set CFLAGS_FOR_TARGET "-O2"
if [istarget cris-*-*] {
set mach "crisv10"
diff --git a/sim/testsuite/cris/hw/rv-n-cris/rvc.exp b/sim/testsuite/cris/hw/rv-n-cris/rvc.exp
index 0a018fa4b881..4e302d2238fb 100644
--- a/sim/testsuite/cris/hw/rv-n-cris/rvc.exp
+++ b/sim/testsuite/cris/hw/rv-n-cris/rvc.exp
@@ -112,10 +112,6 @@ proc slurp_rv { file } {
# The main test loop.
if [istarget cris*-*-*] {
- # Used to locate the `run` program.
- global arch
- set arch "cris"
-
global ASFLAGS_FOR_TARGET
set has_rv_and_cris [sim_has_rv_and_cris]
global global_as_options
@@ -129,8 +125,7 @@ if [istarget cris*-*-*] {
set sim [board_info target sim]
if [string equal "" $sim] {
global objdir
- global arch
- set rvdummy "$objdir/../$arch/rvdummy"
+ set rvdummy "$objdir/cris/rvdummy"
} else {
set rvdummy "[file dirname [board_info target sim]]/rvdummy"
}
diff --git a/sim/testsuite/d10v/allinsn.exp b/sim/testsuite/d10v/allinsn.exp
index e2e44a290920..5f1a13177f14 100644
--- a/sim/testsuite/d10v/allinsn.exp
+++ b/sim/testsuite/d10v/allinsn.exp
@@ -1,10 +1,6 @@
# d10v simulator testsuite.
if [istarget d10v*-*] {
- # Used to locate the `run` program.
- global arch
- set arch "d10v"
-
# all machines
set all_machs "d10v"
diff --git a/sim/testsuite/example-synacor/allinsn.exp b/sim/testsuite/example-synacor/allinsn.exp
index 7210a610e737..a73312b8adfb 100644
--- a/sim/testsuite/example-synacor/allinsn.exp
+++ b/sim/testsuite/example-synacor/allinsn.exp
@@ -1,10 +1,6 @@
# Example synacor simulator testsuite.
if [istarget *] {
- # Used to locate the `run` program.
- global arch
- set arch "example-synacor"
-
# All machines.
set all_machs "example"
diff --git a/sim/testsuite/frv/allinsn.exp b/sim/testsuite/frv/allinsn.exp
index 2633f30df567..1781bf0ed170 100644
--- a/sim/testsuite/frv/allinsn.exp
+++ b/sim/testsuite/frv/allinsn.exp
@@ -1,10 +1,6 @@
# FRV simulator testsuite.
if [istarget frv*-*] {
- # Used to locate the `run` program.
- global arch
- set arch "frv"
-
# all machines
set all_machs "frv fr500 fr550 fr400 fr405 fr450"
set cpu_option -mcpu
diff --git a/sim/testsuite/frv/fr400/allinsn.exp b/sim/testsuite/frv/fr400/allinsn.exp
index ea5846f8fa42..03ccbd6e8aba 100644
--- a/sim/testsuite/frv/fr400/allinsn.exp
+++ b/sim/testsuite/frv/fr400/allinsn.exp
@@ -1,10 +1,6 @@
# FRV simulator testsuite.
if [istarget frv*-*] {
- # Used to locate the `run` program.
- global arch
- set arch "frv"
-
# all machines
set all_machs "fr400 fr405 fr450 fr550"
set cpu_option -mcpu
diff --git a/sim/testsuite/frv/fr500/allinsn.exp b/sim/testsuite/frv/fr500/allinsn.exp
index 40caa6307060..fa03797d39ce 100644
--- a/sim/testsuite/frv/fr500/allinsn.exp
+++ b/sim/testsuite/frv/fr500/allinsn.exp
@@ -1,10 +1,6 @@
# FRV simulator testsuite.
if [istarget frv*-*] {
- # Used to locate the `run` program.
- global arch
- set arch "frv"
-
# all machines
set all_machs "frv fr500 fr550"
set cpu_option -mcpu
diff --git a/sim/testsuite/frv/fr550/allinsn.exp b/sim/testsuite/frv/fr550/allinsn.exp
index 8768a6719946..c0e373aa2672 100644
--- a/sim/testsuite/frv/fr550/allinsn.exp
+++ b/sim/testsuite/frv/fr550/allinsn.exp
@@ -1,10 +1,6 @@
# FRV simulator testsuite.
if [istarget frv*-*] {
- # Used to locate the `run` program.
- global arch
- set arch "frv"
-
# all machines
set all_machs "fr550"
set cpu_option -mcpu
diff --git a/sim/testsuite/frv/interrupts.exp b/sim/testsuite/frv/interrupts.exp
index d1f7628d962d..6b2c84a629ad 100644
--- a/sim/testsuite/frv/interrupts.exp
+++ b/sim/testsuite/frv/interrupts.exp
@@ -1,10 +1,6 @@
# FRV simulator testsuite.
if [istarget frv*-*] {
- # Used to locate the `run` program.
- global arch
- set arch "frv"
-
# all machines
set all_machs "frv fr500 fr550 fr400"
set cpu_option -mcpu
diff --git a/sim/testsuite/frv/misc.exp b/sim/testsuite/frv/misc.exp
index d9c80a546000..fb394bb17f00 100644
--- a/sim/testsuite/frv/misc.exp
+++ b/sim/testsuite/frv/misc.exp
@@ -1,10 +1,6 @@
# Miscellaneous FRV simulator testcases.
if [istarget frv*-*] {
- # Used to locate the `run` program.
- global arch
- set arch "frv"
-
# all machines
set all_machs "frv fr500 fr550 fr400 fr405 fr450"
set cpu_option -mcpu
diff --git a/sim/testsuite/frv/parallel.exp b/sim/testsuite/frv/parallel.exp
index a883b9891d5d..612a1bfd9e14 100644
--- a/sim/testsuite/frv/parallel.exp
+++ b/sim/testsuite/frv/parallel.exp
@@ -1,10 +1,6 @@
# FRV simulator testsuite.
if [istarget frv*-*] {
- # Used to locate the `run` program.
- global arch
- set arch "frv"
-
# all machines
set all_machs "frv fr500 fr550 fr400"
set cpu_option -mcpu
diff --git a/sim/testsuite/ft32/allinsn.exp b/sim/testsuite/ft32/allinsn.exp
index 50827a592473..730b4223632d 100644
--- a/sim/testsuite/ft32/allinsn.exp
+++ b/sim/testsuite/ft32/allinsn.exp
@@ -1,10 +1,6 @@
# ft32 simulator testsuite
if [istarget ft32-*] {
- # Used to locate the `run` program.
- global arch
- set arch "ft32"
-
# all machines
set all_machs "ft32"
diff --git a/sim/testsuite/h8300/allinsn.exp b/sim/testsuite/h8300/allinsn.exp
index 5355bf58a69d..68468f6bb106 100644
--- a/sim/testsuite/h8300/allinsn.exp
+++ b/sim/testsuite/h8300/allinsn.exp
@@ -1,10 +1,6 @@
# Hitachi H8/300 (h, s, sx) simulator testsuite
if {[istarget h8300*-*-*] || [istarget h8sx*-*-*]} then {
- # Used to locate the `run` program.
- global arch
- set arch "h8300"
-
set all_machs "h8300 h8300h h8300s h8sx"
foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.s]] {
diff --git a/sim/testsuite/iq2000/allinsn.exp b/sim/testsuite/iq2000/allinsn.exp
index 96d58435fb45..38eee9b277f1 100644
--- a/sim/testsuite/iq2000/allinsn.exp
+++ b/sim/testsuite/iq2000/allinsn.exp
@@ -1,10 +1,6 @@
# iq2000 simulator testsuite
if [istarget iq2000-*] {
- # Used to locate the `run` program.
- global arch
- set arch "iq2000"
-
# all machines
set all_machs "iq2000"
diff --git a/sim/testsuite/lib/sim-defs.exp b/sim/testsuite/lib/sim-defs.exp
index e1254a3278cf..1b40216ea6ed 100644
--- a/sim/testsuite/lib/sim-defs.exp
+++ b/sim/testsuite/lib/sim-defs.exp
@@ -48,6 +48,22 @@ proc sim_compile { source dest type options } {
return $result
}
+# Find the path to the simulator for executing.
+proc sim_tool_path {} {
+ global sim_path
+ set sim "$sim_path"
+ if [string equal "" $sim] {
+ global objdir
+ global subdir
+ set arch "$subdir"
+ while { [file dirname $arch] != "." } {
+ set arch [file dirname $arch]
+ }
+ return "$objdir/$arch/run"
+ }
+ return "$sim"
+}
+
# Run a program on the simulator.
# Required by dejagnu (at least ${tool}_run used to be).
#
@@ -98,16 +114,7 @@ proc sim_run { prog sim_opts prog_opts redir options } {
verbose "testcase timeout is set to $testcase_timeout" 1
- set sim [board_info target sim]
- if [string equal "" $sim] {
- # Special case the simulator. These tests are designed to
- # be run inside of the simulator, not on the native host.
- # So if the sim target isn't set, default to the target run.
- # These global variables come from generated site.exp.
- global objdir
- global arch
- set sim "$objdir/$arch/run"
- }
+ set sim [sim_tool_path]
if [is_remote host] {
set prog [remote_download host $prog]
diff --git a/sim/testsuite/lm32/allinsn.exp b/sim/testsuite/lm32/allinsn.exp
index ae7c141bd643..61744985f6c8 100644
--- a/sim/testsuite/lm32/allinsn.exp
+++ b/sim/testsuite/lm32/allinsn.exp
@@ -1,10 +1,6 @@
# lm32 simulator testsuite
if [istarget lm32-*] {
- # Used to locate the `run` program.
- global arch
- set arch "lm32"
-
# all machines
set all_machs "lm32"
diff --git a/sim/testsuite/m32c/allinsn.exp b/sim/testsuite/m32c/allinsn.exp
index b09b505972a3..fb5ccca282e1 100644
--- a/sim/testsuite/m32c/allinsn.exp
+++ b/sim/testsuite/m32c/allinsn.exp
@@ -2,10 +2,6 @@
# TODO: Add support for .c tests.
if [istarget m32c*-*-*] {
- # Used to locate the `run` program.
- global arch
- set arch "m32c"
-
# all machines
set all_machs "m32c"
diff --git a/sim/testsuite/m32r/allinsn.exp b/sim/testsuite/m32r/allinsn.exp
index a800e78b1b46..17a86189f79f 100644
--- a/sim/testsuite/m32r/allinsn.exp
+++ b/sim/testsuite/m32r/allinsn.exp
@@ -1,10 +1,6 @@
# M32R simulator testsuite.
if [istarget m32r*-*-*] {
- # Used to locate the `run` program.
- global arch
- set arch "m32r"
-
# all machines
set all_machs "m32r"
diff --git a/sim/testsuite/m32r/misc.exp b/sim/testsuite/m32r/misc.exp
index e571c2eeb69d..6c624e737e74 100644
--- a/sim/testsuite/m32r/misc.exp
+++ b/sim/testsuite/m32r/misc.exp
@@ -1,10 +1,6 @@
# Miscellaneous M32R simulator testcases
if [istarget m32r*-*-*] {
- # Used to locate the `run` program.
- global arch
- set arch "m32r"
-
# all machines
set all_machs "m32r"
diff --git a/sim/testsuite/m68hc11/allinsn.exp b/sim/testsuite/m68hc11/allinsn.exp
index 0e9b51ec5934..db0cbd5d4670 100644
--- a/sim/testsuite/m68hc11/allinsn.exp
+++ b/sim/testsuite/m68hc11/allinsn.exp
@@ -1,10 +1,6 @@
# m68hc11 simulator testsuite
if [istarget m68hc11-*] {
- # Used to locate the `run` program.
- global arch
- set arch "m68hc11"
-
# all machines
set all_machs "m68hc11"
diff --git a/sim/testsuite/mcore/allinsn.exp b/sim/testsuite/mcore/allinsn.exp
index ecc934b20146..5921cfc26431 100644
--- a/sim/testsuite/mcore/allinsn.exp
+++ b/sim/testsuite/mcore/allinsn.exp
@@ -1,10 +1,6 @@
# mcore simulator testsuite
if [istarget mcore-*] {
- # Used to locate the `run` program.
- global arch
- set arch "mcore"
-
# all machines
set all_machs "mcore"
diff --git a/sim/testsuite/microblaze/allinsn.exp b/sim/testsuite/microblaze/allinsn.exp
index 5f5a4475eed4..f756914292c4 100644
--- a/sim/testsuite/microblaze/allinsn.exp
+++ b/sim/testsuite/microblaze/allinsn.exp
@@ -1,10 +1,6 @@
# microblaze simulator testsuite
if [istarget microblaze-*] {
- # Used to locate the `run` program.
- global arch
- set arch "microblaze"
-
# all machines
set all_machs "microblaze"
diff --git a/sim/testsuite/mips/basic.exp b/sim/testsuite/mips/basic.exp
index 2eff923c0fc7..352b3b4e7193 100644
--- a/sim/testsuite/mips/basic.exp
+++ b/sim/testsuite/mips/basic.exp
@@ -42,10 +42,6 @@ proc run_sim_tests { name requested_machs { requested_micromips_machs "" } } {
# Only test mips*-*-elf (e.g., no mips*-*-linux)
if {[istarget mips*-*-elf]} {
- # Used to locate the `run` program.
- global arch
- set arch "mips"
-
set dspmodels ""
set mdmxmodels ""
set micromipsmodels ""
diff --git a/sim/testsuite/mn10300/allinsn.exp b/sim/testsuite/mn10300/allinsn.exp
index 7166aefddf30..f8431e7222ea 100644
--- a/sim/testsuite/mn10300/allinsn.exp
+++ b/sim/testsuite/mn10300/allinsn.exp
@@ -1,10 +1,6 @@
# mn10300 simulator testsuite
if [istarget mn10300-*] {
- # Used to locate the `run` program.
- global arch
- set arch "mn10300"
-
# all machines
set all_machs "mn10300"
diff --git a/sim/testsuite/moxie/allinsn.exp b/sim/testsuite/moxie/allinsn.exp
index 241e67576253..1a6af8b37d45 100644
--- a/sim/testsuite/moxie/allinsn.exp
+++ b/sim/testsuite/moxie/allinsn.exp
@@ -1,10 +1,6 @@
# moxie simulator testsuite
if [istarget moxie-*] {
- # Used to locate the `run` program.
- global arch
- set arch "moxie"
-
# all machines
set all_machs "moxie"
diff --git a/sim/testsuite/msp430/allinsn.exp b/sim/testsuite/msp430/allinsn.exp
index 83030290cce2..affa8aedc2ad 100644
--- a/sim/testsuite/msp430/allinsn.exp
+++ b/sim/testsuite/msp430/allinsn.exp
@@ -1,10 +1,6 @@
# msp430 simulator testsuite
if [istarget msp430-*] {
- # Used to locate the `run` program.
- global arch
- set arch "msp430"
-
# all machines
set all_machs "msp430"
diff --git a/sim/testsuite/or1k/alltests.exp b/sim/testsuite/or1k/alltests.exp
index 98c1345d0be5..365f3910debf 100644
--- a/sim/testsuite/or1k/alltests.exp
+++ b/sim/testsuite/or1k/alltests.exp
@@ -16,10 +16,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
if [istarget or1k*-*-*] {
- # Used to locate the `run` program.
- global arch
- set arch "or1k"
-
set all_machs "or1k"
global global_ld_options
diff --git a/sim/testsuite/pru/allinsn.exp b/sim/testsuite/pru/allinsn.exp
index c0d5ce936894..d147f731c913 100644
--- a/sim/testsuite/pru/allinsn.exp
+++ b/sim/testsuite/pru/allinsn.exp
@@ -19,10 +19,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
if [istarget pru-*] {
- # Used to locate the `run` program.
- global arch
- set arch "pru"
-
# all machines
set all_machs "pru"
diff --git a/sim/testsuite/riscv/allinsn.exp b/sim/testsuite/riscv/allinsn.exp
index 5701391da832..03bec1b541e7 100644
--- a/sim/testsuite/riscv/allinsn.exp
+++ b/sim/testsuite/riscv/allinsn.exp
@@ -1,10 +1,6 @@
# RISC-V simulator testsuite.
if [istarget riscv*-*] {
- # Used to locate the `run` program.
- global arch
- set arch "riscv"
-
# all machines
set all_machs "riscv"
diff --git a/sim/testsuite/sh/allinsn.exp b/sim/testsuite/sh/allinsn.exp
index 235a40c692ab..40d139299426 100644
--- a/sim/testsuite/sh/allinsn.exp
+++ b/sim/testsuite/sh/allinsn.exp
@@ -13,10 +13,6 @@ foreach opt $board_variant_list {
}
if [istarget sh-*elf] {
- # Used to locate the `run` program.
- global arch
- set arch "sh"
-
run_sim_test add.s $all
run_sim_test and.s $all
run_sim_test bandor.s sh
diff --git a/sim/testsuite/v850/allinsns.exp b/sim/testsuite/v850/allinsns.exp
index 4c3bc088ff6b..93dcffce2f37 100644
--- a/sim/testsuite/v850/allinsns.exp
+++ b/sim/testsuite/v850/allinsns.exp
@@ -3,10 +3,6 @@
if [istarget v850*-*] {
global opt
- # Used to locate the `run` program.
- global arch
- set arch "v850"
-
# all machines
switch -regexp -- $opt {
.*v850e.* {
--
2.30.2
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 2/3] sim: testsuite: skip tests when the port is disabled
2021-04-04 14:35 [PATCH 1/3] sim: testsuite: calculate $arch from $subdir Mike Frysinger
@ 2021-04-04 14:35 ` Mike Frysinger
2021-04-04 14:35 ` [PATCH 3/3] sim: testsuite: support exit 77 for unsupported tests Mike Frysinger
2021-04-05 16:31 ` [PATCH 1/3] sim: testsuite: calculate $arch from $subdir Dimitar Dimitrov
2 siblings, 0 replies; 9+ messages in thread
From: Mike Frysinger @ 2021-04-04 14:35 UTC (permalink / raw)
To: gdb-patches
If the port hasn't been enabled, don't try to run its tests. Making
this dynamic simplifies the test harnesses and avoids duplicating a
bunch of target tuple checks.
---
sim/testsuite/lib/sim-defs.exp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/sim/testsuite/lib/sim-defs.exp b/sim/testsuite/lib/sim-defs.exp
index 1b40216ea6ed..e627b6efc595 100644
--- a/sim/testsuite/lib/sim-defs.exp
+++ b/sim/testsuite/lib/sim-defs.exp
@@ -205,6 +205,11 @@ proc run_sim_test { name requested_machs } {
global global_cc_options
global global_sim_options
+ if ![file exists [sim_tool_path]] {
+ unsupported "$name: missing simulator [sim_tool_path]"
+ return
+ }
+
if [string match "*/*" $name] {
set file $name
set name [file tail $name]
--
2.30.2
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 3/3] sim: testsuite: support exit 77 for unsupported tests
2021-04-04 14:35 [PATCH 1/3] sim: testsuite: calculate $arch from $subdir Mike Frysinger
2021-04-04 14:35 ` [PATCH 2/3] sim: testsuite: skip tests when the port is disabled Mike Frysinger
@ 2021-04-04 14:35 ` Mike Frysinger
2021-04-05 16:31 ` [PATCH 1/3] sim: testsuite: calculate $arch from $subdir Dimitar Dimitrov
2 siblings, 0 replies; 9+ messages in thread
From: Mike Frysinger @ 2021-04-04 14:35 UTC (permalink / raw)
To: gdb-patches
Exit status 77 is common (including the autotools world) to indicate
"skip this test". Add support for mapping that to "unsupported" as
that's the closest in the dejagnu world.
---
sim/testsuite/lib/sim-defs.exp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sim/testsuite/lib/sim-defs.exp b/sim/testsuite/lib/sim-defs.exp
index e627b6efc595..59c7dede83e4 100644
--- a/sim/testsuite/lib/sim-defs.exp
+++ b/sim/testsuite/lib/sim-defs.exp
@@ -402,7 +402,9 @@ proc run_sim_test { name requested_machs } {
set output [lindex $result 1]
set status fail
- if { $return_code == $opts(status) } {
+ if { $return_code == 77 } {
+ set status unsupported
+ } elseif { $return_code == $opts(status) } {
set status pass
}
--
2.30.2
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] sim: testsuite: calculate $arch from $subdir
2021-04-04 14:35 [PATCH 1/3] sim: testsuite: calculate $arch from $subdir Mike Frysinger
2021-04-04 14:35 ` [PATCH 2/3] sim: testsuite: skip tests when the port is disabled Mike Frysinger
2021-04-04 14:35 ` [PATCH 3/3] sim: testsuite: support exit 77 for unsupported tests Mike Frysinger
@ 2021-04-05 16:31 ` Dimitar Dimitrov
2021-04-05 17:17 ` Mike Frysinger
2 siblings, 1 reply; 9+ messages in thread
From: Dimitar Dimitrov @ 2021-04-05 16:31 UTC (permalink / raw)
To: gdb-patches, Mike Frysinger
[-- Attachment #1: Type: text/plain, Size: 2792 bytes --]
On Sun, 4 Apr 2021 17:35:36 EEST Mike Frysinger via Gdb-patches wrote:
> Since we require ports to use a matching subdir name in the testsuite
> tree, we can use that to calculate the $arch value.
> ---
> sim/testsuite/aarch64/allinsn.exp | 4 ----
> sim/testsuite/arm/allinsn.exp | 4 ----
> sim/testsuite/arm/iwmmxt/iwmmxt.exp | 4 ----
> sim/testsuite/arm/misc.exp | 4 ----
> sim/testsuite/arm/thumb/allthumb.exp | 4 ----
> sim/testsuite/arm/xscale/xscale.exp | 4 ----
> sim/testsuite/avr/allinsn.exp | 4 ----
> sim/testsuite/bfin/allinsn.exp | 4 ----
> sim/testsuite/bpf/allinsn.exp | 4 ----
> sim/testsuite/cr16/allinsn.exp | 4 ----
> sim/testsuite/cr16/misc.exp | 4 ----
> sim/testsuite/cris/asm/asm.exp | 4 ----
> sim/testsuite/cris/c/c.exp | 4 ----
> sim/testsuite/cris/hw/rv-n-cris/rvc.exp | 7 +-----
> sim/testsuite/d10v/allinsn.exp | 4 ----
> sim/testsuite/example-synacor/allinsn.exp | 4 ----
> sim/testsuite/frv/allinsn.exp | 4 ----
> sim/testsuite/frv/fr400/allinsn.exp | 4 ----
> sim/testsuite/frv/fr500/allinsn.exp | 4 ----
> sim/testsuite/frv/fr550/allinsn.exp | 4 ----
> sim/testsuite/frv/interrupts.exp | 4 ----
> sim/testsuite/frv/misc.exp | 4 ----
> sim/testsuite/frv/parallel.exp | 4 ----
> sim/testsuite/ft32/allinsn.exp | 4 ----
> sim/testsuite/h8300/allinsn.exp | 4 ----
> sim/testsuite/iq2000/allinsn.exp | 4 ----
> sim/testsuite/lib/sim-defs.exp | 27 ++++++++++++++---------
> sim/testsuite/lm32/allinsn.exp | 4 ----
> sim/testsuite/m32c/allinsn.exp | 4 ----
> sim/testsuite/m32r/allinsn.exp | 4 ----
> sim/testsuite/m32r/misc.exp | 4 ----
> sim/testsuite/m68hc11/allinsn.exp | 4 ----
> sim/testsuite/mcore/allinsn.exp | 4 ----
> sim/testsuite/microblaze/allinsn.exp | 4 ----
> sim/testsuite/mips/basic.exp | 4 ----
> sim/testsuite/mn10300/allinsn.exp | 4 ----
> sim/testsuite/moxie/allinsn.exp | 4 ----
> sim/testsuite/msp430/allinsn.exp | 4 ----
> sim/testsuite/or1k/alltests.exp | 4 ----
> sim/testsuite/pru/allinsn.exp | 4 ----
> sim/testsuite/riscv/allinsn.exp | 4 ----
> sim/testsuite/sh/allinsn.exp | 4 ----
> sim/testsuite/v850/allinsns.exp | 4 ----
> 43 files changed, 18 insertions(+), 180 deletions(-)
Hi,
This patch set, in combination with the attached minor fix, is resolving all
"check-sim" errors and failures for PRU target.
Thanks,
Dimitar
[-- Attachment #2: 0001-sim-Add-bfd-include-path-for-common-testsuite-tools.patch --]
[-- Type: text/x-patch, Size: 1204 bytes --]
From 6f0fb28ff86acc17b5038978cc42144ffa5a5cb4 Mon Sep 17 00:00:00 2001
From: Dimitar Dimitrov <dimitar@dinux.eu>
Date: Mon, 5 Apr 2021 19:21:35 +0300
Subject: [PATCH] sim: Add bfd include path for common testsuite tools
On my Fedora33 host this patch fixes the following "make check-sim"
errors for both pru cross target, and native x86_64:
In file included from ../../../binutils/sim/common/sim-basics.h:131,
from testsuite/common/bits32m0.c:13:../../../binutils/sim/../include/gdb/callback.h:55:10: fatal error: bfd.h: No such file or directory
55 | #include "bfd.h"
| ^~~~~~~
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
---
sim/testsuite/common/local.mk | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sim/testsuite/common/local.mk b/sim/testsuite/common/local.mk
index 38ffb0b0b7d..4db7981d160 100644
--- a/sim/testsuite/common/local.mk
+++ b/sim/testsuite/common/local.mk
@@ -29,7 +29,8 @@ check_PROGRAMS += $(TESTS)
%C%_CPPFLAGS = \
-I$(srcdir)/common \
- -I$(srcroot)/include
+ -I$(srcroot)/include \
+ -I../bfd
# These tests are build-time only tools. Override the default rules for them.
%D%/%.o: %D%/%.c
--
2.20.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] sim: testsuite: calculate $arch from $subdir
2021-04-05 16:31 ` [PATCH 1/3] sim: testsuite: calculate $arch from $subdir Dimitar Dimitrov
@ 2021-04-05 17:17 ` Mike Frysinger
2021-04-05 18:19 ` Dimitar Dimitrov
0 siblings, 1 reply; 9+ messages in thread
From: Mike Frysinger @ 2021-04-05 17:17 UTC (permalink / raw)
To: Dimitar Dimitrov; +Cc: gdb-patches
On 05 Apr 2021 19:31, Dimitar Dimitrov wrote:
> From 6f0fb28ff86acc17b5038978cc42144ffa5a5cb4 Mon Sep 17 00:00:00 2001
> From: Dimitar Dimitrov <dimitar@dinux.eu>
> Date: Mon, 5 Apr 2021 19:21:35 +0300
> Subject: [PATCH] sim: Add bfd include path for common testsuite tools
>
> On my Fedora33 host this patch fixes the following "make check-sim"
> errors for both pru cross target, and native x86_64:
>
> In file included from ../../../binutils/sim/common/sim-basics.h:131,
> from testsuite/common/bits32m0.c:13:../../../binutils/sim/../include/gdb/callback.h:55:10: fatal error: bfd.h: No such file or directory
> 55 | #include "bfd.h"
> | ^~~~~~~
i'm guessing you don't have libbfd installed in your host distro already ?
i do which is why i think i missed this.
> %C%_CPPFLAGS = \
> -I$(srcdir)/common \
> - -I$(srcroot)/include
> + -I$(srcroot)/include \
> + -I../bfd
this looks fine. i'm not sure it's super kosher since it's technically,
mixing host & target headers, but i don't think we have much choice at
this point.
-mike
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] sim: testsuite: calculate $arch from $subdir
2021-04-05 17:17 ` Mike Frysinger
@ 2021-04-05 18:19 ` Dimitar Dimitrov
2021-05-06 20:51 ` Dimitar Dimitrov
0 siblings, 1 reply; 9+ messages in thread
From: Dimitar Dimitrov @ 2021-04-05 18:19 UTC (permalink / raw)
To: Mike Frysinger; +Cc: gdb-patches
On Mon, 5 Apr 2021 20:17:01 EEST Mike Frysinger wrote:
> On 05 Apr 2021 19:31, Dimitar Dimitrov wrote:
> > From 6f0fb28ff86acc17b5038978cc42144ffa5a5cb4 Mon Sep 17 00:00:00 2001
> > From: Dimitar Dimitrov <dimitar@dinux.eu>
> > Date: Mon, 5 Apr 2021 19:21:35 +0300
> > Subject: [PATCH] sim: Add bfd include path for common testsuite tools
> >
> > On my Fedora33 host this patch fixes the following "make check-sim"
> > errors for both pru cross target, and native x86_64:
> >
> > In file included from ../../../binutils/sim/common/sim-basics.h:131,
> >
> > from
> > testsuite/common/bits32m0.c:13:../../../binutils/sim/../
> > include/gdb/callback.h:55:10: fatal error: bfd.h: No such
> > file or directory>
> > 55 | #include "bfd.h"
> >
> > | ^~~~~~~
>
> i'm guessing you don't have libbfd installed in your host distro already ?
> i do which is why i think i missed this.
You are correct. I don't have libbfd installed on my host.
Regards,
Dimitar
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] sim: testsuite: calculate $arch from $subdir
2021-04-05 18:19 ` Dimitar Dimitrov
@ 2021-05-06 20:51 ` Dimitar Dimitrov
2021-05-06 22:27 ` Mike Frysinger
2021-05-07 18:21 ` [PATCH/committed] sim: Add bfd include path for common testsuite tools Dimitar Dimitrov
0 siblings, 2 replies; 9+ messages in thread
From: Dimitar Dimitrov @ 2021-05-06 20:51 UTC (permalink / raw)
To: Mike Frysinger; +Cc: gdb-patches
On понеделник, 5 април 2021 г. 21:19:02 EEST Dimitar Dimitrov wrote:
> On Mon, 5 Apr 2021 20:17:01 EEST Mike Frysinger wrote:
> > On 05 Apr 2021 19:31, Dimitar Dimitrov wrote:
> > > From 6f0fb28ff86acc17b5038978cc42144ffa5a5cb4 Mon Sep 17 00:00:00 2001
> > > From: Dimitar Dimitrov <dimitar@dinux.eu>
> > > Date: Mon, 5 Apr 2021 19:21:35 +0300
> > > Subject: [PATCH] sim: Add bfd include path for common testsuite tools
> > >
> > > On my Fedora33 host this patch fixes the following "make check-sim"
> > > errors for both pru cross target, and native x86_64:
> > >
> > > In file included from ../../../binutils/sim/common/sim-basics.h:131,
> > >
> > > from
> > > testsuite/common/bits32m0.c:13:../../../binutils/sim/..
> > > /
> > > include/gdb/callback.h:55:10: fatal error: bfd.h: No
> > > such
> > > file or directory>
> > >
> > > 55 | #include "bfd.h"
> > >
> > > | ^~~~~~~
> >
> > i'm guessing you don't have libbfd installed in your host distro already ?
> > i do which is why i think i missed this.
>
> You are correct. I don't have libbfd installed on my host.
Can this fix be merged? Or should I instead install libbfd as a prerequsite
for running the sim test suite?
Thanks,
Dimitar
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] sim: testsuite: calculate $arch from $subdir
2021-05-06 20:51 ` Dimitar Dimitrov
@ 2021-05-06 22:27 ` Mike Frysinger
2021-05-07 18:21 ` [PATCH/committed] sim: Add bfd include path for common testsuite tools Dimitar Dimitrov
1 sibling, 0 replies; 9+ messages in thread
From: Mike Frysinger @ 2021-05-06 22:27 UTC (permalink / raw)
To: Dimitar Dimitrov; +Cc: gdb-patches
On 06 May 2021 23:51, Dimitar Dimitrov wrote:
> On понеделник, 5 април 2021 г. 21:19:02 EEST Dimitar Dimitrov wrote:
> > On Mon, 5 Apr 2021 20:17:01 EEST Mike Frysinger wrote:
> > > On 05 Apr 2021 19:31, Dimitar Dimitrov wrote:
> > > > From 6f0fb28ff86acc17b5038978cc42144ffa5a5cb4 Mon Sep 17 00:00:00 2001
> > > > From: Dimitar Dimitrov <dimitar@dinux.eu>
> > > > Date: Mon, 5 Apr 2021 19:21:35 +0300
> > > > Subject: [PATCH] sim: Add bfd include path for common testsuite tools
> > > >
> > > > On my Fedora33 host this patch fixes the following "make check-sim"
> > > > errors for both pru cross target, and native x86_64:
> > > >
> > > > In file included from ../../../binutils/sim/common/sim-basics.h:131,
> > > >
> > > > from
> > > > testsuite/common/bits32m0.c:13:../../../binutils/sim/..
> > > > /
> > > > include/gdb/callback.h:55:10: fatal error: bfd.h: No
> > > > such
> > > > file or directory>
> > > >
> > > > 55 | #include "bfd.h"
> > > >
> > > > | ^~~~~~~
> > >
> > > i'm guessing you don't have libbfd installed in your host distro already ?
> > > i do which is why i think i missed this.
> >
> > You are correct. I don't have libbfd installed on my host.
>
> Can this fix be merged?
the expectation was you'd merge it. if you need me to do it, let me know.
-mike
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH/committed] sim: Add bfd include path for common testsuite tools
2021-05-06 20:51 ` Dimitar Dimitrov
2021-05-06 22:27 ` Mike Frysinger
@ 2021-05-07 18:21 ` Dimitar Dimitrov
1 sibling, 0 replies; 9+ messages in thread
From: Dimitar Dimitrov @ 2021-05-07 18:21 UTC (permalink / raw)
To: gdb-patches
On a host without installed libbfd, this patch fixes the following
"make check-sim" errors for both pru cross target, and native x86_64:
In file included from ../../../binutils/sim/common/sim-basics.h:131,
from testsuite/common/bits32m0.c:13:../../../binutils/sim/../include/gdb/callback.h:55:10: fatal error: bfd.h: No such file or directory
55 | #include "bfd.h"
| ^~~~~~~
sim/ChangeLog:
* Makefile.in: Rebuild.
sim/testsuite/ChangeLog:
* local.mk (%C%_CPPFLAGS): Add ../bfd include path.
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
---
sim/testsuite/common/local.mk | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sim/testsuite/common/local.mk b/sim/testsuite/common/local.mk
index 38ffb0b0b7d..4db7981d160 100644
--- a/sim/testsuite/common/local.mk
+++ b/sim/testsuite/common/local.mk
@@ -29,7 +29,8 @@ check_PROGRAMS += $(TESTS)
%C%_CPPFLAGS = \
-I$(srcdir)/common \
- -I$(srcroot)/include
+ -I$(srcroot)/include \
+ -I../bfd
# These tests are build-time only tools. Override the default rules for them.
%D%/%.o: %D%/%.c
--
2.20.1
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2021-05-07 18:21 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-04 14:35 [PATCH 1/3] sim: testsuite: calculate $arch from $subdir Mike Frysinger
2021-04-04 14:35 ` [PATCH 2/3] sim: testsuite: skip tests when the port is disabled Mike Frysinger
2021-04-04 14:35 ` [PATCH 3/3] sim: testsuite: support exit 77 for unsupported tests Mike Frysinger
2021-04-05 16:31 ` [PATCH 1/3] sim: testsuite: calculate $arch from $subdir Dimitar Dimitrov
2021-04-05 17:17 ` Mike Frysinger
2021-04-05 18:19 ` Dimitar Dimitrov
2021-05-06 20:51 ` Dimitar Dimitrov
2021-05-06 22:27 ` Mike Frysinger
2021-05-07 18:21 ` [PATCH/committed] sim: Add bfd include path for common testsuite tools Dimitar Dimitrov
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).