From d5a65f3e28c923d4b56deaeabb1e8ad594c51bae Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 5 Nov 2011 17:00:34 +0100 Subject: [PATCH] ldexpl tests: Avoid test failure on MSVC 9. * tests/test-ldexpl.c (main): Use a temporary variable for the expected value. Needed in order to enforce the conversion from a value greater than LDBL_MAX to Infinity. --- ChangeLog | 7 +++++++ tests/test-ldexpl.c | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d07a4b1f45..bbb4c0b530 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-11-05 Bruno Haible + + ldexpl tests: Avoid test failure on MSVC 9. + * tests/test-ldexpl.c (main): Use a temporary variable for the expected + value. Needed in order to enforce the conversion from a value greater + than LDBL_MAX to Infinity. + 2011-11-05 Bruno Haible New modules 'at-internal', 'openat-h', split off from module 'openat'. diff --git a/tests/test-ldexpl.c b/tests/test-ldexpl.c index 5e921f61e8..e78e9a5d85 100644 --- a/tests/test-ldexpl.c +++ b/tests/test-ldexpl.c @@ -94,7 +94,12 @@ main () for (i = 1, x = 1.73205L; i <= LDBL_MAX_EXP; i++, x *= 2.0L) { y = ldexpl (x, 0); ASSERT (y == x); - y = ldexpl (x, 5); ASSERT (y == x * 32.0L); + { + volatile long double expected; + y = ldexpl (x, 5); + expected = x * 32.0L; + ASSERT (y == expected); + } y = ldexpl (x, -5); ASSERT (y == x * 0.03125L); } for (i = 1, x = 1.73205L; i >= LDBL_MIN_EXP; i--, x *= 0.5L) -- 2.39.5