This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Make fma and nextafter tests use max_value instead of fltmax
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: <libc-alpha at sourceware dot org>
- Date: Fri, 10 May 2013 21:25:49 +0000
- Subject: Make fma and nextafter tests use max_value instead of fltmax
Some tests of fma and nextafter use a local variable fltmax with the
same semantics as max_value. This patch changes them to use max_value
so they continue to work when these tests are moved from code to
data. Tested x86_64.
2013-05-10 Joseph Myers <joseph@codesourcery.com>
* math/libm-test.inc (fma_test): Use max_value instead of local
variable fltmax.
(nextafter_test): Likewise.
diff --git a/math/libm-test.inc b/math/libm-test.inc
index 6b4556d..e24abc7 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -8192,12 +8192,10 @@ fma_test (void)
TEST_fff_f (fma, 1.25L, 0.75L, 0.0625L, 1.0L);
- FLOAT fltmax = CHOOSE (LDBL_MAX, DBL_MAX, FLT_MAX,
- LDBL_MAX, DBL_MAX, FLT_MAX);
- TEST_fff_f (fma, -fltmax, -fltmax, minus_infty, minus_infty);
- TEST_fff_f (fma, fltmax / 2, fltmax / 2, minus_infty, minus_infty);
- TEST_fff_f (fma, -fltmax, fltmax, plus_infty, plus_infty);
- TEST_fff_f (fma, fltmax / 2, -fltmax / 4, plus_infty, plus_infty);
+ TEST_fff_f (fma, -max_value, -max_value, minus_infty, minus_infty);
+ TEST_fff_f (fma, max_value / 2, max_value / 2, minus_infty, minus_infty);
+ TEST_fff_f (fma, -max_value, max_value, plus_infty, plus_infty);
+ TEST_fff_f (fma, max_value / 2, -max_value / 4, plus_infty, plus_infty);
TEST_fff_f (fma, plus_infty, 4, plus_infty, plus_infty);
TEST_fff_f (fma, 2, minus_infty, minus_infty, minus_infty);
TEST_fff_f (fma, minus_infty, minus_infty, plus_infty, plus_infty);
@@ -11241,10 +11239,8 @@ nextafter_test (void)
TEST_ff_f (nextafter, 1.1L, qnan_value, qnan_value);
TEST_ff_f (nextafter, qnan_value, qnan_value, qnan_value);
- FLOAT fltmax = CHOOSE (LDBL_MAX, DBL_MAX, FLT_MAX,
- LDBL_MAX, DBL_MAX, FLT_MAX);
- TEST_ff_f (nextafter, fltmax, plus_infty, plus_infty, OVERFLOW_EXCEPTION);
- TEST_ff_f (nextafter, -fltmax, minus_infty, minus_infty, OVERFLOW_EXCEPTION);
+ TEST_ff_f (nextafter, max_value, plus_infty, plus_infty, OVERFLOW_EXCEPTION);
+ TEST_ff_f (nextafter, -max_value, minus_infty, minus_infty, OVERFLOW_EXCEPTION);
#ifdef TEST_LDOUBLE
// XXX Enable once gcc is fixed.
--
Joseph S. Myers
joseph@codesourcery.com