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:
Alan Modra 2016-07-21 09:36:37 +09:30
parent 5df1bc570f
commit 982c6f2665
19 changed files with 61 additions and 37 deletions

View File

@ -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> 2016-07-21 Alan Modra <amodra@gmail.com>
* testsuite/lib/ld-lib.exp (run_ld_link_tests): Add optional * testsuite/lib/ld-lib.exp (run_ld_link_tests): Add optional

View File

@ -112,7 +112,7 @@ set run_tests {
} }
run_cc_link_tests $build_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" set test_name "Link with zlib-gabi compressed debug input"
send_log "cmp tmpdir/libfoo.so tmpdir/libfoozlib.so\n" send_log "cmp tmpdir/libfoo.so tmpdir/libfoozlib.so\n"

View File

@ -62,7 +62,7 @@ set run_tests {
} }
run_cc_link_tests $build_tests run_cc_link_tests $build_tests
run_ld_link_exec_tests [] $run_tests run_ld_link_exec_tests $run_tests
proc strip_test {} { proc strip_test {} {
global ld global ld

View File

@ -240,22 +240,22 @@ set array_tests_static {
} }
# NetBSD ELF systems do not currently support the .*_array sections. # NetBSD ELF systems do not currently support the .*_array sections.
set xfails [list "*-*-netbsdelf*"] set xfails "*-*-netbsdelf*"
run_ld_link_exec_tests $xfails $array_tests run_ld_link_exec_tests $array_tests $xfails
if { [istarget *-*-linux*] if { [istarget *-*-linux*]
|| [istarget *-*-nacl*] || [istarget *-*-nacl*]
|| [istarget *-*-gnu*] } { || [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. # Be cautious to not XFAIL for *-*-linux-gnu*, *-*-kfreebsd-gnu*, etc.
switch -regexp $target_triplet { switch -regexp $target_triplet {
^\[^-\]*-\[^-\]*-gnu.*$ { ^\[^-\]*-\[^-\]*-gnu.*$ {
# <http://www.gnu.org/software/hurd/open_issues/binutils.html#static> set xfails "*-*-*"
lappend 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 catch "exec rm -f tmpdir/preinit tmpdir/init tmpdir/fini tmpdir/init-mixed" status

View File

@ -179,4 +179,4 @@ set run_tests {
{pr19553a.c} "pr19553d" "pr19553d.out"} {pr19553a.c} "pr19553d" "pr19553d.out"}
} }
run_ld_link_exec_tests [] $run_tests run_ld_link_exec_tests $run_tests

View File

@ -435,7 +435,7 @@ set run_tests {
} }
# NetBSD ELF systems do not currently support the .*_array sections. # 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 # Check --no-add-needed and --no-copy-dt-needed-entries
set testname "--no-add-needed" set testname "--no-add-needed"
@ -510,7 +510,7 @@ set run_cxx_tests {
} }
run_cc_link_tests $build_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*] if { [istarget *-*-linux*]
|| [istarget *-*-nacl*] || [istarget *-*-nacl*]
@ -540,7 +540,7 @@ if { [istarget *-*-linux*]
"libpr19579.so" \ "libpr19579.so" \
] \ ] \
] ]
run_ld_link_exec_tests [] [list \ run_ld_link_exec_tests [list \
[list \ [list \
"Run pr2404 with PIE" \ "Run pr2404 with PIE" \
"-pie tmpdir/pr2404b.o tmpdir/libpr2404a.so" \ "-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" send_log "cp tmpdir/libpr19719b.so tmpdir/libpr19719.so\n"
exec cp tmpdir/libpr19719b.so tmpdir/libpr19719.so exec cp tmpdir/libpr19719b.so tmpdir/libpr19719.so
run_ld_link_exec_tests [] [list \ run_ld_link_exec_tests [list \
[list \ [list \
"Run $exe fun defined" \ "Run $exe fun defined" \
"$ldflags tmpdir/libpr19719b.o tmpdir/libpr19719.so -rpath tmpdir" \ "$ldflags tmpdir/libpr19719b.o tmpdir/libpr19719.so -rpath tmpdir" \

View File

@ -54,4 +54,4 @@ set run_tests {
} }
run_cc_link_tests $build_tests run_cc_link_tests $build_tests
run_ld_link_exec_tests [] $run_tests run_ld_link_exec_tests $run_tests

View File

@ -468,7 +468,7 @@ proc undefined_weak {cflags ldflags} {
exec cp tmpdir/libpr19704a.so tmpdir/libpr19704.so exec cp tmpdir/libpr19704a.so tmpdir/libpr19704.so
run_ld_link_exec_tests [] [list \ run_ld_link_exec_tests [list \
[list \ [list \
"Run pr19704" \ "Run pr19704" \
"$ldflags tmpdir/libpr19704.so -R tmpdir" \ "$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 \ [list \
"Run plt-main" \ "Run plt-main" \
"tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \ "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 \ [list \
"Run ifunc-1a" \ "Run ifunc-1a" \
"tmpdir/ifunc-1a.o tmpdir/ifunc-1b.o \ "tmpdir/ifunc-1a.o tmpdir/ifunc-1b.o \

View File

@ -163,7 +163,7 @@ run_cc_link_tests [list \
] \ ] \
] ]
run_ld_link_exec_tests [] [list \ run_ld_link_exec_tests [list \
[list \ [list \
"No PLT (dynamic 1a)" \ "No PLT (dynamic 1a)" \
"tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \ "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 \ [list \
"Run pr20244-3a" \ "Run pr20244-3a" \
"tmpdir/pr20244-3a.o tmpdir/pr20244-3b.o \ "tmpdir/pr20244-3a.o tmpdir/pr20244-3b.o \

View File

@ -67,7 +67,7 @@ run_cc_link_tests [list \
] \ ] \
] ]
run_ld_link_exec_tests [] [list \ run_ld_link_exec_tests [list \
[list \ [list \
"TLS GD/LD -> LE transition without PLT (dynamic)" \ "TLS GD/LD -> LE transition without PLT (dynamic)" \
"tmpdir/tls-def1.o tmpdir/tls-main1.o tmpdir/tls-gd1.o \ "tmpdir/tls-def1.o tmpdir/tls-main1.o tmpdir/tls-gd1.o \

View File

@ -386,7 +386,7 @@ run_cc_link_tests [list \
] \ ] \
] ]
run_ld_link_exec_tests [] [list \ run_ld_link_exec_tests [list \
[list \ [list \
"Common symbol override ifunc test 1a" \ "Common symbol override ifunc test 1a" \
"-static" \ "-static" \
@ -430,7 +430,7 @@ run_cc_link_tests [list \
] \ ] \
] ]
run_ld_link_exec_tests [] [list \ run_ld_link_exec_tests [list \
[list \ [list \
"Run pr16467" \ "Run pr16467" \
"tmpdir/pr16467c.o tmpdir/libpr16467b.so tmpdir/libpr16467a.so" \ "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 \ [list \
"Run pr18808" \ "Run pr18808" \
"tmpdir/pr18808a.o tmpdir/libpr18808.so" \ "tmpdir/pr18808a.o tmpdir/libpr18808.so" \

View File

@ -41,7 +41,7 @@ set array_tests {
{"weak undefined data" "-pie" "" {weakundef-data.c} "weakundef-data" "weakundef.out" "-fPIC"} {"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]] set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
foreach t $test_list { foreach t $test_list {

View File

@ -481,10 +481,10 @@ if ![isnative] {
return return
} }
run_ld_link_exec_tests [] $lto_run_tests run_ld_link_exec_tests $lto_run_tests
if { [is_elf_format] } { 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} { proc pr20103 {cflags libs} {

View File

@ -176,7 +176,7 @@ if { [regexp_diff "tmpdir/dump.out" "$srcdir/$subdir/size-7.out" ] } then {
} }
# Run-time size relocation tests. # Run-time size relocation tests.
run_ld_link_exec_tests [] [list \ run_ld_link_exec_tests [list \
[list \ [list \
"Run size-1" \ "Run size-1" \
"tmpdir/libsize-1.so" \ "tmpdir/libsize-1.so" \

View File

@ -120,7 +120,7 @@ run_ld_link_tests {
{mpx4a.s} {{objdump -dw mpx4.dd}} "mpx4"} {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-branch-1"
run_dump_test "bnd-ifunc-1" run_dump_test "bnd-ifunc-1"

View File

@ -134,7 +134,7 @@ run_cc_link_tests [list \
] \ ] \
] ]
run_ld_link_exec_tests [] [list \ run_ld_link_exec_tests [list \
[list \ [list \
"No PLT (dynamic 1a)" \ "No PLT (dynamic 1a)" \
"tmpdir/no-plt-check1.o tmpdir/no-plt-main1.o \ "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 \ [list \
"Run pr20253-2a" \ "Run pr20253-2a" \
"tmpdir/pr20253-2a.o tmpdir/pr20253-2b.o \ "tmpdir/pr20253-2a.o tmpdir/pr20253-2b.o \

View File

@ -67,7 +67,7 @@ run_cc_link_tests [list \
] \ ] \
] ]
run_ld_link_exec_tests [] [list \ run_ld_link_exec_tests [list \
[list \ [list \
"TLS GD/LD -> LE transition without PLT (dynamic)" \ "TLS GD/LD -> LE transition without PLT (dynamic)" \
"tmpdir/tls-def1.o tmpdir/tls-main1.o tmpdir/tls-gd1.o \ "tmpdir/tls-def1.o tmpdir/tls-main1.o tmpdir/tls-gd1.o \

View File

@ -559,7 +559,7 @@ proc undefined_weak {cflags ldflags} {
exec cp tmpdir/libpr19704a.so tmpdir/libpr19704.so exec cp tmpdir/libpr19704a.so tmpdir/libpr19704.so
run_ld_link_exec_tests [] [list \ run_ld_link_exec_tests [list \
[list \ [list \
"Run pr19704" \ "Run pr19704" \
"$ldflags tmpdir/libpr19704.so -R tmpdir" \ "$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 \ [list \
"Run plt-main" \ "Run plt-main" \
"tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \ "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 \ [list \
"Run plt-main with -z bndplt" \ "Run plt-main with -z bndplt" \
"tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \ "tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \

View File

@ -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 # ldtests contains test-items with 3 items followed by 1 lists, 2 items
# and 3 optional items: # and 3 optional items:
# 0:name # 0:name
@ -1379,8 +1378,9 @@ if ![string length [info proc prune_warnings]] {
# 6:compiler flags (optional) # 6:compiler flags (optional)
# 7:language (optional) # 7:language (optional)
# 8:linker warning (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 ld
global as global as
global srcdir global srcdir
@ -1394,7 +1394,7 @@ proc run_ld_link_exec_tests { targets_to_xfail ldtests } {
global exec_output global exec_output
foreach testitem $ldtests { foreach testitem $ldtests {
foreach target $targets_to_xfail { foreach target $args {
setup_xfail $target setup_xfail $target
} }
set testname [lindex $testitem 0] set testname [lindex $testitem 0]