diff options
Diffstat (limited to 'ld/testsuite/ld-plugin/lto.exp')
-rw-r--r-- | ld/testsuite/ld-plugin/lto.exp | 58 |
1 files changed, 52 insertions, 6 deletions
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp index 556bbe9..9ac3cf6 100644 --- a/ld/testsuite/ld-plugin/lto.exp +++ b/ld/testsuite/ld-plugin/lto.exp @@ -51,6 +51,11 @@ if { [check_lto_fat_available] } { set no_lto "-fno-lto" } +set as_gsframe "" +if { [gas_sframe_check] } { + set as_gsframe "-Wa,--gsframe" +} + # Simple LTO tests and generate input files for complex LTO tests. set lto_link_tests [list \ [list "LTO 1" \ @@ -76,10 +81,10 @@ set lto_link_tests [list \ "" "-flto $lto_fat" \ {lto-4a.c} {} ""] \ [list "Compile 4b" \ - "" "-O2" \ + "" "-O2 $as_gsframe" \ {lto-4b.c} {} ""] \ [list "Compile 4c" \ - "" "-O2" \ + "" "-O2 $as_gsframe" \ {lto-4c.c} {} ""] \ [list "Compile 5a" \ "" "-flto $lto_fat" \ @@ -477,6 +482,12 @@ set lto_link_elf_tests [list \ [list {liblto-19.so} \ {-shared tmpdir/lto-19b.o tmpdir/liblto-19.a} {-O2 -fPIC} \ {dummy.c} {} {liblto-19.so}] \ + [list {liblto-20_static.a} \ + {} {-fPIC} \ + {lto-20b.c} {} {liblto-20_static.a}] \ + [list {liblto-20.so} \ + {-shared -Wl,--version-script=lto-20.ver} {-DSHARED -fPIC} \ + {lto-20b.c} {} {liblto-20.so}] \ [list {pr26806.so} \ {-shared} {-fpic -O2 -flto} \ {pr26806.c} {{nm {-D} pr26806.d}} {pr26806.so}] \ @@ -880,6 +891,10 @@ set lto_run_elf_shared_tests [list \ {-Wl,--as-needed,-R,tmpdir} {} \ {lto-19c.c} {lto-19.exe} {pass.out} {-flto -O2} {c} {} \ {tmpdir/liblto-19.so tmpdir/liblto-19.a}] \ + [list {lto-20} \ + {-Wl,--as-needed,-R,tmpdir} {} \ + {lto-20a.c} {lto-20.exe} {pass.out} {-flto} {c} {} \ + {tmpdir/liblto-20.so tmpdir/liblto-20_static.a -Wl,--no-as-needed}] \ [list {pr31482a} \ {-Wl,--no-as-needed,-R,tmpdir} {} \ {pr31482a.c} {pr31482a.exe} {pass.out} {-flto} {c} {} \ @@ -994,7 +1009,7 @@ run_cc_link_tests [list \ set board_flags [get_board_flags] set exec_output [run_host_cmd "sh" \ - "-c \"ulimit -n 20; \ + "-c \"ulimit -n 25; \ $CC_FOR_TARGET $gcc_B_opt $CFLAGS_FOR_TARGET \ $board_flags $ld_L_opt -o tmpdir/pr28138 \ tmpdir/pr28138.o tmpdir/pr28138.a\""] @@ -1148,9 +1163,8 @@ remote_exec host "mv" "tmpdir/dump tmpdir/lto-5.o" run_dump_test "lto-10r" remote_exec host "mv" "tmpdir/dump tmpdir/lto-10.o" set testname "nm mixed object" -set lto_plugin [string trim [run_host_cmd "$CC_FOR_TARGET" "-print-prog-name=liblto_plugin.so"]] -if { [ regexp "liblto_plugin.so" $lto_plugin ] } { - set exec_output [run_host_cmd "$NM" "--plugin $lto_plugin tmpdir/lto-10.o"] +if { $plug_opt != "" } { + set exec_output [run_host_cmd "$NM" "$plug_opt tmpdir/lto-10.o"] if { [ regexp "(D|T) main" $exec_output ] } { pass $testname } else { @@ -1202,6 +1216,38 @@ if { [is_elf_format] } { if { [is_elf_format] && [check_lto_shared_available] } { run_ld_link_exec_tests $lto_run_elf_shared_tests + if { [check_lto_fat_available] } { + run_cc_link_tests [list \ + [list \ + "Build libpr32846a.a" \ + "$plug_opt" "-fPIC -O2 -flto $lto_no_fat" \ + {pr32846a.c pr32846b.c} {} "libpr32846a.a" \ + ] \ + [list \ + "Build libpr32846b.a" \ + "$plug_opt" "-fPIC -O2 -flto $lto_no_fat" \ + {pr32846a.c pr32846b.c pr32846c.c} {} "libpr32846b.a" \ + ] \ + [list \ + "Build pr32846d.o" \ + "$plug_opt" "-fPIC -O2 -flto $lto_no_fat" \ + {pr32846d.c} {} \ + ] \ + [list \ + "Build pr32846e.o" \ + "$plug_opt" "-fPIC -O2 -flto $lto_no_fat" \ + {pr32846e.c} {} \ + ] \ + [list \ + "Build pr32846" \ + "-shared -fPIC -O2 -flto $lto_no_fat -Wl,--no-undefined \ + tmpdir/pr32846d.o tmpdir/libpr32846a.a \ + tmpdir/libpr32846b.a tmpdir/pr32846e.o" \ + "-O2 -fPIC -flto $lto_no_fat" \ + {dummy.c} {} "pr32846" \ + ] \ + ] \ + } } proc pr20103 {cflags libs} { |