[libc-commits] [libc] [libc] Fix incomplete sincos_test. (PR #97174)
via libc-commits
libc-commits at lists.llvm.org
Sat Jun 29 11:39:35 PDT 2024
https://github.com/lntue created https://github.com/llvm/llvm-project/pull/97174
None
>From 8901fa9030712472c32d2d7449e198bc7e25e9a1 Mon Sep 17 00:00:00 2001
From: Tue Ly <lntue.h at gmail.com>
Date: Sat, 29 Jun 2024 18:38:35 +0000
Subject: [PATCH] [libc] Fix incomplete sincos_test.
---
libc/test/src/math/sincos_test.cpp | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/libc/test/src/math/sincos_test.cpp b/libc/test/src/math/sincos_test.cpp
index c0cbff7084d19..7e06456f2e05c 100644
--- a/libc/test/src/math/sincos_test.cpp
+++ b/libc/test/src/math/sincos_test.cpp
@@ -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);
+ }
}
More information about the libc-commits
mailing list