From 5878dd9d53a00fa28800236d79e38e55f85fc98d Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 28 Oct 2015 21:57:10 +0000 Subject: Use C11 CMPLX* macros in libm tests. libm-test.inc has a macro BUILD_COMPLEX to construct a complex number with given real and imaginary parts while allowing properly for signed zeroes, infinities and NaNs (which don't work properly with a simple real + I * imag, in the absence of compiler support for imaginary types), using assignment to __real__ and __imag__ parts of the number. C11 defines CMPLX* macros for this purpose, which GCC 4.7 and above provide suitable built-in functions for. This patch redefines BUILD_COMPLEX in terms of the standard macros. Tested for x86_64 and x86. * math/libm-test.inc (BUILD_COMPLEX): Remove macro. * math/test-double.h (BUILD_COMPLEX): New macro. * math/test-float.h (BUILD_COMPLEX): Likewise. * math/test-ldouble.h (BUILD_COMPLEX): Likewise. --- math/test-float.h | 1 + 1 file changed, 1 insertion(+) (limited to 'math/test-float.h') diff --git a/math/test-float.h b/math/test-float.h index 7b00cb1216..8bdba5544d 100644 --- a/math/test-float.h +++ b/math/test-float.h @@ -22,3 +22,4 @@ #define PRINTF_XEXPR "a" #define PRINTF_NEXPR "f" #define TEST_FLOAT 1 +#define BUILD_COMPLEX(real, imag) (CMPLXF ((real), (imag))) -- cgit v1.2.3