From 2810e26c6afef9ada4446fda70bfa621dcf52d35 Mon Sep 17 00:00:00 2001 From: Will Newton Date: Mon, 29 Apr 2013 08:57:48 +0000 Subject: [PATCH] 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 * ld-plugin/lto.exp: Disable ld/12942 test for gcc < 4.7.0. --- ld/testsuite/ChangeLog | 4 +++ ld/testsuite/ld-plugin/lto.exp | 50 +++++++++++++++++++++------------- 2 files changed, 35 insertions(+), 19 deletions(-) diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 7ed0242cb13..0d1e999e45d 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2013-04-29 Will Newton + + * ld-plugin/lto.exp: Disable ld/12942 test for gcc < 4.7.0. + 2013-04-22 Alan Modra * ld-powerpc/tlsexe.d: Adjust for section id changes. diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp index 09474a6dfce..c5249f0df24 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. -- 2.30.2