From d4481bfaad6ca4e911cd90a9f97c54962000e200 Mon Sep 17 00:00:00 2001 From: zimmerma Date: Tue, 3 Aug 2021 09:49:00 +0000 Subject: need -fp-model=strict for icx git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14552 280ebfd0-de03-0410-8827-d642c229c3f4 --- tests/tget_flt.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tests') diff --git a/tests/tget_flt.c b/tests/tget_flt.c index 04975c004..b85e74b68 100644 --- a/tests/tget_flt.c +++ b/tests/tget_flt.c @@ -21,6 +21,7 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ #include /* for FLT_MIN */ +#include /* for isnan */ #include "mpfr-test.h" #include "ieee_floats.h" @@ -47,6 +48,25 @@ equal_flt (float f, float g) } } +/* bug with icx 2021.2.0, when MPFR is not compiled with -fp-model=strict */ +static void +bug_icx (void) +{ + mpfr_t x; + float y; + mpfr_init2 (x, 24); + mpfr_set_flt (x, -0x1p-149f, MPFR_RNDN); + mpfr_log (x, x, MPFR_RNDN); + y = mpfr_get_flt (x, MPFR_RNDN); + if (!isnan (y)) + { + printf ("Error, mpfr_get_flt(NaN) != NaN\n"); + printf ("got %a\n", y); + exit (1); + } + mpfr_clear (x); +} + int main (void) { @@ -59,6 +79,8 @@ main (void) tests_start_mpfr (); + bug_icx (); + #if !defined(MPFR_ERRDIVZERO) infp = (float) MPFR_DBL_INFP; if (infp * 0.5 != infp) -- cgit v1.2.1