Skip to content

Commit

Permalink
[libc] Fix incomplete sincos_test. (llvm#97174)
Browse files Browse the repository at this point in the history
  • Loading branch information
lntue authored Jun 29, 2024
1 parent 9ea9e71 commit b8450d4
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions libc/test/src/math/sincos_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,16 @@ TEST_F(LlvmLibcSincosTest, TrickyInputs) {
}

TEST_F(LlvmLibcSincosTest, InDoubleRange) {
constexpr uint64_t COUNT = 123'451;
constexpr uint64_t COUNT = 123'41;
uint64_t START = LIBC_NAMESPACE::fputil::FPBits<double>(0x1.0p-50).uintval();
uint64_t STOP = LIBC_NAMESPACE::fputil::FPBits<double>(0x1.0p200).uintval();
uint64_t STEP = (STOP - START) / COUNT;

auto test = [&](mpfr::RoundingMode rounding_mode) {
for (uint64_t i = 0, v = START; i <= COUNT; ++i, v += STEP) {
double x = FPBits(v).get_val();
if (isnan(x) || isinf(x))
continue;
for (uint64_t i = 0, v = START; i <= COUNT; ++i, v += STEP) {
double x = FPBits(v).get_val();
if (isnan(x) || isinf(x))
continue;

ASSERT_SINCOS_MATCH_ALL_ROUNDING(x);
}
};
ASSERT_SINCOS_MATCH_ALL_ROUNDING(x);
}
}

0 comments on commit b8450d4

Please sign in to comment.