]> oss.titaniummirror.com Git - msp430-binutils.git/blobdiff - ld/testsuite/ld-selective/selective.exp
Imported binutils-2.20
[msp430-binutils.git] / ld / testsuite / ld-selective / selective.exp
index dc7e9b80f989e084f489cb3a7d4dd8d93a356331..b563d355b2fcc0075eca5877671672f6cb963590 100644 (file)
@@ -1,5 +1,5 @@
 # Expect script for LD selective linking tests
-#   Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007
+#   Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009
 #   Free Software Foundation, Inc.
 #
 # This file is part of the GNU Binutils.
@@ -27,8 +27,15 @@ if ![is_elf_format] {
     return
 }
 
-# Alpha and IA64 do not support selective linking
-if {[istarget "alpha*-*-*"] || [istarget "ia64-*-*"]} {
+# These targets do not support selective linking
+if {[istarget "alpha*-*-*"] || [istarget "am33*-*-*"] ||
+    [istarget "arc-*-*"] || [istarget "d30v-*-*"] ||
+    [istarget "dlx-*-*"] || [istarget "hppa*64*-*-*"] ||
+    [istarget "i370-*-*"] || [istarget "i860-*-*"] ||
+    [istarget "i960-*-*"] || [istarget "ia64-*-*"] ||
+    [istarget "m88*-*-*"] || [istarget "mn10200-*-*"] ||
+    [istarget "mep-*-*"] || [istarget "or32-*-*"] ||
+    [istarget "pj*-*-*"]} {
     return
 }
 
@@ -71,7 +78,7 @@ if [istarget sh64*-*-elf] {
 }
 
 # If we don't have g++ for the target, mark all tests as untested.
-if { [which $CXX] == 0 } {
+if { ![is_remote host] && [which $CXX] == 0 } {
     foreach testitem $seltests {
        untested "[lindex $testitem 0]"
     }
@@ -100,41 +107,48 @@ foreach testitem $seltests {
     # It's either C or C++ at the moment.
     if { $testtype == "C++" } {
        set testflags "$cflags $cxxflags"
-       if [string match "*gcc*" [lindex $CC 0]] {
-           # Starting with 3.4.0, -fvtable-gc is no longer supported and thus
-           # the functionality we try to test for cannot be expected to work.
-           catch "exec -- $CC -dumpversion" version
-           if [regexp "^(\[1-9\]\[0-9\]+|\[4-9\]|3.(\[1-9\]\[0-9\]+|\[4-9\]))\\." $version] {
-               setup_xfail {*-*-*}
-           }
+       set compiler "$CXX"
+       # Starting with 3.4.0, -fvtable-gc is no longer supported and thus
+       # the functionality we try to test for cannot be expected to work.
+       set version [remote_exec host "$CXX -dumpversion"]
+       set version [lindex $version 1]
+       if [regexp "^(\[1-9\]\[0-9\]+|\[4-9\]|3.(\[1-9\]\[0-9\]+|\[4-9\]))\\." $version] {
+           setup_xfail {*-*-*}
        }
-    } {
+    } else {
        set testflags "$cflags"
+       set compiler "$CC"
     }
 
     # Note that we do not actually *use* CXX; we just add cxxflags for C++
     # tests.  It might have been a buglet originally; now I think better
     # leave as is.
-    if { ![ld_compile "$CC $testflags" $srcdir/$subdir/$testfile $objfile] } {
+    if { ![ld_compile "$compiler $testflags" $srcdir/$subdir/$testfile $objfile] } {
        unresolved $testname
        continue
     }
 
     # V850 targets need libgcc.a
     if [istarget v850*-*-elf] {
-       catch "exec $CC -print-libgcc-file-name" libgcc
+       set libgcc [remote_exec host "$compiler -print-libgcc-file-name"]
+       set libgcc [lindex $libgcc 1]
+       regsub -all "\[\r\n\]" $libgcc "" libgcc
        set objfile "$objfile $libgcc"
     }
 
     # ARM targets need libgcc.a in THUMB mode so that __call_via_r3 is provided
     if {[istarget arm-*-*] || [istarget xscale-*-*]} {
-       catch "exec $CC -print-libgcc-file-name" libgcc
+       set libgcc [remote_exec host "$compiler -print-libgcc-file-name"]
+       set libgcc [lindex $libgcc 1]
+       regsub -all "\[\r\n\]" $libgcc "" libgcc
        set objfile "$objfile $libgcc"
     }
 
     # HPPA linux targets need libgcc.a for millicode routines ($$dyncall).
     if [istarget hppa*-*-linux*] {
-       catch "exec $CC -print-libgcc-file-name" libgcc
+       set libgcc [remote_exec host "$compiler -print-libgcc-file-name"]
+       set libgcc [lindex $libgcc 1]
+       regsub -all "\[\r\n\]" $libgcc "" libgcc
        set objfile "$objfile $libgcc"
     }