Commit 573d8a24 by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/85699 (gcc.dg/nextafter-2.c fail)

	PR tree-optimization/85699
	* gcc.dg/nextafter-1.c (NO_LONG_DOUBLE): Define if not defined.  Use
	!NO_LONG_DOUBLE instead of __LDBL_MANT_DIG__ != 106.
	* gcc.dg/nextafter-2.c: Include stdlib.h.  For glibc < 2.24 define
	NO_LONG_DOUBLE to 1 before including nextafter-1.c.

From-SVN: r260107
parent 86c12f76
2018-05-10 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/85699
* gcc.dg/nextafter-1.c (NO_LONG_DOUBLE): Define if not defined. Use
!NO_LONG_DOUBLE instead of __LDBL_MANT_DIG__ != 106.
* gcc.dg/nextafter-2.c: Include stdlib.h. For glibc < 2.24 define
NO_LONG_DOUBLE to 1 before including nextafter-1.c.
2018-05-10 Eric Botcazou <ebotcazou@adacore.com> 2018-05-10 Eric Botcazou <ebotcazou@adacore.com>
* g++.dg/tls/pr85400.C: New test. * g++.dg/tls/pr85400.C: New test.
......
...@@ -20,6 +20,9 @@ long double nexttowardl (long double, long double); ...@@ -20,6 +20,9 @@ long double nexttowardl (long double, long double);
#ifndef NEED_EXC #ifndef NEED_EXC
#define NEED_EXC 0 #define NEED_EXC 0
#endif #endif
#ifndef NO_LONG_DOUBLE
#define NO_LONG_DOUBLE (__LDBL_MANT_DIG__ == 106)
#endif
#define TEST(name, fn, type, L1, L2, l1, l2, MIN1, \ #define TEST(name, fn, type, L1, L2, l1, l2, MIN1, \
MAX1, DENORM_MIN1, EPSILON1, MIN2, MAX2, DENORM_MIN2) \ MAX1, DENORM_MIN1, EPSILON1, MIN2, MAX2, DENORM_MIN2) \
...@@ -129,7 +132,7 @@ TEST (test1, nextafterf, float, F, F, f, f, __FLT_MIN__, __FLT_MAX__, ...@@ -129,7 +132,7 @@ TEST (test1, nextafterf, float, F, F, f, f, __FLT_MIN__, __FLT_MAX__,
TEST (test2, nextafter, double, , , , , __DBL_MIN__, __DBL_MAX__, TEST (test2, nextafter, double, , , , , __DBL_MIN__, __DBL_MAX__,
__DBL_DENORM_MIN__, __DBL_EPSILON__, __DBL_MIN__, __DBL_MAX__, __DBL_DENORM_MIN__, __DBL_EPSILON__, __DBL_MIN__, __DBL_MAX__,
__DBL_DENORM_MIN__) __DBL_DENORM_MIN__)
#if __LDBL_MANT_DIG__ != 106 #if !NO_LONG_DOUBLE
TEST (test3, nextafterl, long double, L, L, l, l, __LDBL_MIN__, __LDBL_MAX__, TEST (test3, nextafterl, long double, L, L, l, l, __LDBL_MIN__, __LDBL_MAX__,
__LDBL_DENORM_MIN__, __LDBL_EPSILON__, __LDBL_MIN__, __LDBL_MAX__, __LDBL_DENORM_MIN__, __LDBL_EPSILON__, __LDBL_MIN__, __LDBL_MAX__,
__LDBL_DENORM_MIN__) __LDBL_DENORM_MIN__)
...@@ -149,7 +152,7 @@ main () ...@@ -149,7 +152,7 @@ main ()
{ {
test1 (); test1 ();
test2 (); test2 ();
#if __LDBL_MANT_DIG__ != 106 #if !NO_LONG_DOUBLE
test3 (); test3 ();
test4 (); test4 ();
test5 (); test5 ();
......
...@@ -5,4 +5,13 @@ ...@@ -5,4 +5,13 @@
/* { dg-add-options ieee } */ /* { dg-add-options ieee } */
/* { dg-add-options c99_runtime } */ /* { dg-add-options c99_runtime } */
#include <stdlib.h>
#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
# if !__GLIBC_PREREQ (2, 24)
/* Workaround buggy nextafterl in glibc 2.23 and earlier,
see https://sourceware.org/bugzilla/show_bug.cgi?id=20205 */
# define NO_LONG_DOUBLE 1
# endif
#endif
#include "nextafter-1.c" #include "nextafter-1.c"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment