aboutsummaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2014-03-19 16:17:22 +0000
committerJoseph Myers <joseph@codesourcery.com>2014-03-19 16:17:22 +0000
commitd71aeee8862acaabd5ccc151ba1b442a7b6d24d6 (patch)
treee80b2356fc4c44ad8850cab06087e38caf92dbd3 /math
parentbaaf1dedc969e6fc87c4d5048c260f930c73881e (diff)
downloadglibc-d71aeee8862acaabd5ccc151ba1b442a7b6d24d6.zip
glibc-d71aeee8862acaabd5ccc151ba1b442a7b6d24d6.tar.gz
glibc-d71aeee8862acaabd5ccc151ba1b442a7b6d24d6.tar.bz2
Use ALL_RM_TEST for more libm tests.
Continuing the move to using ALL_RM_TEST for tests in libm-test.inc, this patch converts the tests of fdim, ldexp and scalb. fdim and scalb are cases where tests could depend on the rounding mode though none of the present test inputs do; ldexp is such a case where the function is equivalent to scalbn (for binary floating point) and the tests used were a subset of those for scalbn, so this patch makes ldexp testing use the scalbn tests, as done for other cases of libm function aliases. Tested x86_64 and x86. * math/libm-test.inc (fdim_test): Use ALL_RM_TEST. (ldexp_test_data): Remove. (ldexp_test): Move to after scalbn_test. Use ALL_RM_TEST with scalbn_test_data. (scalb_test): Use ALL_RM_TEST.
Diffstat (limited to 'math')
-rw-r--r--math/libm-test.inc41
1 files changed, 9 insertions, 32 deletions
diff --git a/math/libm-test.inc b/math/libm-test.inc
index 5ad0255..47c162f 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -7445,9 +7445,7 @@ static const struct test_ff_f_data fdim_test_data[] =
static void
fdim_test (void)
{
- START (fdim, 1);
- RUN_TEST_LOOP_ff_f (fdim, fdim_test_data, );
- END;
+ ALL_RM_TEST (fdim, 1, fdim_test_data, RUN_TEST_LOOP_ff_f, END);
}
@@ -8169,31 +8167,6 @@ jn_test (void)
}
-static const struct test_fi_f_data ldexp_test_data[] =
- {
- TEST_fi_f (ldexp, 0, 0, 0, NO_INEXACT_EXCEPTION),
- TEST_fi_f (ldexp, minus_zero, 0, minus_zero, NO_INEXACT_EXCEPTION),
-
- TEST_fi_f (ldexp, plus_infty, 1, plus_infty, NO_INEXACT_EXCEPTION),
- TEST_fi_f (ldexp, minus_infty, 1, minus_infty, NO_INEXACT_EXCEPTION),
- TEST_fi_f (ldexp, qnan_value, 1, qnan_value, NO_INEXACT_EXCEPTION),
-
- TEST_fi_f (ldexp, 0.8L, 4, 12.8L, NO_INEXACT_EXCEPTION),
- TEST_fi_f (ldexp, -0.854375L, 5, -27.34L, NO_INEXACT_EXCEPTION),
-
- /* ldexp (x, 0) == x. */
- TEST_fi_f (ldexp, 1.0L, 0L, 1.0L, NO_INEXACT_EXCEPTION),
- };
-
-static void
-ldexp_test (void)
-{
- START (ldexp, 1);
- RUN_TEST_LOOP_fi_f (ldexp, ldexp_test_data, );
- END;
-}
-
-
static const struct test_f_f1_data lgamma_test_data[] =
{
TEST_f_f1 (lgamma, plus_infty, plus_infty, 1),
@@ -9784,10 +9757,7 @@ static const struct test_ff_f_data scalb_test_data[] =
static void
scalb_test (void)
{
-
- START (scalb, 1);
- RUN_TEST_LOOP_ff_f (scalb, scalb_test_data, );
- END;
+ ALL_RM_TEST (scalb, 1, scalb_test_data, RUN_TEST_LOOP_ff_f, END);
}
@@ -9830,6 +9800,13 @@ scalbn_test (void)
ALL_RM_TEST (scalbn, 1, scalbn_test_data, RUN_TEST_LOOP_fi_f, END);
}
+static void
+ldexp_test (void)
+{
+ /* ldexp uses the same test data as scalbn. */
+ ALL_RM_TEST (ldexp, 1, scalbn_test_data, RUN_TEST_LOOP_fi_f, END);
+}
+
static const struct test_fl_f_data scalbln_test_data[] =
{