diff options
Diffstat (limited to 'ld/testsuite/ld-elfvsb/elfvsb.exp')
-rw-r--r-- | ld/testsuite/ld-elfvsb/elfvsb.exp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/ld/testsuite/ld-elfvsb/elfvsb.exp b/ld/testsuite/ld-elfvsb/elfvsb.exp index 5331ad5..9d590c74 100644 --- a/ld/testsuite/ld-elfvsb/elfvsb.exp +++ b/ld/testsuite/ld-elfvsb/elfvsb.exp @@ -24,6 +24,11 @@ # Make sure that ld can generate ELF shared libraries with visibility. +# Check to see if the C compiler works +if { [which $CC] == 0 } { + return +} + # This test can only be run on a couple of ELF platforms. # Square bracket expressions seem to confuse istarget. if { ![istarget hppa*64*-*-hpux*] \ @@ -56,9 +61,6 @@ foreach t $test_list { run_dump_test [file rootname $t] } -# The remaining tests can only be run if ld generates native executables. -if ![isnative] then {return} - set tmpdir tmpdir set SHCFLAG "" set shared_needs_pic "no" @@ -121,7 +123,7 @@ if { [istarget *-*-linux*] || [istarget *-*-nacl*] || [istarget *-*-gnu*] } { if [ld_compile "$CC -g $CFLAGS -DPROTECTED_CHECK" $srcdir/$subdir/main.c $tmpdir/main.o] { - if [ld_simple_link $CC $tmpdir/main "$tmpdir/main.o"] { + if [ld_link $CC $tmpdir/main "$tmpdir/main.o"] { catch "exec $tmpdir/main" support_protected } } @@ -145,7 +147,7 @@ proc visibility_test { visibility progname testname main sh1 sh2 dat args } { if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } { set shared "-bM:SRE -bE:$tmpdir/xcoff.exp" } - if {![ld_simple_link $CC $tmpdir/$progname.so "$shared $shldflags $tmpdir/$sh1 $tmpdir/$sh2"]} { + if {![ld_link $CC $tmpdir/$progname.so "$shared $shldflags $tmpdir/$sh1 $tmpdir/$sh2"]} { if { [ string match $visibility "hidden_undef" ] && [regexp "undefined reference to \`\.?visibility\'" $link_output] && [regexp "undefined reference to \`visibility_var\'" $link_output] } { @@ -168,7 +170,7 @@ proc visibility_test { visibility progname testname main sh1 sh2 dat args } { if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } { set rpath /lib:$tmpdir } - if ![ld_simple_link $CC $tmpdir/$progname "-Wl,-rpath,$rpath $tmpdir/$main $tmpdir/$progname.so"] { + if ![ld_link $CC $tmpdir/$progname "-Wl,-rpath,$rpath $tmpdir/$main $tmpdir/$progname.so"] { if { [ string match $visibility "hidden" ] && [regexp "undefined reference to \`\.?visibility\'" $link_output] && [regexp "undefined reference to \`visibility_var\'" $link_output] } { @@ -191,6 +193,11 @@ proc visibility_test { visibility progname testname main sh1 sh2 dat args } { fail "$testname" } + if ![isnative] { + unsupported "$testname" + return + } + # Run the resulting program send_log "$tmpdir/$progname >$tmpdir/$progname.out\n" verbose "$tmpdir/$progname >$tmpdir/$progname.out" @@ -502,7 +509,7 @@ visibility_run normal if { ![ld_compile "$CC -g $CFLAGS" $srcdir/$subdir/common.c tmpdir/common.o] } { unresolved "common hidden symbol" } else { - if ![ld_simple_link $ld tmpdir/common "tmpdir/common.o"] { + if ![ld_link $ld tmpdir/common "tmpdir/common.o"] { fail "common hidden symbol" } else { pass "common hidden symbol" @@ -515,15 +522,15 @@ if { ![ld_compile "$CC -g $CFLAGS" $srcdir/$subdir/test.c tmpdir/test.o] } { if { ![ld_compile "$CC -g $CFLAGS -DSHARED $picflag" $srcdir/$subdir/sh3.c tmpdir/sh3.o] } { unresolved "weak hidden symbol" } else { - if ![ld_simple_link $ld tmpdir/sh3.so "-shared tmpdir/sh3.o"] { + if ![ld_link $ld tmpdir/sh3.so "-shared tmpdir/sh3.o"] { fail "weak hidden symbol" } else { - if ![ld_simple_link $ld tmpdir/weak "tmpdir/test.o tmpdir/sh3.o"] { + if ![ld_link $ld tmpdir/weak "tmpdir/test.o tmpdir/sh3.o"] { fail "weak hidden symbol DSO last" } else { pass "weak hidden symbol DSO last" } - if ![ld_simple_link $ld tmpdir/weak "tmpdir/sh3.so tmpdir/test.o"] { + if ![ld_link $ld tmpdir/weak "tmpdir/sh3.so tmpdir/test.o"] { fail "weak hidden symbol DSO first" } else { pass "weak hidden symbol DSO first" |