Skip to content
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

[libc][NFC] Remove libcpp include from atanf_test #71449

Merged

Conversation

michaelrj-google
Copy link
Contributor

The test for atanf used <initializer_list> to simplify iterating through
an array. This caused issues with the new features.h change by creating a
libcpp dependency in the test. This change moves the list to an array
variable, removing the need for that dependency.

The test for atanf used <initializer_list> to simplify iterating through
an array. This caused issues with the new features.h change by creating a
libcpp dependency in the test. This change moves the list to an array
variable, removing the need for that dependency.
@llvmbot llvmbot added the libc label Nov 6, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented Nov 6, 2023

@llvm/pr-subscribers-libc

Author: None (michaelrj-google)

Changes

The test for atanf used <initializer_list> to simplify iterating through
an array. This caused issues with the new features.h change by creating a
libcpp dependency in the test. This change moves the list to an array
variable, removing the need for that dependency.


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

1 Files Affected:

  • (modified) libc/test/src/math/atanf_test.cpp (+3-4)
diff --git a/libc/test/src/math/atanf_test.cpp b/libc/test/src/math/atanf_test.cpp
index cd4f7b89ee282e8..61d202e22bdc6f9 100644
--- a/libc/test/src/math/atanf_test.cpp
+++ b/libc/test/src/math/atanf_test.cpp
@@ -17,8 +17,6 @@
 #include <errno.h>
 #include <stdint.h>
 
-#include <initializer_list>
-
 using LlvmLibcAtanfTest = LIBC_NAMESPACE::testing::FPTest<float>;
 
 namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
@@ -55,8 +53,9 @@ TEST_F(LlvmLibcAtanfTest, InFloatRange) {
 
 // For small values, tanh(x) is x.
 TEST_F(LlvmLibcAtanfTest, SpecialValues) {
-  for (uint32_t v : {0x3d8d6b23U, 0x3feefcfbU, 0xbd8d6b23U, 0xbfeefcfbU,
-                     0x7F800000U, 0xFF800000U}) {
+  uint32_t val_arr[] = {0x3d8d6b23U, 0x3feefcfbU, 0xbd8d6b23U,
+                        0xbfeefcfbU, 0x7F800000U, 0xFF800000U};
+  for (uint32_t v : val_arr) {
     float x = float(FPBits(v));
     EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Atan, x,
                                    LIBC_NAMESPACE::atanf(x), 0.5);

@lntue lntue self-requested a review November 7, 2023 00:07
Copy link

@M4ximumPizza M4ximumPizza left a comment

Choose a reason for hiding this comment

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

Looks solid!

@michaelrj-google michaelrj-google merged commit 009ba77 into llvm:main Nov 7, 2023
4 checks passed
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.

None yet

4 participants