#define ERRNO_UNCHANGED 0x1000
#define ERRNO_EDOM 0x2000
#define ERRNO_ERANGE 0x4000
+/* Flags generated by gen-libm-test.pl, not entered here manually. */
+#define IGNORE_RESULT 0x8000
/* Values underflowing only for float. */
#ifdef TEST_FLOAT
test_exceptions (test_name, exceptions);
test_errno (test_name, errno_value, exceptions);
+ if (exceptions & IGNORE_RESULT)
+ goto out;
FLOAT max_ulp = find_test_ulps (test_name);
if (issignaling (computed) && issignaling (expected))
ok = 1;
}
update_stats (ok);
+ out:
fpstack_test (test_name);
errno = 0;
}
part_exp = __imag__ expected;
/* Don't check again for exceptions or errno, just pass through the
- zero/inf sign test. */
+ other relevant flags. */
check_float_internal (str, part_comp, part_exp,
- exception & IGNORE_ZERO_INF_SIGN,
+ exception & (IGNORE_ZERO_INF_SIGN | IGNORE_RESULT),
&imag_max_error);
free (str);
}
test_exceptions (test_name, exceptions);
test_errno (test_name, errno_value, exceptions);
+ if (exceptions & IGNORE_RESULT)
+ goto out;
noTests++;
if (computed == expected)
ok = 1;
}
update_stats (ok);
+ out:
fpstack_test (test_name);
errno = 0;
}
test_exceptions (test_name, exceptions);
test_errno (test_name, errno_value, exceptions);
+ if (exceptions & IGNORE_RESULT)
+ goto out;
noTests++;
if (computed == expected)
ok = 1;
}
update_stats (ok);
+ out:
fpstack_test (test_name);
errno = 0;
}
test_exceptions (test_name, exceptions);
test_errno (test_name, errno_value, exceptions);
+ if (exceptions & IGNORE_RESULT)
+ goto out;
noTests++;
if ((computed == 0) == (expected == 0))
ok = 1;
}
update_stats (ok);
+ out:
fpstack_test (test_name);
errno = 0;
}
test_exceptions (test_name, exceptions);
test_errno (test_name, errno_value, exceptions);
+ if (exceptions & IGNORE_RESULT)
+ goto out;
noTests++;
if (computed == expected)
ok = 1;
}
update_stats (ok);
+ out:
fpstack_test (test_name);
errno = 0;
}
/* XXX this test is incomplete. We need to have a way to specifiy
the rounding method and test the critical cases. So far, only
unproblematic numbers are tested. */
- /* TODO: missing +/-Inf as well as qNaN tests. */
+ TEST_f_l (lrint, plus_infty, IGNORE, INVALID_EXCEPTION),
+ TEST_f_l (lrint, minus_infty, IGNORE, INVALID_EXCEPTION),
+ TEST_f_l (lrint, qnan_value, IGNORE, INVALID_EXCEPTION),
TEST_f_l (lrint, 0.0, 0, NO_INEXACT_EXCEPTION),
TEST_f_l (lrint, minus_zero, 0, NO_INEXACT_EXCEPTION),
TEST_f_l (lrint, 0.2L, 0, INEXACT_EXCEPTION),
static const struct test_f_l_data lrint_tonearest_test_data[] =
{
+ TEST_f_l (lrint, plus_infty, IGNORE, INVALID_EXCEPTION),
+ TEST_f_l (lrint, minus_infty, IGNORE, INVALID_EXCEPTION),
+ TEST_f_l (lrint, qnan_value, IGNORE, INVALID_EXCEPTION),
TEST_f_l (lrint, 0.0, 0, NO_INEXACT_EXCEPTION),
TEST_f_l (lrint, minus_zero, 0, NO_INEXACT_EXCEPTION),
TEST_f_l (lrint, 0.2L, 0, INEXACT_EXCEPTION),
static const struct test_f_l_data lrint_towardzero_test_data[] =
{
+ TEST_f_l (lrint, plus_infty, IGNORE, INVALID_EXCEPTION),
+ TEST_f_l (lrint, minus_infty, IGNORE, INVALID_EXCEPTION),
+ TEST_f_l (lrint, qnan_value, IGNORE, INVALID_EXCEPTION),
TEST_f_l (lrint, 0.0, 0, NO_INEXACT_EXCEPTION),
TEST_f_l (lrint, minus_zero, 0, NO_INEXACT_EXCEPTION),
TEST_f_l (lrint, 0.2L, 0, INEXACT_EXCEPTION),
static const struct test_f_l_data lrint_downward_test_data[] =
{
+ TEST_f_l (lrint, plus_infty, IGNORE, INVALID_EXCEPTION),
+ TEST_f_l (lrint, minus_infty, IGNORE, INVALID_EXCEPTION),
+ TEST_f_l (lrint, qnan_value, IGNORE, INVALID_EXCEPTION),
TEST_f_l (lrint, 0.0, 0, NO_INEXACT_EXCEPTION),
TEST_f_l (lrint, minus_zero, 0, NO_INEXACT_EXCEPTION),
TEST_f_l (lrint, 0.2L, 0, INEXACT_EXCEPTION),
static const struct test_f_l_data lrint_upward_test_data[] =
{
+ TEST_f_l (lrint, plus_infty, IGNORE, INVALID_EXCEPTION),
+ TEST_f_l (lrint, minus_infty, IGNORE, INVALID_EXCEPTION),
+ TEST_f_l (lrint, qnan_value, IGNORE, INVALID_EXCEPTION),
TEST_f_l (lrint, 0.0, 0, NO_INEXACT_EXCEPTION),
TEST_f_l (lrint, minus_zero, 0, NO_INEXACT_EXCEPTION),
TEST_f_l (lrint, 0.2L, 1, INEXACT_EXCEPTION),
/* XXX this test is incomplete. We need to have a way to specifiy
the rounding method and test the critical cases. So far, only
unproblematic numbers are tested. */
- /* TODO: missing +/-Inf as well as qNaN tests. */
+ TEST_f_L (llrint, plus_infty, IGNORE, INVALID_EXCEPTION),
+ TEST_f_L (llrint, minus_infty, IGNORE, INVALID_EXCEPTION),
+ TEST_f_L (llrint, qnan_value, IGNORE, INVALID_EXCEPTION),
TEST_f_L (llrint, 0.0, 0, NO_INEXACT_EXCEPTION),
TEST_f_L (llrint, minus_zero, 0, NO_INEXACT_EXCEPTION),
TEST_f_L (llrint, 0.2L, 0, INEXACT_EXCEPTION),
static const struct test_f_L_data llrint_tonearest_test_data[] =
{
+ TEST_f_L (llrint, plus_infty, IGNORE, INVALID_EXCEPTION),
+ TEST_f_L (llrint, minus_infty, IGNORE, INVALID_EXCEPTION),
+ TEST_f_L (llrint, qnan_value, IGNORE, INVALID_EXCEPTION),
TEST_f_L (llrint, 0.0, 0, NO_INEXACT_EXCEPTION),
TEST_f_L (llrint, minus_zero, 0, NO_INEXACT_EXCEPTION),
TEST_f_L (llrint, 0.2L, 0, INEXACT_EXCEPTION),
static const struct test_f_L_data llrint_towardzero_test_data[] =
{
+ TEST_f_L (llrint, plus_infty, IGNORE, INVALID_EXCEPTION),
+ TEST_f_L (llrint, minus_infty, IGNORE, INVALID_EXCEPTION),
+ TEST_f_L (llrint, qnan_value, IGNORE, INVALID_EXCEPTION),
TEST_f_L (llrint, 0.0, 0, NO_INEXACT_EXCEPTION),
TEST_f_L (llrint, minus_zero, 0, NO_INEXACT_EXCEPTION),
TEST_f_L (llrint, 0.2L, 0, INEXACT_EXCEPTION),
static const struct test_f_L_data llrint_downward_test_data[] =
{
+ TEST_f_L (llrint, plus_infty, IGNORE, INVALID_EXCEPTION),
+ TEST_f_L (llrint, minus_infty, IGNORE, INVALID_EXCEPTION),
+ TEST_f_L (llrint, qnan_value, IGNORE, INVALID_EXCEPTION),
TEST_f_L (llrint, 0.0, 0, NO_INEXACT_EXCEPTION),
TEST_f_L (llrint, minus_zero, 0, NO_INEXACT_EXCEPTION),
TEST_f_L (llrint, 0.2L, 0, INEXACT_EXCEPTION),
static const struct test_f_L_data llrint_upward_test_data[] =
{
+ TEST_f_L (llrint, plus_infty, IGNORE, INVALID_EXCEPTION),
+ TEST_f_L (llrint, minus_infty, IGNORE, INVALID_EXCEPTION),
+ TEST_f_L (llrint, qnan_value, IGNORE, INVALID_EXCEPTION),
TEST_f_L (llrint, 0.0, 0, NO_INEXACT_EXCEPTION),
TEST_f_L (llrint, minus_zero, 0, NO_INEXACT_EXCEPTION),
TEST_f_L (llrint, 0.2L, 1, INEXACT_EXCEPTION),
static const struct test_f_l_data lround_test_data[] =
{
- /* TODO: missing +/-Inf as well as qNaN tests. */
+ TEST_f_l (lround, plus_infty, IGNORE, INVALID_EXCEPTION),
+ TEST_f_l (lround, minus_infty, IGNORE, INVALID_EXCEPTION),
+ TEST_f_l (lround, qnan_value, IGNORE, INVALID_EXCEPTION),
TEST_f_l (lround, 0, 0),
TEST_f_l (lround, minus_zero, 0),
TEST_f_l (lround, 0.2L, 0.0),
static const struct test_f_L_data llround_test_data[] =
{
- /* TODO: missing +/-Inf as well as qNaN tests. */
+ TEST_f_L (llround, plus_infty, IGNORE, INVALID_EXCEPTION),
+ TEST_f_L (llround, minus_infty, IGNORE, INVALID_EXCEPTION),
+ TEST_f_L (llround, qnan_value, IGNORE, INVALID_EXCEPTION),
TEST_f_L (llround, 0, 0),
TEST_f_L (llround, minus_zero, 0),
TEST_f_L (llround, 0.2L, 0.0),