[libc-commits] [libc] b8450d4 - [libc] Fix incomplete sincos_test. (#97174)

via libc-commits libc-commits at lists.llvm.org
Sat Jun 29 14:21:03 PDT 2024


Author: lntue
Date: 2024-06-29T17:21:00-04:00
New Revision: b8450d4ec8ba07dfaf9d7475ef34e3c333e9b361

URL: https://github.com/llvm/llvm-project/commit/b8450d4ec8ba07dfaf9d7475ef34e3c333e9b361
DIFF: https://github.com/llvm/llvm-project/commit/b8450d4ec8ba07dfaf9d7475ef34e3c333e9b361.diff

LOG: [libc] Fix incomplete sincos_test. (#97174)

Added: 
    

Modified: 
    libc/test/src/math/sincos_test.cpp

Removed: 
    


################################################################################
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