From c5d2fa887627d2c57d6706e264cec0275ad0688e Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 26 Apr 2023 00:16:06 +0200 Subject: [PATCH] expm1 tests: Avoid test failure on 32-bit mingw. * tests/test-expm1.h (test_function): Mark y as 'volatile'. --- ChangeLog | 5 +++++ tests/test-expm1.h | 8 ++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index b969c027d0..834606fdfb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2023-04-25 Bruno Haible + + expm1 tests: Avoid test failure on 32-bit mingw. + * tests/test-expm1.h (test_function): Mark y as 'volatile'. + 2023-04-25 Bruno Haible poll tests: Avoid test failure on native Windows. diff --git a/tests/test-expm1.h b/tests/test-expm1.h index e543e45516..68f3f6be6f 100644 --- a/tests/test-expm1.h +++ b/tests/test-expm1.h @@ -1,5 +1,5 @@ /* Test of expm1*() function family. - Copyright (C) 2012-2022 Free Software Foundation, Inc. + Copyright (C) 2012-2023 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -35,14 +35,10 @@ test_function (void) for (i = -1, x = L_(0.5); i >= MIN_EXP; i--, x *= L_(0.5)) { - DOUBLE y; + volatile DOUBLE y; y = EXPM1 (x); -#ifdef __MINGW32__ /* mingw returns a value that is slightly too small. */ - ASSERT (y >= x * (L_(1.0) - L_(1.0) / TWO_MANT_DIG)); -#else ASSERT (y >= x); -#endif ASSERT (y < L_(1.5) * x); y = EXPM1 (- x); -- 2.39.5