Skip to content

[libc] Fix incomplete sincos_test. #97174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 29, 2024
Merged

[libc] Fix incomplete sincos_test. #97174

merged 1 commit into from
Jun 29, 2024

Conversation

lntue
Copy link
Contributor

@lntue lntue commented Jun 29, 2024

No description provided.

@lntue lntue requested a review from jhuber6 June 29, 2024 18:39
@llvmbot llvmbot added the libc label Jun 29, 2024
@llvmbot
Copy link
Member

llvmbot commented Jun 29, 2024

@llvm/pr-subscribers-libc

Author: None (lntue)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/97174.diff

1 Files Affected:

  • (modified) libc/test/src/math/sincos_test.cpp (+7-9)
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);
+  }
 }

@@ -103,18 +103,16 @@ TEST_F(LlvmLibcSincosTest, TrickyInputs) {
}

TEST_F(LlvmLibcSincosTest, InDoubleRange) {
constexpr uint64_t COUNT = 123'451;
constexpr uint64_t COUNT = 123'41;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to be 12345?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some random number, but I should have put it as 12'341 instead

@lntue lntue merged commit b8450d4 into llvm:main Jun 29, 2024
8 checks passed
@lntue lntue deleted the sincos branch June 29, 2024 21:21
lravenclaw pushed a commit to lravenclaw/llvm-project that referenced this pull request Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants