2017-06-28 Joseph Myers <joseph@codesourcery.com>
+ [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].
+
* math/gen-tgmath-tests.py: New file.
* math/Makefile [PYTHON] (tests): Add test-tgmath3.
[PYTHON] (generated): Add test-tgmath3.c.
TEST_FUNC (double_test, double, , DBL_EPSILON, HUGE_VAL)
TEST_CONVERT (convert_dfsf_test, float, double, )
TEST_CONVERT (convert_sfdf_test, double, float, f)
-#ifndef NO_LONG_DOUBLE
+#if LDBL_MANT_DIG > DBL_MANT_DIG
TEST_FUNC (ldouble_test, long double, l, LDBL_EPSILON, HUGE_VALL)
TEST_CONVERT (convert_tfsf_test, float, long double, l)
TEST_CONVERT (convert_sftf_test, long double, float, f)
convert_dfsf_test();
convert_sfdf_test();
-#ifndef NO_LONG_DOUBLE
+#if LDBL_MANT_DIG > DBL_MANT_DIG
ldouble_test ();
convert_tfsf_test();
convert_sftf_test();
++result;
}
-#ifndef NO_LONG_DOUBLE
long double li = INFINITY;
long double lm = LDBL_MAX;
feclearexcept (FE_ALL_EXCEPT);
puts ("nextafterl- did not underflow");
++result;
}
-#endif
return result;
}
++result;
}
-#ifndef NO_LONG_DOUBLE
long double li = INFINITY;
long double lm = LDBL_MAX;
feclearexcept (FE_ALL_EXCEPT);
puts ("nexttowardl- did not underflow");
++result;
}
-#endif
return result;
}
header fix this test will not compile. */
if (isinff (1.0f)
|| !isinff (INFINITY)
-#ifndef NO_LONG_DOUBLE
|| isinfl (1.0L)
|| !isinfl (INFINITY)
-#endif
|| isnanf (2.0f)
|| !isnanf (NAN)
-#ifndef NO_LONG_DOUBLE
|| isnanl (2.0L)
|| !isnanl (NAN)
-#endif
)
{
printf ("FAIL: Failed to call is* functions.\n");
{
check_type<float> ();
check_type<double> ();
-#ifndef NO_LONG_DOUBLE
check_type<long double> ();
-#endif
return errors;
}
while (0)
NAN_TEST (float, nanf);
NAN_TEST (double, nan);
-#ifndef NO_LONG_DOUBLE
NAN_TEST (long double, nanl);
-#endif
return result;
}
int result = 0;
RUN_TESTS (float, strtof, nanf, FLT_MANT_DIG);
RUN_TESTS (double, strtod, nan, DBL_MANT_DIG);
-#ifndef NO_LONG_DOUBLE
RUN_TESTS (long double, strtold, nanl, LDBL_MANT_DIG);
-#endif
return result;
}
TEST_FUNC (float_test, float, f)
TEST_FUNC (double_test, double, )
-#ifndef NO_LONG_DOUBLE
TEST_FUNC (ldouble_test, long double, l)
-#endif
static int
do_test (void)
int result = float_test ();
feenableexcept (FE_INEXACT);
result |= double_test ();
-#ifndef NO_LONG_DOUBLE
feenableexcept (FE_INEXACT);
result |= ldouble_test ();
-#endif
return result;
}
TEST_FUNC (float_test, float, f)
TEST_FUNC (double_test, double, )
-#ifndef NO_LONG_DOUBLE
TEST_FUNC (ldouble_test, long double, l)
-#endif
static int
do_test (void)
{
int result = float_test ();
result |= double_test ();
-#ifndef NO_LONG_DOUBLE
result |= ldouble_test ();
-#endif
if (!any_supported)
return 77;
return result;
{
int result = 0;
-#ifndef NO_LONG_DOUBLE
-# if LDBL_MANT_DIG == 64
+#if LDBL_MANT_DIG == 64
{
long double x = 1e-20;
union ieee854_long_double u;
result = 1;
}
}
-# endif
#endif
return result;
int result = 0;
RUN_TESTS (lgammaf, float);
RUN_TESTS (lgamma, double);
-#ifndef NO_LONG_DOUBLE
RUN_TESTS (lgammal, long double);
-#endif
return result;
}
RUN_TESTS (gammaf, float);
RUN_TESTS (lgamma, double);
RUN_TESTS (gamma, double);
-#ifndef NO_LONG_DOUBLE
RUN_TESTS (lgammal, long double);
RUN_TESTS (gammal, long double);
-#endif
return result;
}
int result = 0;
RUN_TESTS (lgammaf, float);
RUN_TESTS (lgamma, double);
-#ifndef NO_LONG_DOUBLE
RUN_TESTS (lgammal, long double);
-#endif
return result;
}
TEST_FUNC (float_test, float, f)
TEST_FUNC (double_test, double, )
-#ifndef NO_LONG_DOUBLE
TEST_FUNC (ldouble_test, long double, l)
-#endif
static int
do_test (void)
float_test ();
double_test ();
-#ifndef NO_LONG_DOUBLE
ldouble_test ();
-#endif
return errors != 0;
}
CHECK_RET_CONST_TYPE (func, rettype, fx, float, ## __VA_ARGS__)
#define CHECK_RET_CONST_DOUBLE(func, rettype, ...) \
CHECK_RET_CONST_TYPE (func, rettype, dx, double, ## __VA_ARGS__)
-#ifdef NO_LONG_DOUBLE
-# define CHECK_RET_CONST_LDOUBLE(func, rettype, ...)
-#else
-# define CHECK_RET_CONST_LDOUBLE(func, rettype, ...) \
+#define CHECK_RET_CONST_LDOUBLE(func, rettype, ...) \
CHECK_RET_CONST_TYPE (func, rettype, lx, long double, ## __VA_ARGS__)
-#endif
#define CHECK_RET_CONST(func, rettype, ...) \
static void \
#ifndef HAVE_MAIN
#undef __NO_MATH_INLINES
#define __NO_MATH_INLINES 1
+#include <float.h>
#include <math.h>
#include <stdint.h>
#include <stdio.h>
static void compile_test (void);
static void compile_testf (void);
-#ifndef NO_LONG_DOUBLE
+#if LDBL_MANT_DIG > DBL_MANT_DIG
static void compile_testl (void);
#endif
result = 1;
}
-#ifndef NO_LONG_DOUBLE
+#if LDBL_MANT_DIG > DBL_MANT_DIG
count_float = count_double = count_ldouble = 0;
count_cfloat = count_cdouble = count_cldouble = 0;
compile_testl ();
#define ccount count_cfloat
#include "test-tgmath.c"
-#ifndef NO_LONG_DOUBLE
+#if LDBL_MANT_DIG > DBL_MANT_DIG
#define F(name) name##l
#define TYPE long double
#define x lx
#ifndef HAVE_MAIN
#undef __NO_MATH_INLINES
#define __NO_MATH_INLINES 1
+#include <float.h>
#include <math.h>
#include <complex.h>
#include <stdio.h>
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
Tcfloat,
Tdouble,
Tcdouble,
-#ifndef NO_LONG_DOUBLE
+#if LDBL_MANT_DIG > DBL_MANT_DIG
Tldouble,
Tcldouble,
#else
#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