From: Jakub Jelinek Date: Thu, 10 May 2018 07:38:24 +0000 (+0200) Subject: re PR tree-optimization/85699 (gcc.dg/nextafter-2.c fail) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=573d8a243dd0493796ab9de876690b888c41b520;p=gcc.git 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 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5bbcd708d65..b09ce3ede2d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2018-05-10 Jakub Jelinek + + 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 * g++.dg/tls/pr85400.C: New test. diff --git a/gcc/testsuite/gcc.dg/nextafter-1.c b/gcc/testsuite/gcc.dg/nextafter-1.c index c8647ede00b..a768574b342 100644 --- a/gcc/testsuite/gcc.dg/nextafter-1.c +++ b/gcc/testsuite/gcc.dg/nextafter-1.c @@ -20,6 +20,9 @@ long double nexttowardl (long double, long double); #ifndef NEED_EXC #define NEED_EXC 0 #endif +#ifndef NO_LONG_DOUBLE +#define NO_LONG_DOUBLE (__LDBL_MANT_DIG__ == 106) +#endif #define TEST(name, fn, type, L1, L2, l1, l2, MIN1, \ MAX1, DENORM_MIN1, EPSILON1, MIN2, MAX2, DENORM_MIN2) \ @@ -129,7 +132,7 @@ TEST (test1, nextafterf, float, F, F, f, f, __FLT_MIN__, __FLT_MAX__, TEST (test2, nextafter, double, , , , , __DBL_MIN__, __DBL_MAX__, __DBL_DENORM_MIN__, __DBL_EPSILON__, __DBL_MIN__, __DBL_MAX__, __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__, __LDBL_DENORM_MIN__, __LDBL_EPSILON__, __LDBL_MIN__, __LDBL_MAX__, __LDBL_DENORM_MIN__) @@ -149,7 +152,7 @@ main () { test1 (); test2 (); -#if __LDBL_MANT_DIG__ != 106 +#if !NO_LONG_DOUBLE test3 (); test4 (); test5 (); diff --git a/gcc/testsuite/gcc.dg/nextafter-2.c b/gcc/testsuite/gcc.dg/nextafter-2.c index ef34676fd7e..0bde721b338 100644 --- a/gcc/testsuite/gcc.dg/nextafter-2.c +++ b/gcc/testsuite/gcc.dg/nextafter-2.c @@ -5,4 +5,13 @@ /* { dg-add-options ieee } */ /* { dg-add-options c99_runtime } */ +#include + +#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"