Use variable args in run_ld_link_exec_tests
authorAlan Modra <amodra@gmail.com>
Thu, 21 Jul 2016 00:06:37 +0000 (09:36 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 21 Jul 2016 02:04:45 +0000 (11:34 +0930)
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.

19 files changed:
ld/ChangeLog
ld/testsuite/ld-elf/compress.exp
ld/testsuite/ld-elf/dwarf.exp
ld/testsuite/ld-elf/elf.exp
ld/testsuite/ld-elf/indirect.exp
ld/testsuite/ld-elf/shared.exp
ld/testsuite/ld-elf/wrap.exp
ld/testsuite/ld-i386/i386.exp
ld/testsuite/ld-i386/no-plt.exp
ld/testsuite/ld-i386/tls.exp
ld/testsuite/ld-ifunc/ifunc.exp
ld/testsuite/ld-pie/pie.exp
ld/testsuite/ld-plugin/lto.exp
ld/testsuite/ld-size/size.exp
ld/testsuite/ld-x86-64/mpx.exp
ld/testsuite/ld-x86-64/no-plt.exp
ld/testsuite/ld-x86-64/tls.exp
ld/testsuite/ld-x86-64/x86-64.exp
ld/testsuite/lib/ld-lib.exp

index ad26f6201568ca0d47756c9edbbcc858afa47a00..291e6bda7e0ac58042ada0780689b3ff6b9e520d 100644 (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>
 
        * testsuite/lib/ld-lib.exp (run_ld_link_tests): Add optional
 2016-07-21  Alan Modra  <amodra@gmail.com>
 
        * testsuite/lib/ld-lib.exp (run_ld_link_tests): Add optional
index af1a76d0e6ca8cee9f16940cd636acf0beae6adc..3d2378bbe72eb7acbd17cf83488f6fb9dd720d2c 100644 (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"
 send_log "cmp tmpdir/libfoo.so tmpdir/libfoozlib.so\n"
 
 set test_name "Link with zlib-gabi compressed debug input"
 send_log "cmp tmpdir/libfoo.so tmpdir/libfoozlib.so\n"
index 32a492300360d861290b4aeccd1e5fc586e42a6a..17a6923736996feb067991f8a518fe051677047a 100644 (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 {} {
     global ld
 
 proc strip_test {} {
     global ld
index b67105fa4413aba45bfcb363f3e1464c48d0bb9c..872e7f14f52242fb2a3286a7fee7128b5f388996 100644 (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*"]
-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*] } {
 
 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.*$ {
 # 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
 
 catch "exec rm -f tmpdir/preinit tmpdir/init tmpdir/fini tmpdir/init-mixed" status
index 1a01279654165c4ee86b88f491e91dbd1d4e42e0..b4766fd8f870925836160354c1d00909d791fc17 100644 (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
index ac782f8b081208c399de0669fc07729b16a861ea..f3b6f18a09c28bd14400d741fe2db19fe88a0b71 100644 (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
 set testname "--no-add-needed"
 
 # 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_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*]
 
 if { [istarget *-*-linux*]
      || [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 \
            "Run pr2404 with PIE" \
            "-pie tmpdir/pr2404b.o tmpdir/libpr2404a.so" \
        [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
 
     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" \
        [list \
            "Run $exe fun defined" \
            "$ldflags tmpdir/libpr19719b.o tmpdir/libpr19719.so -rpath tmpdir" \
index ea4e1d1ec586fb0287dedaa3e12209bb6992ba65..55dcf3e4b8c9274b21285204f1dee2a07ecaf115 100644 (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
index 9efe406b9b5d666b975a268c7cea40ddac27684f..2ba0f054d9cdf16d2071ebdd5401ac33be1a2035 100644 (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 \
            "Run pr19704" \
            "$ldflags tmpdir/libpr19704.so -R tmpdir" \
        [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 \
        [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 \
        [list \
            "Run ifunc-1a" \
            "tmpdir/ifunc-1a.o tmpdir/ifunc-1b.o \
index 377253ce3b499c598ef08c2c16861e8550d26843..1a7fe7e37ea687d5c12607470dac813a46b07ac3 100644 (file)
@@ -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 \
     [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 \
        [list \
            "Run pr20244-3a" \
            "tmpdir/pr20244-3a.o tmpdir/pr20244-3b.o \
index 593c0e801641bef23d8fd6d42db801335278052f..4c14a937419f0d65511b238691abd469620eaf75 100644 (file)
@@ -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 \
     [list \
        "TLS GD/LD -> LE transition without PLT (dynamic)" \
        "tmpdir/tls-def1.o tmpdir/tls-main1.o tmpdir/tls-gd1.o \
index e860f36d87c831f2be2c9b9d5661cc4c340fc19f..c3c9379cc4854aee2243298ee70f981399a17fdd 100644 (file)
@@ -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" \
     [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" \
     [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" \
     [list \
        "Run pr18808" \
        "tmpdir/pr18808a.o tmpdir/libpr18808.so" \
index 834d5ee76ad9c913e926af09411813da27abb51b..3495da503439d657eda51847fe295ca15629f554 100644 (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]]
 foreach t $test_list {
 
 set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
 foreach t $test_list {
index 4ed163ea466b91c6665a3774814175c0dda839e4..29f211712e6c97a6d70830e1b68a8afc0cdd5091 100644 (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} {
index 949f563885bb0a6b27e8df7176fc38ba47187c2d..cc21a3f7b5cf8b559234ea7f68d580e942f4cf16 100644 (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 \
        "Run size-1" \
        "tmpdir/libsize-1.so" \
     [list \
        "Run size-1" \
        "tmpdir/libsize-1.so" \
index 72be4af82c6e5e137f55b165273e22dc7eb6a860..493e7a6afcb531329ffc5aa716d83ae7b2cb13c2 100644 (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-ifunc-1"
 
 run_dump_test "bnd-branch-1"
 run_dump_test "bnd-ifunc-1"
index bdf1843d52ff493f7b170a0e404ab7a374b63eed..e7ab81339d85fa7acd5f6d3167468c6607a55ce8 100644 (file)
@@ -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 \
     [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 \
        [list \
            "Run pr20253-2a" \
            "tmpdir/pr20253-2a.o tmpdir/pr20253-2b.o \
index c5a70dc03c7f33d9891371cd356c05c2e6dc8823..0988179d10e6b5d1cccdea32ac5c9741b37b4446 100644 (file)
@@ -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 \
     [list \
        "TLS GD/LD -> LE transition without PLT (dynamic)" \
        "tmpdir/tls-def1.o tmpdir/tls-main1.o tmpdir/tls-gd1.o \
index f6f89e2aadb76cb3a3e446ed8b263bc44d8cf31b..5fa4c9f2da9b1d8389ae5ba181567163e823bd82 100644 (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 \
            "Run pr19704" \
            "$ldflags tmpdir/libpr19704.so -R tmpdir" \
        [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 \
        [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 \
            [list \
                "Run plt-main with -z bndplt" \
                "tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \
index 9cd1959fa1e0177811819508ef5b8dbd215207cf..cd9e930cab9a637fa402730659ba7a86dc99a735 100644 (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
 # and 3 optional items:
 #   0:name
 # 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)
 #   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
     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 {
     global exec_output
 
     foreach testitem $ldtests {
-       foreach target $targets_to_xfail {
+       foreach target $args {
            setup_xfail $target
        }
        set testname [lindex $testitem 0]
            setup_xfail $target
        }
        set testname [lindex $testitem 0]
This page took 0.040445 seconds and 4 git commands to generate.