aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2018-01-27 16:04:34 -0800
committerH.J. Lu <hjl.tools@gmail.com>2018-01-27 16:04:34 -0800
commitfef75122c0fe3abafb99d79a63545c1531f4107c (patch)
treef5d5ced02ce4086635d582664b0f0eb056c7de8b /ld/testsuite/lib/ld-lib.exp
parentAutomatic date update in version.in (diff)
downloadbinutils-gdb-fef75122c0fe3abafb99d79a63545c1531f4107c.tar.gz
binutils-gdb-fef75122c0fe3abafb99d79a63545c1531f4107c.tar.bz2
binutils-gdb-fef75122c0fe3abafb99d79a63545c1531f4107c.zip
Add a testcase for PR ld/22751
Since dummy.o must be placed before -Wl,--whole-archive tmpdir/pr22751.a -Wl,--no-whole-archive to trigger the bug, this patch adds an optional trailing ld options to run_ld_link_exec_tests. PR ld/22751 * testsuite/config/default.exp (INT128_CFLAGS): New. * testsuite/ld-plugin/lto.exp (INT128_CFLAGS): New. Run ld/22751 tests. * testsuite/ld-plugin/pr22751.c: New file. * testsuite/lib/ld-lib.exp (run_ld_link_exec_tests): Add ld trailing options.
Diffstat (limited to 'ld/testsuite/lib/ld-lib.exp')
-rw-r--r--ld/testsuite/lib/ld-lib.exp6
1 files changed, 4 insertions, 2 deletions
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index 52baf0b04ce..a892b763984 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -1377,7 +1377,7 @@ if ![string length [info proc prune_warnings]] {
# ldtests contains test-items with 3 items followed by 1 lists, 2 items
# and 3 optional items:
# 0:name
-# 1:ld options
+# 1:ld leading options, placed before object files
# 2:assembler options
# 3:filenames of source files
# 4:name of output file
@@ -1385,6 +1385,7 @@ if ![string length [info proc prune_warnings]] {
# 6:compiler flags (optional)
# 7:language (optional)
# 8:linker warning (optional)
+# 9:ld trailing options, placed after object files (optional)
# args is an optional list of target triplets to be xfailed.
proc run_ld_link_exec_tests { ldtests args } {
@@ -1424,6 +1425,7 @@ proc run_ld_link_exec_tests { ldtests args } {
set cflags [lindex $testitem 6]
set lang [lindex $testitem 7]
set warning [lindex $testitem 8]
+ set ld_after [lindex $testitem 9]
set objfiles {}
set failed 0
@@ -1466,7 +1468,7 @@ proc run_ld_link_exec_tests { ldtests args } {
# compile only
pass $testname
continue;
- } elseif ![$link_proc $link_cmd $binfile "$board_cflags -L$srcdir/$subdir $ld_options $objfiles"] {
+ } elseif ![$link_proc $link_cmd $binfile "$board_cflags -L$srcdir/$subdir $ld_options $objfiles $ld_after"] {
set failed 1
}