diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-11-16 20:16:18 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-11-16 20:16:18 -0500 |
commit | 927f25ebac00e225ed7ca88e45e2a98ddbdb122a (patch) | |
tree | 8cce8de1ecc7f51c5dbaacdeea59e917908428e1 | |
parent | b31ff1f79b561e29249d738fa9f076e58495035f (diff) | |
download | gdb-927f25ebac00e225ed7ca88e45e2a98ddbdb122a.zip gdb-927f25ebac00e225ed7ca88e45e2a98ddbdb122a.tar.gz gdb-927f25ebac00e225ed7ca88e45e2a98ddbdb122a.tar.bz2 |
sim: cris: replace @srcdir@ test extension with $srcdir/$subdir
The common framework supports $srcdir & $subdir replacements already,
so replace the custom @srcdir@ logic with those. Since the replace
happens in slurp_options that cris already uses, we don't have any
logic to port over there. We have to duplicate that into the cris
slurp_rv helper though.
-rw-r--r-- | sim/testsuite/cris/c/c.exp | 2 | ||||
-rw-r--r-- | sim/testsuite/cris/c/openpf2.c | 2 | ||||
-rw-r--r-- | sim/testsuite/cris/hw/rv-n-cris/host1.ms | 2 | ||||
-rw-r--r-- | sim/testsuite/cris/hw/rv-n-cris/rvc.exp | 10 | ||||
-rw-r--r-- | sim/testsuite/cris/hw/rv-n-cris/trivial4.ms | 2 | ||||
-rw-r--r-- | sim/testsuite/cris/hw/rv-n-cris/trivial5.ms | 2 |
6 files changed, 9 insertions, 11 deletions
diff --git a/sim/testsuite/cris/c/c.exp b/sim/testsuite/cris/c/c.exp index 8f39b09..e5b4866 100644 --- a/sim/testsuite/cris/c/c.exp +++ b/sim/testsuite/cris/c/c.exp @@ -124,8 +124,6 @@ foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c]] { # Replace specific substitutions: # @exedir@ is where the test-program is located. regsub -all "@exedir@" $opt_val "[pwd]" opt_val - # @srcdir@ is where the source of the test-program is located. - regsub -all "@srcdir@" $opt_val "$srcdir/$subdir" opt_val # Multiple of these options concatenate, they don't override. if { $opt_name == "output" || $opt_name == "progoptions" } { diff --git a/sim/testsuite/cris/c/openpf2.c b/sim/testsuite/cris/c/openpf2.c index 50337b1..49f09b6 100644 --- a/sim/testsuite/cris/c/openpf2.c +++ b/sim/testsuite/cris/c/openpf2.c @@ -1,5 +1,5 @@ /* Check that the simulator has chdir:ed to the --sysroot argument -#sim: --sysroot=@srcdir@ +#sim: --sysroot=$srcdir/$subdir (or that --sysroot is applied to relative file paths). */ #include <stdio.h> diff --git a/sim/testsuite/cris/hw/rv-n-cris/host1.ms b/sim/testsuite/cris/hw/rv-n-cris/host1.ms index c41f51f..7825394 100644 --- a/sim/testsuite/cris/hw/rv-n-cris/host1.ms +++ b/sim/testsuite/cris/hw/rv-n-cris/host1.ms @@ -3,6 +3,6 @@ # Check that we trivially resolve a hostname. -#r @,@srcdir@/trivial4.r +#r @,$srcdir/$subdir/trivial4.r .include "trivial4.ms" diff --git a/sim/testsuite/cris/hw/rv-n-cris/rvc.exp b/sim/testsuite/cris/hw/rv-n-cris/rvc.exp index 4e302d2..3d8b5c3 100644 --- a/sim/testsuite/cris/hw/rv-n-cris/rvc.exp +++ b/sim/testsuite/cris/hw/rv-n-cris/rvc.exp @@ -80,6 +80,7 @@ proc sim_has_rv_and_cris {} { # including parameters may not contain ":". proc slurp_rv { file } { + global subdir srcdir if [catch { set f [open $file r] } x] { #perror "couldn't open `$file': $x" perror "$x" @@ -97,6 +98,10 @@ proc slurp_rv { file } { # Whitespace here is space-tab. if [regexp $pat $line xxx cmd] { # match! + set cmd [string map [list \ + {$srcdir} "$srcdir" \ + {$subdir} "$subdir" \ + ] "$cmd"] lappend rv_array $cmd set seen_opt 1 } else { @@ -204,11 +209,6 @@ if [istarget cris*-*-*] { error "$x" } { set contents [join $hostcmds "\n"] - - # Make it possible to use files from the test - # source directory; expected with the @-command. - regsub -all "@srcdir@" $contents "$srcdir/$subdir" contents - verbose "rv: $contents" 2 puts $f $contents close $f diff --git a/sim/testsuite/cris/hw/rv-n-cris/trivial4.ms b/sim/testsuite/cris/hw/rv-n-cris/trivial4.ms index 6108160..3259f3e 100644 --- a/sim/testsuite/cris/hw/rv-n-cris/trivial4.ms +++ b/sim/testsuite/cris/hw/rv-n-cris/trivial4.ms @@ -1,5 +1,5 @@ #mach: crisv32 -#r @,@srcdir@/trivial4.r +#r @,$srcdir/$subdir/trivial4.r # Test read and writes. diff --git a/sim/testsuite/cris/hw/rv-n-cris/trivial5.ms b/sim/testsuite/cris/hw/rv-n-cris/trivial5.ms index 849f17e..c75e09f 100644 --- a/sim/testsuite/cris/hw/rv-n-cris/trivial5.ms +++ b/sim/testsuite/cris/hw/rv-n-cris/trivial5.ms @@ -11,6 +11,6 @@ # Test trace output for read and write. -#r @,@srcdir@/trivial4.r +#r @,$srcdir/$subdir/trivial4.r .include "trivial4.ms" |