diff --git a/testsuite/lib/libffi.exp b/testsuite/lib/libffi.exp index afc421b6..6e5f7a47 100644 --- a/testsuite/lib/libffi.exp +++ b/testsuite/lib/libffi.exp @@ -102,11 +102,14 @@ proc libffi-init { args } { global ld_library_path global compiler_vendor - set blddirffi [pwd]/.. + if ![info exists blddirffi] { + set blddirffi [pwd]/.. + } + verbose "libffi $blddirffi" # Which compiler are we building with? - set tmp [grep ../config.log "^ax_cv_c_compiler_vendor.*$"] + set tmp [grep "$blddirffi/config.log" "^ax_cv_c_compiler_vendor.*$"] regexp -- {^[^=]*=(.*)$} $tmp nil compiler_vendor if { [string match $compiler_vendor "gnu"] } { @@ -219,6 +222,10 @@ proc libffi_target_compile { source dest type options } { lappend options "c++" } + if { [string match "arc*-*-linux*" $target_triplet] } { + lappend options "libs= -lpthread" + } + verbose "options: $options" return [target_compile $source $dest $type $options] } diff --git a/testsuite/libffi.call/cls_dbls_struct.c b/testsuite/libffi.call/cls_dbls_struct.c index d6637911..e451dea5 100644 --- a/testsuite/libffi.call/cls_dbls_struct.c +++ b/testsuite/libffi.call/cls_dbls_struct.c @@ -57,10 +57,10 @@ int main(int argc __UNUSED__, char** argv __UNUSED__) CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_gn, NULL, code) == FFI_OK); ((void*(*)(Dbls))(code))(arg); - /* { dg-output "1.0 2.0\n" } */ + /* { dg-output "1.0 2.0" } */ closure_test_fn(arg); - /* { dg-output "1.0 2.0\n" } */ + /* { dg-output "\n1.0 2.0" } */ return 0; } diff --git a/testsuite/libffi.call/float2.c b/testsuite/libffi.call/float2.c index 20a8c402..d583e22a 100644 --- a/testsuite/libffi.call/float2.c +++ b/testsuite/libffi.call/float2.c @@ -22,6 +22,7 @@ int main (void) void *values[MAX_ARGS]; float f; long double ld; + long double original; args[0] = &ffi_type_float; values[0] = &f; @@ -49,7 +50,8 @@ int main (void) #endif /* These are not always the same!! Check for a reasonable delta */ - if (fabsl(ld - ldblit(f)) < LDBL_EPSILON) + original = ldblit(f); + if (((ld > original) ? (ld - original) : (original - ld)) < LDBL_EPSILON) puts("long double return value tests ok!"); else CHECK(0);