summaryrefslogtreecommitdiff
path: root/testsuite/lib
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2016-05-23 09:58:51 -0600
committerTom Tromey <tom@tromey.com>2016-05-23 09:58:51 -0600
commit02089a1b5cf3aa1535172c62add454a2e9375066 (patch)
tree73f05d5ac335e731aa364f7bcb4653a2a41bc7c3 /testsuite/lib
parent5d0365c605c472f40d1195cf7ba04ae08e360cb7 (diff)
parentc88455178151bea14b8561ab6830724c31af255e (diff)
downloadlibffi-02089a1b5cf3aa1535172c62add454a2e9375066.tar.gz
Merge pull request #237 from tschwinge/libffi_feature_test
Simplify/fix libffi_feature_test
Diffstat (limited to 'testsuite/lib')
-rw-r--r--testsuite/lib/libffi.exp11
1 files changed, 6 insertions, 5 deletions
diff --git a/testsuite/lib/libffi.exp b/testsuite/lib/libffi.exp
index 6d19393..afc421b 100644
--- a/testsuite/lib/libffi.exp
+++ b/testsuite/lib/libffi.exp
@@ -225,20 +225,21 @@ proc libffi_target_compile { source dest type options } {
# TEST should be a preprocessor condition. Returns true if it holds.
proc libffi_feature_test { test } {
- set src "ffitest.c"
+ set src "ffitest[pid].c"
set f [open $src "w"]
puts $f "#include <ffi.h>"
puts $f $test
- puts $f "xyzzy"
+ puts $f "/* OK */"
+ puts $f "#else"
+ puts $f "# error Failed $test"
puts $f "#endif"
close $f
- set lines [libffi_target_compile $src "" "preprocess" ""]
+ set lines [libffi_target_compile $src /dev/null assembly ""]
file delete $src
- set last [lindex $lines end]
- return [regexp -- "xyzzy" $last]
+ return [string match "" $lines]
}
# Utility routines.