summaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-plugin
diff options
context:
space:
mode:
authorwillnewton <willnewton>2013-04-29 08:57:48 +0000
committerwillnewton <willnewton>2013-04-29 08:57:48 +0000
commit27d87d125b58532115a6b88dc4048fb05a3c8fe3 (patch)
treeb6bf51c31329044451736c23f58b6d1fdb01120a /ld/testsuite/ld-plugin
parent7940d7ea615381d37364e453d61ce509fc0fa4e0 (diff)
downloadbinutils-redhat-27d87d125b58532115a6b88dc4048fb05a3c8fe3.tar.gz
ld-plugin/lto.exp: Disable ld/12942 test for gcc < 4.7.0.
The test for ld/12942 fails with gcc versions before 4.7.0. This patch disables this test with these versions of gcc. ld/testsuite/ChangeLog: 2013-04-29 Will Newton <will.newton@linaro.org> * ld-plugin/lto.exp: Disable ld/12942 test for gcc < 4.7.0.
Diffstat (limited to 'ld/testsuite/ld-plugin')
-rw-r--r--ld/testsuite/ld-plugin/lto.exp50
1 files changed, 31 insertions, 19 deletions
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index 09474a6dfc..c5249f0df2 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -125,12 +125,6 @@ set lto_link_tests {
{"PR ld/12760"
"-O2 -Wl,-e,foo -nostdlib -flto -fuse-linker-plugin tmpdir/pr12760a.o -Wl,--start-group tmpdir/libpr12760.a -Wl,--end-group" ""
{dummy.c} {} "pr12760.exe" "c" "warning: Bad bar"}
- {"Build libdummy.a PR ld/12942 (1)"
- "" "-flto -O2"
- {pr12942a.cc pr12942c.cc} {} "libdummy.a" "c++"}
- {"Build libdummy.a PR ld/12942 (2)"
- "" "-O0"
- {pr12942b.cc} {} "libdummy.a" "c++"}
{"Build libpr13183.a"
"-T" "-flto -O2"
{pr13183a.c} {} "libpr13183.a"}
@@ -148,6 +142,17 @@ set lto_link_tests {
{pr15323a.c} {} "libdummy.a" "c"}
}
+if { [at_least_gcc_version 4 7] } {
+ set lto_link_tests [concat $lto_link_tests {
+ {"Build libdummy.a PR ld/12942 (1)"
+ "" "-flto -O2"
+ {pr12942a.cc pr12942c.cc} {} "libdummy.a" "c++"}
+ {"Build libdummy.a PR ld/12942 (2)"
+ "" "-O0"
+ {pr12942b.cc} {} "libdummy.a" "c++"}
+ }]
+}
+
# Generate input files for complex LTO tests for ELF.
set lto_link_elf_tests {
{"Build libdummy.a 7"
@@ -257,12 +262,6 @@ set lto_run_tests {
{"LTO 15"
"-O2 -flto -fuse-linker-plugin -Wl,--start-group tmpdir/liblto-15.a tmpdir/lto-15a.o -Wl,--end-group" ""
{dummy.c} "lto-15.exe" "lto-15.out" "" "c"}
- {"PR ld/12942 (1)"
- "-O2 -flto -fuse-linker-plugin tmpdir/pr12942a.o tmpdir/pr12942b.o" ""
- {dummy.c} "pr12942a.exe" "pr12942.out" "" "c++"}
- {"PR ld/12942 (2)"
- "-O2 -flto -fuse-linker-plugin tmpdir/pr12942a.o tmpdir/pr12942c.o" ""
- {dummy.c} "pr12942c.exe" "pr12942.out" "" "c++"}
{"PR ld/13066"
"-O2 -flto -fuse-linker-plugin" ""
{pr13066.cc} "pr13066.exe" "pr13066.out" "" "c++"}
@@ -274,6 +273,17 @@ set lto_run_tests {
{pr15323b.c} "pr15323.exe" "pr15323.out" "-flto -O2" "c"}
}
+if { [at_least_gcc_version 4 7] } {
+ set lto_run_tests [concat $lto_run_tests {
+ {"PR ld/12942 (1)"
+ "-O2 -flto -fuse-linker-plugin tmpdir/pr12942a.o tmpdir/pr12942b.o" ""
+ {dummy.c} "pr12942a.exe" "pr12942.out" "" "c++"}
+ {"PR ld/12942 (2)"
+ "-O2 -flto -fuse-linker-plugin tmpdir/pr12942a.o tmpdir/pr12942c.o" ""
+ {dummy.c} "pr12942c.exe" "pr12942.out" "" "c++"}
+ }]
+}
+
# LTO run-time tests for ELF
set lto_run_elf_tests {
{"LTO 7"
@@ -311,13 +321,15 @@ if {![string match "" $catch_output]} {
return
}
-# Check expected LTO linker errors.
-set testname "PR ld/12942 (3)"
-set exec_output [run_host_cmd "$CXX" "$gcc_gas_flag $gcc_ld_flag -O2 -flto -fuse-linker-plugin tmpdir/pr12942b.o tmpdir/pr12942a.o"]
-if { [ regexp "undefined reference to `link_error\\(\\)'" $exec_output ] } {
- pass $testname
-} {
- fail $testname
+if { [at_least_gcc_version 4 7] } {
+ # Check expected LTO linker errors.
+ set testname "PR ld/12942 (3)"
+ set exec_output [run_host_cmd "$CXX" "$gcc_gas_flag $gcc_ld_flag -O2 -flto -fuse-linker-plugin tmpdir/pr12942b.o tmpdir/pr12942a.o"]
+ if { [ regexp "undefined reference to `link_error\\(\\)'" $exec_output ] } {
+ pass $testname
+ } {
+ fail $testname
+ }
}
# Run "ld -r" to generate inputs for complex LTO tests.