Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions contrib/netbsd-tests/lib/libm/t_fe_round.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,26 @@ ATF_TC_HEAD(fe_round, tc)

ATF_TC_BODY(fe_round, tc)
{
#if defined(__riscv)
atf_tc_expect_fail("https://bugs.freebsd.org/290099");
#endif
long int received;

for (unsigned int i = 0; i < __arraycount(values); i++) {
fesetround(values[i].round_mode);

received = lrint(values[i].input);
ATF_CHECK_MSG(
ATF_REQUIRE_MSG(
(labs(received - values[i].expected) < EPSILON),
"lrint rounding wrong, difference too large\n"
"input: %f (index %d): got %ld, expected %ld\n",
"lrint rounding wrong, difference too large. "
"input: %f (index %d): got %ld, expected %ld",
values[i].input, i, received, values[i].expected);

/* Do we get the same rounding mode out? */
ATF_CHECK_MSG(
ATF_REQUIRE_MSG(
(fegetround() == values[i].round_mode),
"Didn't get the same rounding mode out!\n"
"(index %d) fed in %d rounding mode, got %d out\n",
"Didn't get the same rounding mode out!. "
"(index %d) fed in %d rounding mode, got %d out",
i, values[i].round_mode, fegetround());
}
}
Expand All @@ -109,15 +112,15 @@ ATF_TC_BODY(fe_nearbyint, tc)
received = nearbyint(values[i].input);
ATF_CHECK_MSG(
(fabs(received - values[i].expected) < EPSILON),
"nearbyint rounding wrong, difference too large\n"
"input: %f (index %d): got %f, expected %ld\n",
"nearbyint rounding wrong, difference too large. "
"input: %f (index %d): got %f, expected %ld",
values[i].input, i, received, values[i].expected);

/* Do we get the same rounding mode out? */
ATF_CHECK_MSG(
(fegetround() == values[i].round_mode),
"Didn't get the same rounding mode out!\n"
"(index %d) fed in %d rounding mode, got %d out\n",
"Didn't get the same rounding mode out! "
"(index %d) fed in %d rounding mode, got %d out",
i, values[i].round_mode, fegetround());
}
}
Expand Down Expand Up @@ -151,8 +154,8 @@ ATF_TC_BODY(fe_nextafter, tc)
}
ATF_CHECK_MSG(
res && (fabs(received - values2[i].expected) < EPSILON),
"nextafter() rounding wrong, difference too large\n"
"input: %f (index %d): got %f, expected %f, res %d\n",
"nextafter() rounding wrong, difference too large. "
"input: %f (index %d): got %f, expected %f, res %d",
values2[i].input, i, received, values2[i].expected, res);
}
}
Expand All @@ -177,8 +180,8 @@ ATF_TC_BODY(fe_nexttoward, tc)
}
ATF_CHECK_MSG(
res && (fabs(received - values2[i].expected) < EPSILON),
"nexttoward() rounding wrong, difference too large\n"
"input: %f (index %d): got %f, expected %f, res %d\n",
"nexttoward() rounding wrong, difference too large. "
"input: %f (index %d): got %f, expected %f, res %d",
values2[i].input, i, received, values2[i].expected, res);
}
}
Expand Down
3 changes: 3 additions & 0 deletions lib/msun/tests/cexp_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ ATF_TC_BODY(imaginaries, tc)
ATF_TC_WITHOUT_HEAD(small);
ATF_TC_BODY(small, tc)
{
#if defined(__riscv)
atf_tc_expect_death("https://bugs.freebsd.org/290099");
#endif
static const double tests[] = {
/* csqrt(a + bI) = x + yI */
/* a b x y */
Expand Down
15 changes: 12 additions & 3 deletions lib/msun/tests/ctrig_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,9 @@ ATF_TC_HEAD(test_axes, tc)
}
ATF_TC_BODY(test_axes, tc)
{
#if defined(__riscv)
atf_tc_expect_death("https://bugs.freebsd.org/290099");
#endif
static const long double nums[] = {
M_PI / 4, M_PI / 2, 3 * M_PI / 4,
5 * M_PI / 4, 3 * M_PI / 2, 7 * M_PI / 4,
Expand All @@ -323,9 +326,9 @@ ATF_TC_BODY(test_axes, tc)

test_odd_tol(csinhf, z, CMPLXL(sinhf(nums[i]), 0), FLT_ULP());
test_even_tol(ccoshf, z, CMPLXL(coshf(nums[i]), 0), FLT_ULP());
printf("%a %a\n", creal(z), cimag(z));
printf("%a %a\n", creal(ctanhf(z)), cimag(ctanhf(z)));
printf("%a\n", nextafterf(tanhf(nums[i]), INFINITY));
debug("%a %a\n", creal(z), cimag(z));
debug("%a %a\n", creal(ctanhf(z)), cimag(ctanhf(z)));
debug("%a\n", nextafterf(tanhf(nums[i]), INFINITY));
test_odd_tol(ctanhf, z, CMPLXL(tanhf(nums[i]), 0),
1.3 * FLT_ULP());
test_odd_tol(csinf, z, CMPLXL(sinf(nums[i]),
Expand Down Expand Up @@ -365,6 +368,9 @@ ATF_TC_HEAD(test_small_inputs, tc)
}
ATF_TC_BODY(test_small_inputs, tc)
{
#if defined(__riscv)
atf_tc_expect_death("https://bugs.freebsd.org/290099");
#endif
/*
* z = 0.5 + i Pi/4
* sinh(z) = (sinh(0.5) + i cosh(0.5)) * sqrt(2)/2
Expand Down Expand Up @@ -432,6 +438,9 @@ ATF_TC_HEAD(test_large_inputs, tc)
}
ATF_TC_BODY(test_large_inputs, tc)
{
#if defined(__riscv)
atf_tc_expect_death("https://bugs.freebsd.org/290099");
#endif
long double complex z;

/* tanh() uses a threshold around x=22, so check both sides. */
Expand Down
3 changes: 3 additions & 0 deletions lib/msun/tests/exponential_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ ATF_TC_BODY(exp2l, tc)
ATF_TC_WITHOUT_HEAD(generic);
ATF_TC_BODY(generic, tc)
{
#if defined(__aarch64__) || defined(__riscv)
atf_tc_expect_fail("https://bugs.freebsd.org/290099");
#endif
run_generic_tests();
}

Expand Down
17 changes: 13 additions & 4 deletions lib/msun/tests/fma_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ test_zeroes(void)
static void
test_infinities(void)
{
#if defined(__aarch64__) || defined(__riscv)
atf_tc_expect_fail("https://bugs.freebsd.org/290099");
#endif
testall(INFINITY, 1.0, -1.0, INFINITY, ALL_STD_EXCEPT, 0);
testall(-1.0, INFINITY, 0.0, -INFINITY, ALL_STD_EXCEPT, 0);
testall(0.0, 0.0, INFINITY, INFINITY, ALL_STD_EXCEPT, 0);
Expand Down Expand Up @@ -471,8 +474,11 @@ static const int rmodes[] = {
ATF_TC_WITHOUT_HEAD(zeroes);
ATF_TC_BODY(zeroes, tc)
{
#if defined(__aarch64__) || defined(__riscv)
atf_tc_expect_fail("https://bugs.freebsd.org/290099");
#endif
for (size_t i = 0; i < nitems(rmodes); i++) {
printf("rmode = %d\n", rmodes[i]);
debug("rmode = %d\n", rmodes[i]);
fesetround(rmodes[i]);
test_zeroes();
}
Expand All @@ -481,8 +487,11 @@ ATF_TC_BODY(zeroes, tc)
ATF_TC_WITHOUT_HEAD(infinities);
ATF_TC_BODY(infinities, tc)
{
#if defined(__powerpc64__)
atf_tc_expect_fail("https://bugs.freebsd.org/290099");
#endif
for (size_t i = 0; i < nitems(rmodes); i++) {
printf("rmode = %d\n", rmodes[i]);
debug("rmode = %d\n", rmodes[i]);
fesetround(rmodes[i]);
test_infinities();
}
Expand All @@ -500,7 +509,7 @@ ATF_TC_WITHOUT_HEAD(small_z);
ATF_TC_BODY(small_z, tc)
{
for (size_t i = 0; i < nitems(rmodes); i++) {
printf("rmode = %d\n", rmodes[i]);
debug("rmode = %d\n", rmodes[i]);
fesetround(rmodes[i]);
test_small_z();
}
Expand All @@ -511,7 +520,7 @@ ATF_TC_WITHOUT_HEAD(big_z);
ATF_TC_BODY(big_z, tc)
{
for (size_t i = 0; i < nitems(rmodes); i++) {
printf("rmode = %d\n", rmodes[i]);
debug("rmode = %d\n", rmodes[i]);
fesetround(rmodes[i]);
test_big_z();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/msun/tests/fmaxmin_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
CHECK_FP_EXCEPTIONS_MSG(0, ALL_STD_EXCEPT, \
#func "(%.20Lg, %.20Lg) rmode%d", (x), (y), rmode); \
ATF_CHECK_MSG(fpequal_cs(__result, (expected), true), \
#func "(%.20Lg, %.20Lg) rmode%d = %.20Lg, expected %.20Lg\n", \
#func "(%.20Lg, %.20Lg) rmode%d = %.20Lg, expected %.20Lg", \
(x), (y), rmode, __result, (expected)); \
} while (0)

Expand Down
15 changes: 15 additions & 0 deletions lib/msun/tests/invctrig_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ c3pi = 9.42477796076937971538793014983850839L;
ATF_TC_WITHOUT_HEAD(zero);
ATF_TC_BODY(zero, tc)
{
#if defined(__riscv)
atf_tc_expect_death("https://bugs.freebsd.org/290099");
#endif
long double complex zero = CMPLXL(0.0, 0.0);

testall_tol(cacosh, zero, CMPLXL(0.0, pi / 2), 1);
Expand All @@ -143,6 +146,9 @@ ATF_TC_BODY(zero, tc)
ATF_TC_WITHOUT_HEAD(nan);
ATF_TC_BODY(nan, tc)
{
#if defined(__riscv)
atf_tc_expect_death("https://bugs.freebsd.org/290099");
#endif
long double complex nan_nan = CMPLXL(NAN, NAN);
long double complex z;

Expand Down Expand Up @@ -222,6 +228,9 @@ ATF_TC_BODY(nan, tc)
ATF_TC_WITHOUT_HEAD(inf);
ATF_TC_BODY(inf, tc)
{
#if defined(__riscv)
atf_tc_expect_death("https://bugs.freebsd.org/290099");
#endif
long double complex z;

/*
Expand Down Expand Up @@ -269,6 +278,9 @@ ATF_TC_BODY(inf, tc)
ATF_TC_WITHOUT_HEAD(axes);
ATF_TC_BODY(axes, tc)
{
#if defined(__riscv)
atf_tc_expect_death("https://bugs.freebsd.org/290099");
#endif
static const long double nums[] = {
-2, -1, -0.5, 0.5, 1, 2
};
Expand Down Expand Up @@ -306,6 +318,9 @@ ATF_TC_BODY(axes, tc)
ATF_TC_WITHOUT_HEAD(small);
ATF_TC_BODY(small, tc)
{
#if defined(__riscv)
atf_tc_expect_death("https://bugs.freebsd.org/290099");
#endif
/*
* z = 0.75 + i 0.25
* acos(z) = Pi/4 - i ln(2)/2
Expand Down
26 changes: 19 additions & 7 deletions lib/msun/tests/invtrig_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
#define test_tol(func, x, result, tol, excepts) do { \
volatile long double _in = (x), _out = (result); \
ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); \
CHECK_FPEQUAL_TOL(func(_in), _out, (tol), CS_BOTH); \
CHECK_FP_EXCEPTIONS_MSG(excepts, ALL_STD_EXCEPT, "for %s(%s)", \
REQUIRE_FPEQUAL_TOL(func(_in), _out, (tol), CS_BOTH); \
REQUIRE_FP_EXCEPTIONS_MSG(excepts, ALL_STD_EXCEPT, "for %s(%s)", \
#func, #x); \
} while (0)
#define test(func, x, result, excepts) \
Expand Down Expand Up @@ -82,8 +82,8 @@
#define test2_tol(func, y, x, result, tol, excepts) do { \
volatile long double _iny = (y), _inx = (x), _out = (result); \
ATF_REQUIRE_EQ(0, feclearexcept(FE_ALL_EXCEPT)); \
CHECK_FPEQUAL_TOL(func(_iny, _inx), _out, (tol), CS_BOTH); \
CHECK_FP_EXCEPTIONS_MSG(excepts, ALL_STD_EXCEPT, "for %s(%s)", \
REQUIRE_FPEQUAL_TOL(func(_iny, _inx), _out, (tol), CS_BOTH); \
REQUIRE_FP_EXCEPTIONS_MSG(excepts, ALL_STD_EXCEPT, "for %s(%s)", \
#func, #x); \
} while (0)
#define test2(func, y, x, result, excepts) \
Expand Down Expand Up @@ -125,7 +125,9 @@ sqrt2m1 = 4.14213562373095048801688724209698081e-01L;
ATF_TC_WITHOUT_HEAD(special);
ATF_TC_BODY(special, tc)
{

#if defined(__aarch64__) || defined(__riscv)
atf_tc_expect_fail("https://bugs.freebsd.org/283017");
#endif
testall(asin, 0.0, 0.0, 0);
testall(acos, 0.0, pi / 2, FE_INEXACT);
testall(atan, 0.0, 0.0, 0);
Expand Down Expand Up @@ -238,7 +240,9 @@ ATF_TC_BODY(special_atan2, tc)
ATF_TC_WITHOUT_HEAD(accuracy);
ATF_TC_BODY(accuracy, tc)
{

#if defined(__riscv)
atf_tc_expect_fail("https://bugs.freebsd.org/290099");
#endif
/* We expect correctly rounded results for these basic cases. */
testall(asin, 1.0, pi / 2, FE_INEXACT);
testall(acos, 1.0, 0, 0);
Expand Down Expand Up @@ -276,7 +280,9 @@ ATF_TC_BODY(accuracy, tc)
ATF_TC_WITHOUT_HEAD(p2x_atan2);
ATF_TC_BODY(p2x_atan2, tc)
{

#if defined(__riscv)
atf_tc_expect_fail("https://bugs.freebsd.org/290099");
#endif
testall2(atan2, 1.0, 1.0, pi / 4, FE_INEXACT);
testall2(atan2, 1.0, -1.0, c3pi / 4, FE_INEXACT);
testall2(atan2, -1.0, 1.0, -pi / 4, FE_INEXACT);
Expand All @@ -299,6 +305,9 @@ ATF_TC_BODY(p2x_atan2, tc)
ATF_TC_WITHOUT_HEAD(tiny);
ATF_TC_BODY(tiny, tc)
{
#if defined(__aarch64__) || defined(__riscv)
atf_tc_expect_fail("https://bugs.freebsd.org/283017");
#endif
float tiny = 0x1.23456p-120f;

testall(asin, tiny, tiny, FE_INEXACT);
Expand Down Expand Up @@ -436,6 +445,9 @@ tanatanl(long double x)
ATF_TC_WITHOUT_HEAD(inverse);
ATF_TC_BODY(inverse, tc)
{
#if defined(__riscv)
atf_tc_expect_death("https://bugs.freebsd.org/290099");
#endif
float i;

for (i = -1; i <= 1; i += 0x1.0p-12f) {
Expand Down
11 changes: 9 additions & 2 deletions lib/msun/tests/logarithm_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@
ATF_TC_WITHOUT_HEAD(generic_tests);
ATF_TC_BODY(generic_tests, tc)
{

#if defined(__aarch64__) || defined(__riscv)
atf_tc_expect_fail("https://bugs.freebsd.org/290099");
#endif
/* log(1) == 0, no exceptions raised */
testall0(1.0, 0.0, ALL_STD_EXCEPT, 0);
testall1(0.0, 0.0, ALL_STD_EXCEPT, 0);
Expand Down Expand Up @@ -179,6 +181,9 @@ ATF_TC_BODY(roundingmode_tests, tc)
ATF_TC_WITHOUT_HEAD(accuracy_tests);
ATF_TC_BODY(accuracy_tests, tc)
{
#if defined(__riscv)
atf_tc_expect_death("https://bugs.freebsd.org/290099");
#endif
static const struct {
float x;
long double log2x;
Expand Down Expand Up @@ -248,7 +253,9 @@ ATF_TC_BODY(log1p_accuracy_tests, tc)
if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false))
atf_tc_expect_fail("https://bugs.freebsd.org/253984");
#endif

#if defined(__riscv)
atf_tc_expect_death("https://bugs.freebsd.org/290099");
#endif
test_tol(log1pf, 0x0.333333p0F,
1.82321546859847114303367992804596800640e-1L, FLT_ULP());
test_tol(log1p, 0x0.3333333333333p0,
Expand Down
7 changes: 5 additions & 2 deletions lib/msun/tests/lrint_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
#include "test-utils.h"

#define test(func, x, result, excepts) do { \
ATF_CHECK(feclearexcept(FE_ALL_EXCEPT) == 0); \
ATF_REQUIRE(feclearexcept(FE_ALL_EXCEPT) == 0); \
long long _r = (func)(x); \
ATF_CHECK_MSG(_r == (result) || fetestexcept(FE_INVALID), \
ATF_REQUIRE_MSG(_r == (result) || fetestexcept(FE_INVALID), \
#func "(%Lg) returned %lld, expected %lld", (long double)x, _r, \
(long long)(result)); \
CHECK_FP_EXCEPTIONS_MSG(excepts, FE_ALL_EXCEPT & ALL_STD_EXCEPT, \
Expand Down Expand Up @@ -131,6 +131,9 @@ run_tests(void)
ATF_TC_WITHOUT_HEAD(lrint);
ATF_TC_BODY(lrint, tc)
{
#if defined(__aarch64__) || defined(__riscv)
atf_tc_expect_fail("https://bugs.freebsd.org/290099");
#endif
run_tests();
#ifdef __i386__
fpsetprec(FP_PE);
Expand Down
3 changes: 3 additions & 0 deletions lib/msun/tests/lround_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@
ATF_TC_WITHOUT_HEAD(main);
ATF_TC_BODY(main, tc)
{
#if defined(__powerpc64__)
atf_tc_expect_fail("https://bugs.freebsd.org/290099");
#endif
testall(0.0, 0, 0);
testall(0.25, 0, FE_INEXACT);
testall(0.5, 1, FE_INEXACT);
Expand Down
3 changes: 3 additions & 0 deletions lib/msun/tests/nan_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ testnan(const char *nan_format)
ATF_TC_WITHOUT_HEAD(nan);
ATF_TC_BODY(nan, tc)
{
#if defined(__riscv)
atf_tc_expect_fail("https://bugs.freebsd.org/290099");
#endif
/* Die if a signalling NaN is returned */
feenableexcept(FE_INVALID);

Expand Down
Loading
Loading