aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
authorDave Korn <dave.korn@artimi.com>2010-10-15 16:07:06 +0000
committerDave Korn <dave.korn@artimi.com>2010-10-15 16:07:06 +0000
commitc3842ce50ee3621b3289c1fbd64860c4e8c0cbd8 (patch)
tree08f0cbb4e6679c996344c5da02a2767c27da434e /ld/testsuite
parentdae714134c1f5195c20b392cfe1005cee9654b5f (diff)
downloadbinutils-c3842ce50ee3621b3289c1fbd64860c4e8c0cbd8.zip
binutils-c3842ce50ee3621b3289c1fbd64860c4e8c0cbd8.tar.gz
binutils-c3842ce50ee3621b3289c1fbd64860c4e8c0cbd8.tar.bz2
Avoid testsuite errors when no cross compiler is available.
ld/testsuite/ChangeLog: * ld-plugin/plugin.exp: Don't error out if there is no target compiler available, make tests UNSUPPORTED instead.
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ChangeLog5
-rw-r--r--ld/testsuite/ld-plugin/plugin.exp20
2 files changed, 20 insertions, 5 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 654446c..4b03104 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2010-10-15 Dave Korn <dave.korn.cygwin@gmail.com>
+
+ * ld-plugin/plugin.exp: Don't error out if there is no target compiler
+ available, make tests UNSUPPORTED instead.
+
2010-10-14 Dave Korn <dave.korn.cygwin@gmail.com>
Apply LD plugin patch series (part 6/6).
diff --git a/ld/testsuite/ld-plugin/plugin.exp b/ld/testsuite/ld-plugin/plugin.exp
index 796cb0e..416159a 100644
--- a/ld/testsuite/ld-plugin/plugin.exp
+++ b/ld/testsuite/ld-plugin/plugin.exp
@@ -24,6 +24,13 @@ if ![check_plugin_api_available] {
return
}
+# And a compiler to be available.
+set can_compile 1
+if { [which $CC] == 0 } {
+ # Don't fail immediately,
+ set can_compile 0
+}
+
pass "plugin API enabled"
global base_dir
@@ -62,12 +69,15 @@ set regcln "-plugin-opt registercleanup"
set failed_compile 0
set _ ""
set plugin_nm_output ""
-if { ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/main.c tmpdir/main.o]
- || ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/func.c tmpdir/func.o]
- || ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/text.c tmpdir/text.o] } {
+if { $can_compile && \
+ (![ld_compile "$CC $CFLAGS" $srcdir/$subdir/main.c tmpdir/main.o] \
+ || ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/func.c tmpdir/func.o] \
+ || ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/text.c tmpdir/text.o]) } {
# Defer fail until we have list of tests set.
set failed_compile 1
-} else {
+}
+
+if { $can_compile && !$failed_compile } {
# Find out if symbols have prefix on this platform before setting tests.
catch "exec $NM tmpdir/func.o" plugin_nm_output
if { [regexp "_func" "$plugin_nm_output"] } {
@@ -142,7 +152,7 @@ set plugin_extra_elf_tests [list \
{readelf -s plugin-vis-1.d}} "main.x" ] \
]
-if { $failed_compile != 0 } {
+if { !$can_compile || $failed_compile } {
foreach testitem $plugin_tests {
unresolved [lindex $testitem 0]
}