From ef8be84de5f9e611add396efe908b772eb1cae1d Mon Sep 17 00:00:00 2001 From: Yuriy Kolerov Date: Fri, 29 Jul 2016 21:01:38 +0300 Subject: [PATCH] Do not use fabsl() in float2.c test Some targets may support long double variables but in the same time may lack support of long double functions like fabsl(). Signed-off-by: Yuriy Kolerov --- testsuite/libffi.call/float2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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);