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 } {
}
# 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]
}
}
# 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]
}
}
# 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]
}
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"
-}