forked from Imagelibrary/binutils-gdb
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.
This commit is contained in:
@@ -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" } {
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
|
||||
# Check that we trivially resolve a hostname.
|
||||
|
||||
#r @,@srcdir@/trivial4.r
|
||||
#r @,$srcdir/$subdir/trivial4.r
|
||||
|
||||
.include "trivial4.ms"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#mach: crisv32
|
||||
#r @,@srcdir@/trivial4.r
|
||||
#r @,$srcdir/$subdir/trivial4.r
|
||||
|
||||
# Test read and writes.
|
||||
|
||||
|
||||
@@ -11,6 +11,6 @@
|
||||
|
||||
# Test trace output for read and write.
|
||||
|
||||
#r @,@srcdir@/trivial4.r
|
||||
#r @,$srcdir/$subdir/trivial4.r
|
||||
|
||||
.include "trivial4.ms"
|
||||
|
||||
Reference in New Issue
Block a user