Use better test for usable compiler in ld testsuite.
[deliverable/binutils-gdb.git] / ld / testsuite / ld-sh / sh.exp
index ce9dad4e039c1fe9263f7dd355d98ccd94d727ff..1fca64d861225e517fc121c8372d29526a0bb7bd 100644 (file)
@@ -1,5 +1,5 @@
 # Expect script for ld-sh tests
-#   Copyright (C) 1995-2017 Free Software Foundation, Inc.
+#   Copyright (C) 1995-2019 Free Software Foundation, Inc.
 #
 # This file is part of the GNU Binutils.
 #
@@ -28,16 +28,11 @@ if ![istarget sh*-*-*] {
     return
 }
 
-if { ([istarget sh64*-*-*] || [istarget sh5*-*-*])} {
-    # relaxing not supported on sh64 yet.
-    return
-}
-
 set testsimple "SH simple relaxing"
 
 if ![ld_assemble $as "-relax $srcdir/$subdir/sh1.s" tmpdir/sh1.o] {
     unresolved $testsimple
-} else { if ![ld_simple_link $ld tmpdir/sh1 "-relax tmpdir/sh1.o"] {
+} else { if ![ld_link $ld tmpdir/sh1 "-relax tmpdir/sh1.o"] {
     fail $testsimple
 } else {
     if ![ld_nm $nm "" tmpdir/sh1] {
@@ -73,7 +68,7 @@ if { [istarget sh*-linux-*] || [istarget sh-*-vxworks] } {
 } else {
     set srec_relax_arg "-relax --oformat srec tmpdir/sh1.o"
 }
-if ![ld_simple_link $ld tmpdir/sh1.s1 $srec_relax_arg ] {
+if ![ld_link $ld tmpdir/sh1.s1 $srec_relax_arg ] {
     fail $testsrec
 } else {
     # The file name is embedded in the S-records, so create both
@@ -114,7 +109,7 @@ set testadjsw8 "SH switch8 adjustment after relax"
 if ![ld_assemble $as "-relax $srcdir/$subdir/adjsw8.s" tmpdir/adjsw8.o] {
     unresolved $testadjsw8
 } else {
-    if ![ld_simple_link $ld tmpdir/adjsw8 "-relax tmpdir/adjsw8.o"] {
+    if ![ld_link $ld tmpdir/adjsw8 "-relax tmpdir/adjsw8.o"] {
        fail $testadjsw8
     } else {
        send_log "exec $objdump -s tmpdir/adjsw8\n"
@@ -134,7 +129,7 @@ set testlink "SH relaxing"
 set testjsr "SH confirm relaxing"
 set testrun "SH relaxing execution"
 
-if { [which $CC] == 0 } {
+if { ![check_compiler_available] } {
     untested $testlink
     untested $testjsr
     untested $testrun
@@ -156,7 +151,7 @@ if {![ld_assemble $as "-relax tmpdir/start.s" tmpdir/start.o] \
     return
 }
 
-if ![ld_simple_link $ld tmpdir/sh2 "-relax tmpdir/start.o tmpdir/sh2.o"] {
+if ![ld_link $ld tmpdir/sh2 "-relax tmpdir/start.o tmpdir/sh2.o"] {
     fail $testlink
     unresolved $testjsr
     unresolved $testrun
This page took 0.625528 seconds and 4 git commands to generate.