]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - ld/testsuite/ld-elfweak/elfweak.exp
Run more ld tests when not native
[thirdparty/binutils-gdb.git] / ld / testsuite / ld-elfweak / elfweak.exp
index 88df1802f49bff7cea921c353b8245e0ca6106ae..e62291e142c2aa38280a547b822a87816d1145bc 100644 (file)
 #           Eric Youngdale (eric@andante.jic.com)
 #
 
-# This test can only be run if ld generates native executables.
-if ![isnative] then {return}
+# 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.
@@ -290,7 +292,7 @@ proc build_lib {test libname objs dynsymexp} {
       set files "$files $tmpdir/$obj"
     }
 
-    if {![ld_simple_link $CC $tmpdir/$libname.so "$shared $files"]} {
+    if {![ld_link $CC $tmpdir/$libname.so "$shared $files"]} {
        fail $test
        return
     }
@@ -316,7 +318,7 @@ proc build_exec { test execname objs flags dat dynsymexp symexp} {
       set files "$files $tmpdir/$obj"
     }
 
-    if {![ld_simple_link $CC $tmpdir/$execname "$flags $files"]} {
+    if {![ld_link $CC $tmpdir/$execname "$flags $files"]} {
        fail "$test"
        return
     }
@@ -335,6 +337,10 @@ proc build_exec { test execname objs flags dat dynsymexp symexp} {
        }
     }
 
+    if ![isnative] {
+       unsupported $test
+       return
+    }
     # Run the resulting program
     send_log "$tmpdir/$execname >$tmpdir/$execname.out\n"
     verbose "$tmpdir/$execname >$tmpdir/$execname.out"
@@ -402,7 +408,7 @@ if ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/main.c $tmpdir/main.o] {
     return
 }
 
-if {![ld_simple_link $CC $tmpdir/libbar.so "$shared $tmpdir/bar.o"]} {
+if {![ld_link $CC $tmpdir/libbar.so "$shared $tmpdir/bar.o"]} {
     fail "ELF weak"
     return
 }
@@ -437,17 +443,17 @@ if ![ld_compile "$CC $CFLAGS $picflag" $srcdir/$subdir/main1.c $tmpdir/main1.o]
     return
 }
 
-if {![ld_simple_link $CC $tmpdir/libfoo1a.so "$shared $tmpdir/foo1a.o"]} {
+if {![ld_link $CC $tmpdir/libfoo1a.so "$shared $tmpdir/foo1a.o"]} {
     fail "ELF weak"
     return
 }
 
-if {![ld_simple_link $CC $tmpdir/libfoo1b.so "$shared $tmpdir/foo1b.o"]} {
+if {![ld_link $CC $tmpdir/libfoo1b.so "$shared $tmpdir/foo1b.o"]} {
     fail "ELF weak"
     return
 }
 
-if {![ld_simple_link $CC $tmpdir/libbar1a.so "$shared $tmpdir/bar1a.o $tmpdir/libfoo1a.so"]} {
+if {![ld_link $CC $tmpdir/libbar1a.so "$shared $tmpdir/bar1a.o $tmpdir/libfoo1a.so"]} {
     fail "ELF weak"
     return
 }