mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-03-07 13:39:43 +08:00
sim: testsuite: add support for $pwd replacements
Extend the common test framework to support $pwd replacements in settings. This allows replacing the custom cris @exedir@ with it.
This commit is contained in:
parent
927f25ebac
commit
c2aad00a74
@ -2,7 +2,7 @@
|
||||
#notarget: cris*-*-elf
|
||||
#xerror:
|
||||
#cc: additional_flags=-Wl,-dynamic-linker,/compilercheck.x
|
||||
#sim: --sysroot=@exedir@
|
||||
#sim: --sysroot=$pwd
|
||||
#output: *: could not load ELF interpreter `*' for program `*'\n
|
||||
*/
|
||||
#include "hello.c"
|
||||
|
@ -121,10 +121,6 @@ foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c]] {
|
||||
return
|
||||
}
|
||||
|
||||
# Replace specific substitutions:
|
||||
# @exedir@ is where the test-program is located.
|
||||
regsub -all "@exedir@" $opt_val "[pwd]" opt_val
|
||||
|
||||
# Multiple of these options concatenate, they don't override.
|
||||
if { $opt_name == "output" || $opt_name == "progoptions" } {
|
||||
set opt_val "$opts($opt_name)$opt_val"
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* Make sure the thread system trivially works with trace output.
|
||||
#notarget: cris*-*-elf
|
||||
#sim: --cris-trace=basic --trace-file=@exedir@/clone2.tmp
|
||||
#sim: --cris-trace=basic --trace-file=$pwd/clone2.tmp
|
||||
#output: got: a\nthen: bc\nexit: 0\n
|
||||
*/
|
||||
#include "clone1.c"
|
||||
|
@ -1,4 +1,4 @@
|
||||
/*
|
||||
#sim: --sysroot=@exedir@
|
||||
#sim: --sysroot=$pwd
|
||||
*/
|
||||
#include "hello.c"
|
||||
|
@ -1,4 +1,4 @@
|
||||
/*
|
||||
#sim: --sysroot=@exedir@ --load-vma
|
||||
#sim: --sysroot=$pwd --load-vma
|
||||
*/
|
||||
#include "hello.c"
|
||||
|
@ -3,6 +3,6 @@
|
||||
ld.so.cache (having no absolute path specified for the executable
|
||||
falls back on loading through the same mechanisms as a DSO).
|
||||
#notarget: *-*-elf
|
||||
#sim: --sysroot=@exedir@ @exedir@/lib/ld.so.1 --library-path /
|
||||
#sim: --sysroot=$pwd $pwd/lib/ld.so.1 --library-path /
|
||||
*/
|
||||
#include "hello.c"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Check that --sysroot is applied to open(2).
|
||||
#sim: --sysroot=@exedir@
|
||||
#sim: --sysroot=$pwd
|
||||
|
||||
We assume, with EXE being the name of the executable:
|
||||
- The simulator executes with cwd the same directory where the executable
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Basic file operations, now *with* sysroot.
|
||||
#sim: --sysroot=@exedir@
|
||||
#sim: --sysroot=$pwd
|
||||
*/
|
||||
#define PREFIX "/"
|
||||
#include "openpf3.c"
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* Check that TRT happens when error on too many opened files.
|
||||
#notarget: cris*-*-elf
|
||||
#sim: --sysroot=@exedir@
|
||||
#sim: --sysroot=$pwd
|
||||
*/
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* Simulator options:
|
||||
#notarget: cris*-*-elf
|
||||
#sim: --sysroot=@exedir@
|
||||
#sim: --sysroot=$pwd
|
||||
*/
|
||||
#define SYSROOTED 1
|
||||
#include "readlink2.c"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Check that rare readlink calls don't cause the simulator to abort.
|
||||
#notarget: cris*-*-elf
|
||||
#sim: --argv0 @exedir@/readlink6.c.x
|
||||
#sim: --argv0 $pwd/readlink6.c.x
|
||||
*/
|
||||
#include "readlink2.c"
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* Check that rare readlink calls don't cause the simulator to abort.
|
||||
#notarget: cris*-*-elf
|
||||
#sim: --sysroot=@exedir@ --env-unset PWD
|
||||
#sim: --sysroot=$pwd --env-unset PWD
|
||||
*/
|
||||
#define SYSROOTED 1
|
||||
#include "readlink2.c"
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* Check that odd cases of readlink work.
|
||||
#notarget: cris*-*-elf
|
||||
#cc: additional_flags=-DX="@exedir@"
|
||||
#cc: additional_flags=-DX="$pwd"
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Simulator options:
|
||||
#sim: --sysroot=@exedir@/
|
||||
#sim: --sysroot=$pwd/
|
||||
*/
|
||||
#include "seek1.c"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Simulator options:
|
||||
#sim: --sysroot=@exedir@
|
||||
#sim: --sysroot=$pwd
|
||||
*/
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* Simulator options:
|
||||
#notarget: cris*-*-elf
|
||||
#sim: --sysroot=@exedir@
|
||||
#sim: --sysroot=$pwd
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
#sim: --sysroot=@exedir@
|
||||
#sim: --sysroot=$pwd
|
||||
#notarget: cris*-*-elf
|
||||
*/
|
||||
#define PREFIX "/"
|
||||
|
@ -99,6 +99,7 @@ proc slurp_rv { file } {
|
||||
if [regexp $pat $line xxx cmd] {
|
||||
# match!
|
||||
set cmd [string map [list \
|
||||
{$pwd} [pwd] \
|
||||
{$srcdir} "$srcdir" \
|
||||
{$subdir} "$subdir" \
|
||||
] "$cmd"]
|
||||
|
@ -447,6 +447,7 @@ proc slurp_options { file } {
|
||||
if [regexp $pat $line xxx opt_name opt_machs opt_val] {
|
||||
# match!
|
||||
set opt_val [string map [list \
|
||||
{$pwd} [pwd] \
|
||||
{$srcdir} "$srcdir" \
|
||||
{$subdir} "$subdir" \
|
||||
] "$opt_val"]
|
||||
|
Loading…
Reference in New Issue
Block a user