aboutsummaryrefslogtreecommitdiff
path: root/math/test-tgmath2.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2017-06-28 16:01:20 +0000
committerJoseph Myers <joseph@codesourcery.com>2017-06-28 16:01:20 +0000
commit51737193a9810ceb1c516a2a71444fa70bcf8500 (patch)
treea8afcc09879d8dcea321bf5e38bf270f5f937922 /math/test-tgmath2.c
parent2dd0aec531ad03e8e1642f8642930451b23fe2ba (diff)
downloadglibc-51737193a9810ceb1c516a2a71444fa70bcf8500.zip
glibc-51737193a9810ceb1c516a2a71444fa70bcf8500.tar.gz
glibc-51737193a9810ceb1c516a2a71444fa70bcf8500.tar.bz2
Remove NO_LONG_DOUBLE conditionals in libm tests (bug 21607).
As noted in bug 21607, NO_LONG_DOUBLE conditionals in libm tests are no longer effective. For most this is harmless - they were only present because of long double functions not being declared with _LIBC defined, and _LIBC is no longer defined for building most tests. For the few where this is actually relevant to the test, testing LDBL_MANT_DIG > DBL_MANT_DIG is more appropriate as that limits the test to public APIs. This patch fixes the tests accordingly. Tested for x86_64 and arm. [BZ #21607] * math/basic-test.c [!NO_LONG_DOUBLE]: Change conditionals to [LDBL_MANT_DIG > DBL_MANT_DIG]. * math/bug-nextafter.c [!NO_LONG_DOUBLE]: Remove conditionals. * math/bug-nexttoward.c [!NO_LONG_DOUBLE]: Likewise. * math/test-math-isinff.cc [!NO_LONG_DOUBLE]: Likewise. * math/test-math-iszero.cc [!NO_LONG_DOUBLE]: Likewise. * math/test-nan-overflow.c [!NO_LONG_DOUBLE]: Likewise. * math/test-nan-payload.c [!NO_LONG_DOUBLE]: Likewise. * math/test-nearbyint-except-2.c [!NO_LONG_DOUBLE]: Likewise. * math/test-nearbyint-except.c [!NO_LONG_DOUBLE]: Likewise. * math/test-powl.c [!NO_LONG_DOUBLE]: Likewise. * math/test-signgam-finite-c99.c [!NO_LONG_DOUBLE]: Likewise. * math/test-signgam-finite.c [!NO_LONG_DOUBLE]: Likewise. * math/test-signgam-main.c [!NO_LONG_DOUBLE]: Likewise. * math/test-snan.c [!NO_LONG_DOUBLE]: Likewise. * math/test-tgmath-ret.c [!NO_LONG_DOUBLE]: Likewise. * math/test-tgmath.c: Include <float.h>. [!NO_LONG_DOUBLE]: Change conditionals to [LDBL_MANT_DIG > DBL_MANT_DIG]. * math/test-tgmath2.c: Include <float.h>. [!NO_LONG_DOUBLE]: Change conditionals to [LDBL_MANT_DIG > DBL_MANT_DIG].
Diffstat (limited to 'math/test-tgmath2.c')
-rw-r--r--math/test-tgmath2.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/math/test-tgmath2.c b/math/test-tgmath2.c
index 518849d..3ff2735 100644
--- a/math/test-tgmath2.c
+++ b/math/test-tgmath2.c
@@ -20,6 +20,7 @@
#ifndef HAVE_MAIN
#undef __NO_MATH_INLINES
#define __NO_MATH_INLINES 1
+#include <float.h>
#include <math.h>
#include <complex.h>
#include <stdio.h>
@@ -30,7 +31,7 @@
typedef complex float cfloat;
typedef complex double cdouble;
-#ifndef NO_LONG_DOUBLE
+#if LDBL_MANT_DIG > DBL_MANT_DIG
typedef long double ldouble;
typedef complex long double cldouble;
#else
@@ -62,7 +63,7 @@ enum
Tcfloat,
Tdouble,
Tcdouble,
-#ifndef NO_LONG_DOUBLE
+#if LDBL_MANT_DIG > DBL_MANT_DIG
Tldouble,
Tcldouble,
#else
@@ -470,7 +471,7 @@ do_test (void)
#define C Tcfloat
#include "test-tgmath2.c"
-#ifndef NO_LONG_DOUBLE
+#if LDBL_MANT_DIG > DBL_MANT_DIG
#define F(name) name##l
#define TYPE ldouble
#define CTYPE cldouble