Use variable args in run_ld_link_exec_tests
If the last parameter of a tcl function is "args" then it can take zero or more arguments. Make use of this language feature in run_ld_link_exec_tests. * testsuite/lib/ld-lib.exp (run_ld_link_exec_tests): Replace "targets_to_xfail" parameter with "args". * testsuite/ld-elf/compress.exp: Remove empty list of xfails on all calls to run_ld_link_exec_tests. * testsuite/ld-elf/dwarf.exp: Likewise. * testsuite/ld-elf/indirect.exp: Likewise. * testsuite/ld-elf/wrap.exp: Likewise. * testsuite/ld-i386/i386.exp: Likewise. * testsuite/ld-i386/no-plt.exp: Likewise. * testsuite/ld-i386/tls.exp: Likewise. * testsuite/ld-ifunc/ifunc.exp: Likewise. * testsuite/ld-pie/pie.exp: Likewise. * testsuite/ld-plugin/lto.exp: Likewise. * testsuite/ld-size/size.exp: Likewise. * testsuite/ld-x86-64/mpx.exp: Likewise. * testsuite/ld-x86-64/no-plt.exp: Likewise. * testsuite/ld-x86-64/tls.exp: Likewise. * testsuite/ld-x86-64/x86-64.exp: Likewise. * testsuite/ld-elf/elf.exp: Likewise. Reorder args when providing xfails and simplify lists. * testsuite/ld-elf/shared.exp: Likewise.
This commit is contained in:
parent
5df1bc570f
commit
982c6f2665
19 changed files with 61 additions and 37 deletions
24
ld/ChangeLog
24
ld/ChangeLog
|
@ -1,3 +1,27 @@
|
|||
2016-07-21 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* testsuite/lib/ld-lib.exp (run_ld_link_exec_tests): Replace
|
||||
"targets_to_xfail" parameter with "args".
|
||||
* testsuite/ld-elf/compress.exp: Remove empty list of xfails on
|
||||
all calls to run_ld_link_exec_tests.
|
||||
* testsuite/ld-elf/dwarf.exp: Likewise.
|
||||
* testsuite/ld-elf/indirect.exp: Likewise.
|
||||
* testsuite/ld-elf/wrap.exp: Likewise.
|
||||
* testsuite/ld-i386/i386.exp: Likewise.
|
||||
* testsuite/ld-i386/no-plt.exp: Likewise.
|
||||
* testsuite/ld-i386/tls.exp: Likewise.
|
||||
* testsuite/ld-ifunc/ifunc.exp: Likewise.
|
||||
* testsuite/ld-pie/pie.exp: Likewise.
|
||||
* testsuite/ld-plugin/lto.exp: Likewise.
|
||||
* testsuite/ld-size/size.exp: Likewise.
|
||||
* testsuite/ld-x86-64/mpx.exp: Likewise.
|
||||
* testsuite/ld-x86-64/no-plt.exp: Likewise.
|
||||
* testsuite/ld-x86-64/tls.exp: Likewise.
|
||||
* testsuite/ld-x86-64/x86-64.exp: Likewise.
|
||||
* testsuite/ld-elf/elf.exp: Likewise. Reorder args when providing
|
||||
xfails and simplify lists.
|
||||
* testsuite/ld-elf/shared.exp: Likewise.
|
||||
|
||||
2016-07-21 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* testsuite/lib/ld-lib.exp (run_ld_link_tests): Add optional
|
||||
|
|
|
@ -112,7 +112,7 @@ set run_tests {
|
|||
}
|
||||
|
||||
run_cc_link_tests $build_tests
|
||||
run_ld_link_exec_tests [] $run_tests
|
||||
run_ld_link_exec_tests $run_tests
|
||||
|
||||
set test_name "Link with zlib-gabi compressed debug input"
|
||||
send_log "cmp tmpdir/libfoo.so tmpdir/libfoozlib.so\n"
|
||||
|
|
|
@ -62,7 +62,7 @@ set run_tests {
|
|||
}
|
||||
|
||||
run_cc_link_tests $build_tests
|
||||
run_ld_link_exec_tests [] $run_tests
|
||||
run_ld_link_exec_tests $run_tests
|
||||
|
||||
proc strip_test {} {
|
||||
global ld
|
||||
|
|
|
@ -240,22 +240,22 @@ set array_tests_static {
|
|||
}
|
||||
|
||||
# NetBSD ELF systems do not currently support the .*_array sections.
|
||||
set xfails [list "*-*-netbsdelf*"]
|
||||
run_ld_link_exec_tests $xfails $array_tests
|
||||
set xfails "*-*-netbsdelf*"
|
||||
run_ld_link_exec_tests $array_tests $xfails
|
||||
|
||||
if { [istarget *-*-linux*]
|
||||
|| [istarget *-*-nacl*]
|
||||
|| [istarget *-*-gnu*] } {
|
||||
run_ld_link_exec_tests $xfails $array_tests_pie
|
||||
run_ld_link_exec_tests $array_tests_pie $xfails
|
||||
}
|
||||
|
||||
# <http://www.gnu.org/software/hurd/open_issues/binutils.html#static>
|
||||
# Be cautious to not XFAIL for *-*-linux-gnu*, *-*-kfreebsd-gnu*, etc.
|
||||
switch -regexp $target_triplet {
|
||||
^\[^-\]*-\[^-\]*-gnu.*$ {
|
||||
# <http://www.gnu.org/software/hurd/open_issues/binutils.html#static>
|
||||
lappend xfails "*-*-*"
|
||||
set xfails "*-*-*"
|
||||
}
|
||||
}
|
||||
run_ld_link_exec_tests $xfails $array_tests_static
|
||||
run_ld_link_exec_tests $array_tests_static $xfails
|
||||
|
||||
catch "exec rm -f tmpdir/preinit tmpdir/init tmpdir/fini tmpdir/init-mixed" status
|
||||
|
|
|
@ -179,4 +179,4 @@ set run_tests {
|
|||
{pr19553a.c} "pr19553d" "pr19553d.out"}
|
||||
}
|
||||
|
||||
run_ld_link_exec_tests [] $run_tests
|
||||
run_ld_link_exec_tests $run_tests
|
||||
|
|
|
@ -435,7 +435,7 @@ set run_tests {
|
|||
}
|
||||
|
||||
# NetBSD ELF systems do not currently support the .*_array sections.
|
||||
run_ld_link_exec_tests [list "*-*-netbsdelf*"] $run_tests
|
||||
run_ld_link_exec_tests $run_tests "*-*-netbsdelf*"
|
||||
|
||||
# Check --no-add-needed and --no-copy-dt-needed-entries
|
||||
set testname "--no-add-needed"
|
||||
|
@ -510,7 +510,7 @@ set run_cxx_tests {
|
|||
}
|
||||
|
||||
run_cc_link_tests $build_cxx_tests
|
||||
run_ld_link_exec_tests [] $run_cxx_tests
|
||||
run_ld_link_exec_tests $run_cxx_tests
|
||||
|
||||
if { [istarget *-*-linux*]
|
||||
|| [istarget *-*-nacl*]
|
||||
|
@ -540,7 +540,7 @@ if { [istarget *-*-linux*]
|
|||
"libpr19579.so" \
|
||||
] \
|
||||
]
|
||||
run_ld_link_exec_tests [] [list \
|
||||
run_ld_link_exec_tests [list \
|
||||
[list \
|
||||
"Run pr2404 with PIE" \
|
||||
"-pie tmpdir/pr2404b.o tmpdir/libpr2404a.so" \
|
||||
|
@ -638,7 +638,7 @@ proc mix_pic_and_non_pic {xfails cflags ldflags exe} {
|
|||
send_log "cp tmpdir/libpr19719b.so tmpdir/libpr19719.so\n"
|
||||
exec cp tmpdir/libpr19719b.so tmpdir/libpr19719.so
|
||||
|
||||
run_ld_link_exec_tests [] [list \
|
||||
run_ld_link_exec_tests [list \
|
||||
[list \
|
||||
"Run $exe fun defined" \
|
||||
"$ldflags tmpdir/libpr19719b.o tmpdir/libpr19719.so -rpath tmpdir" \
|
||||
|
|
|
@ -54,4 +54,4 @@ set run_tests {
|
|||
}
|
||||
|
||||
run_cc_link_tests $build_tests
|
||||
run_ld_link_exec_tests [] $run_tests
|
||||
run_ld_link_exec_tests $run_tests
|
||||
|
|
|
@ -468,7 +468,7 @@ proc undefined_weak {cflags ldflags} {
|
|||
|
||||
exec cp tmpdir/libpr19704a.so tmpdir/libpr19704.so
|
||||
|
||||
run_ld_link_exec_tests [] [list \
|
||||
run_ld_link_exec_tests [list \
|
||||
[list \
|
||||
"Run pr19704" \
|
||||
"$ldflags tmpdir/libpr19704.so -R tmpdir" \
|
||||
|
@ -734,7 +734,7 @@ if { [isnative]
|
|||
] \
|
||||
]
|
||||
|
||||
run_ld_link_exec_tests [] [list \
|
||||
run_ld_link_exec_tests [list \
|
||||
[list \
|
||||
"Run plt-main" \
|
||||
"tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \
|
||||
|
@ -833,7 +833,7 @@ if { [isnative]
|
|||
] \
|
||||
]
|
||||
|
||||
run_ld_link_exec_tests [] [list \
|
||||
run_ld_link_exec_tests [list \
|
||||
[list \
|
||||
"Run ifunc-1a" \
|
||||
"tmpdir/ifunc-1a.o tmpdir/ifunc-1b.o \
|
||||
|
|
|
@ -163,7 +163,7 @@ run_cc_link_tests [list \
|
|||
] \
|
||||
]
|
||||
|
||||
run_ld_link_exec_tests [] [list \
|
||||
run_ld_link_exec_tests [list \
|
||||
[list \
|
||||
"No PLT (dynamic 1a)" \
|
||||
"tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \
|
||||
|
@ -288,7 +288,7 @@ if { [check_ifunc_available] } {
|
|||
] \
|
||||
]
|
||||
|
||||
run_ld_link_exec_tests [] [list \
|
||||
run_ld_link_exec_tests [list \
|
||||
[list \
|
||||
"Run pr20244-3a" \
|
||||
"tmpdir/pr20244-3a.o tmpdir/pr20244-3b.o \
|
||||
|
|
|
@ -67,7 +67,7 @@ run_cc_link_tests [list \
|
|||
] \
|
||||
]
|
||||
|
||||
run_ld_link_exec_tests [] [list \
|
||||
run_ld_link_exec_tests [list \
|
||||
[list \
|
||||
"TLS GD/LD -> LE transition without PLT (dynamic)" \
|
||||
"tmpdir/tls-def1.o tmpdir/tls-main1.o tmpdir/tls-gd1.o \
|
||||
|
|
|
@ -386,7 +386,7 @@ run_cc_link_tests [list \
|
|||
] \
|
||||
]
|
||||
|
||||
run_ld_link_exec_tests [] [list \
|
||||
run_ld_link_exec_tests [list \
|
||||
[list \
|
||||
"Common symbol override ifunc test 1a" \
|
||||
"-static" \
|
||||
|
@ -430,7 +430,7 @@ run_cc_link_tests [list \
|
|||
] \
|
||||
]
|
||||
|
||||
run_ld_link_exec_tests [] [list \
|
||||
run_ld_link_exec_tests [list \
|
||||
[list \
|
||||
"Run pr16467" \
|
||||
"tmpdir/pr16467c.o tmpdir/libpr16467b.so tmpdir/libpr16467a.so" \
|
||||
|
@ -531,7 +531,7 @@ run_cc_link_tests [list \
|
|||
] \
|
||||
]
|
||||
|
||||
run_ld_link_exec_tests [] [list \
|
||||
run_ld_link_exec_tests [list \
|
||||
[list \
|
||||
"Run pr18808" \
|
||||
"tmpdir/pr18808a.o tmpdir/libpr18808.so" \
|
||||
|
|
|
@ -41,7 +41,7 @@ set array_tests {
|
|||
{"weak undefined data" "-pie" "" {weakundef-data.c} "weakundef-data" "weakundef.out" "-fPIC"}
|
||||
}
|
||||
|
||||
run_ld_link_exec_tests [] $array_tests
|
||||
run_ld_link_exec_tests $array_tests
|
||||
|
||||
set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
|
||||
foreach t $test_list {
|
||||
|
|
|
@ -481,10 +481,10 @@ if ![isnative] {
|
|||
return
|
||||
}
|
||||
|
||||
run_ld_link_exec_tests [] $lto_run_tests
|
||||
run_ld_link_exec_tests $lto_run_tests
|
||||
|
||||
if { [is_elf_format] } {
|
||||
run_ld_link_exec_tests [] $lto_run_elf_tests
|
||||
run_ld_link_exec_tests $lto_run_elf_tests
|
||||
}
|
||||
|
||||
proc pr20103 {cflags libs} {
|
||||
|
|
|
@ -176,7 +176,7 @@ if { [regexp_diff "tmpdir/dump.out" "$srcdir/$subdir/size-7.out" ] } then {
|
|||
}
|
||||
|
||||
# Run-time size relocation tests.
|
||||
run_ld_link_exec_tests [] [list \
|
||||
run_ld_link_exec_tests [list \
|
||||
[list \
|
||||
"Run size-1" \
|
||||
"tmpdir/libsize-1.so" \
|
||||
|
|
|
@ -120,7 +120,7 @@ run_ld_link_tests {
|
|||
{mpx4a.s} {{objdump -dw mpx4.dd}} "mpx4"}
|
||||
}
|
||||
|
||||
run_ld_link_exec_tests [] $run_tests
|
||||
run_ld_link_exec_tests $run_tests
|
||||
|
||||
run_dump_test "bnd-branch-1"
|
||||
run_dump_test "bnd-ifunc-1"
|
||||
|
|
|
@ -134,7 +134,7 @@ run_cc_link_tests [list \
|
|||
] \
|
||||
]
|
||||
|
||||
run_ld_link_exec_tests [] [list \
|
||||
run_ld_link_exec_tests [list \
|
||||
[list \
|
||||
"No PLT (dynamic 1a)" \
|
||||
"tmpdir/no-plt-check1.o tmpdir/no-plt-main1.o \
|
||||
|
@ -220,7 +220,7 @@ if { [check_ifunc_available] } {
|
|||
] \
|
||||
]
|
||||
|
||||
run_ld_link_exec_tests [] [list \
|
||||
run_ld_link_exec_tests [list \
|
||||
[list \
|
||||
"Run pr20253-2a" \
|
||||
"tmpdir/pr20253-2a.o tmpdir/pr20253-2b.o \
|
||||
|
|
|
@ -67,7 +67,7 @@ run_cc_link_tests [list \
|
|||
] \
|
||||
]
|
||||
|
||||
run_ld_link_exec_tests [] [list \
|
||||
run_ld_link_exec_tests [list \
|
||||
[list \
|
||||
"TLS GD/LD -> LE transition without PLT (dynamic)" \
|
||||
"tmpdir/tls-def1.o tmpdir/tls-main1.o tmpdir/tls-gd1.o \
|
||||
|
|
|
@ -559,7 +559,7 @@ proc undefined_weak {cflags ldflags} {
|
|||
|
||||
exec cp tmpdir/libpr19704a.so tmpdir/libpr19704.so
|
||||
|
||||
run_ld_link_exec_tests [] [list \
|
||||
run_ld_link_exec_tests [list \
|
||||
[list \
|
||||
"Run pr19704" \
|
||||
"$ldflags tmpdir/libpr19704.so -R tmpdir" \
|
||||
|
@ -824,7 +824,7 @@ if { [isnative] && [which $CC] != 0 } {
|
|||
] \
|
||||
]
|
||||
|
||||
run_ld_link_exec_tests [] [list \
|
||||
run_ld_link_exec_tests [list \
|
||||
[list \
|
||||
"Run plt-main" \
|
||||
"tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \
|
||||
|
@ -918,7 +918,7 @@ if { [isnative] && [which $CC] != 0 } {
|
|||
] \
|
||||
]
|
||||
|
||||
run_ld_link_exec_tests [] [list \
|
||||
run_ld_link_exec_tests [list \
|
||||
[list \
|
||||
"Run plt-main with -z bndplt" \
|
||||
"tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \
|
||||
|
|
|
@ -1367,7 +1367,6 @@ if ![string length [info proc prune_warnings]] {
|
|||
}
|
||||
}
|
||||
|
||||
# targets_to_xfail is a list of target triplets to be xfailed.
|
||||
# ldtests contains test-items with 3 items followed by 1 lists, 2 items
|
||||
# and 3 optional items:
|
||||
# 0:name
|
||||
|
@ -1379,8 +1378,9 @@ if ![string length [info proc prune_warnings]] {
|
|||
# 6:compiler flags (optional)
|
||||
# 7:language (optional)
|
||||
# 8:linker warning (optional)
|
||||
# args is an optional list of target triplets to be xfailed.
|
||||
|
||||
proc run_ld_link_exec_tests { targets_to_xfail ldtests } {
|
||||
proc run_ld_link_exec_tests { ldtests args } {
|
||||
global ld
|
||||
global as
|
||||
global srcdir
|
||||
|
@ -1394,7 +1394,7 @@ proc run_ld_link_exec_tests { targets_to_xfail ldtests } {
|
|||
global exec_output
|
||||
|
||||
foreach testitem $ldtests {
|
||||
foreach target $targets_to_xfail {
|
||||
foreach target $args {
|
||||
setup_xfail $target
|
||||
}
|
||||
set testname [lindex $testitem 0]
|
||||
|
|
Loading…
Reference in a new issue