From ad2162e3e4659985b85e36f7f89092e465332f03 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Mon, 23 May 2016 17:03:08 +0200 Subject: [PATCH] [PR libffi/65567] libffi: Fix, and simply libffi_feature_test Backport trunk r236594: libffi/ PR libffi/65567 * testsuite/lib/libffi.exp (libffi_feature_test): Fix, and simply. From-SVN: r236596 --- libffi/ChangeLog | 7 +++++++ libffi/testsuite/lib/libffi.exp | 11 ++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/libffi/ChangeLog b/libffi/ChangeLog index 7bcce8191acc..3307bfb1b438 100644 --- a/libffi/ChangeLog +++ b/libffi/ChangeLog @@ -1,3 +1,10 @@ +2016-05-23 Thomas Schwinge + + Backport trunk r236594: + + PR libffi/65567 + * testsuite/lib/libffi.exp (libffi_feature_test): Fix, and simply. + 2015-12-04 Release Manager * GCC 5.3.0 released. diff --git a/libffi/testsuite/lib/libffi.exp b/libffi/testsuite/lib/libffi.exp index 169fe74ca7c3..a0f6ab397ee8 100644 --- a/libffi/testsuite/lib/libffi.exp +++ b/libffi/testsuite/lib/libffi.exp @@ -227,20 +227,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 " 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 [split $lines] end] - return [regexp -- "xyzzy" $last] + return [string match "" $lines] } # Utility routines.