Run more ld tests when not native
[deliverable/binutils-gdb.git] / ld / testsuite / ld-unique / unique.exp
index 3a4ce2272f34afebe8975a8f3e914f5e453ca234..668ac953777caba3dfa5ead811d481793f37cf78 100644 (file)
@@ -37,15 +37,6 @@ if { ![supports_gnu_unique] } {
 
 run_dump_test "unique"
 
-# We need a native system.  FIXME: Strictly speaking this
-# is not true, we just need to know how to create a fully
-# linked executable, including the C and Z libraries, using
-# the linker that is under test.
-if ![isnative] {
-    verbose "UNIQUE compiled tests not run - not a native toolchain"
-    return
-}
-
 # We need a working compiler.  (Strictly speaking this is
 # not true, we could use target specific assembler files).
 if { [which $CC] == 0 } {
@@ -124,25 +115,25 @@ if ![ld_compile "$CC -c -fPIC" "$srcdir/$subdir/unique_shared.s" "tmpdir/unique_
 }
 
 # Create executable containing unique symbol.
-if ![default_ld_link $ld "tmpdir/unique_prog" "tmpdir/unique.o"] {
+if ![ld_link $CC "tmpdir/unique_prog" "tmpdir/unique.o"] {
     fail "Could not link a unique executable"
     set fails [expr $fails + 1]
 }
 
 # Create shared library containing unique symbol.
-if ![ld_simple_link $ld "tmpdir/libunique_shared.so" "-shared tmpdir/unique_shared.o"] {
+if ![ld_link $ld "tmpdir/libunique_shared.so" "-shared tmpdir/unique_shared.o"] {
     fail "Could not create a shared library containing an unique symbol"
     set fails [expr $fails + 1]
 }
 
 # Create executable NOT containing unique symbol linked against library.
-if ![default_ld_link $ld "tmpdir/unique_shared_prog" "-Ltmpdir tmpdir/unique_empty.o -Bdynamic -lunique_shared -rpath ./tmpdir"] {
+if ![ld_link $CC "tmpdir/unique_shared_prog" "-Ltmpdir tmpdir/unique_empty.o -Wl,-Bdynamic,-rpath=./tmpdir -lunique_shared"] {
     fail "Could not link a dynamic executable"
     set fails [expr $fails + 1]
 }
 
 # Create shared library containing unique symbol with reference.
-if ![ld_simple_link $ld "tmpdir/libunique_shared_ref.so" "-shared tmpdir/unique_shared.o tmpdir/unique_empty.o"] {
+if ![ld_link $ld "tmpdir/libunique_shared_ref.so" "-shared tmpdir/unique_shared.o tmpdir/unique_empty.o"] {
     fail "Could not create a shared library containing an unique symbol with reference"
     set fails [expr $fails + 1]
 }
@@ -182,8 +173,12 @@ if { $fails == 0 } {
 }
 
 # Check the empty object file.
-if {! [check_osabi tmpdir/unique_empty.o {UNIX - System V}]} {
-    fail "Object NOT containing unique does not have an OS/ABI field of System V"
+case $target_triplet in {
+    { hppa*-*-linux* } { set expected_none {UNIX - GNU} }
+    default { set expected_none {UNIX - System V} }
+}
+if {! [check_osabi tmpdir/unique_empty.o $expected_none]} {
+    fail "Object NOT containing unique does not have an OS/ABI field of $expected_none"
     set fails [expr $fails + 1]
 }
 
@@ -238,8 +233,8 @@ if { $fails == 0 } {
 }
 
 # Check the empty executable linked against unique shared library.
-if {! [check_osabi tmpdir/unique_shared_prog {UNIX - System V}]} {
-    fail "Executable NOT containing unique does not have an OS/ABI field of System V"
+if {! [check_osabi tmpdir/unique_shared_prog $expected_none]} {
+    fail "Executable NOT containing unique does not have an OS/ABI field of $expected_none"
     set fails [expr $fails + 1]
 }
 
@@ -251,14 +246,3 @@ if {[contains_unique_symbol tmpdir/unique_shared_prog] == 1} {
 if { $fails == 0 } {
   pass "Checking shared empty executable"
 }
-
-# Clean up, unless we are being verbose, in which case we leave the files available.
-if { $verbose < 1 } {
-    remote_file host delete "tmpdir/unique_empty.o"
-    remote_file host delete "tmpdir/unique.o"
-    remote_file host delete "tmpdir/unique_shared.o"
-    remote_file host delete "tmpdir/libunique_shared.so"
-    remote_file host delete "tmpdir/libunique_shared_ref.so"
-    remote_file host delete "tmpdir/unique_prog"
-    remote_file host delete "tmpdir/unique_shared_prog"
-}
This page took 0.025595 seconds and 4 git commands to generate.