Skip to content

Commit 009ba77

Browse files
[libc][NFC] Remove libcpp include from atanf_test (#71449)
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.
1 parent 374fb41 commit 009ba77

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

libc/test/src/math/atanf_test.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
#include <errno.h>
1818
#include <stdint.h>
1919

20-
#include <initializer_list>
21-
2220
using LlvmLibcAtanfTest = LIBC_NAMESPACE::testing::FPTest<float>;
2321

2422
namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
@@ -55,8 +53,9 @@ TEST_F(LlvmLibcAtanfTest, InFloatRange) {
5553

5654
// For small values, tanh(x) is x.
5755
TEST_F(LlvmLibcAtanfTest, SpecialValues) {
58-
for (uint32_t v : {0x3d8d6b23U, 0x3feefcfbU, 0xbd8d6b23U, 0xbfeefcfbU,
59-
0x7F800000U, 0xFF800000U}) {
56+
uint32_t val_arr[] = {0x3d8d6b23U, 0x3feefcfbU, 0xbd8d6b23U,
57+
0xbfeefcfbU, 0x7F800000U, 0xFF800000U};
58+
for (uint32_t v : val_arr) {
6059
float x = float(FPBits(v));
6160
EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Atan, x,
6261
LIBC_NAMESPACE::atanf(x), 0.5);

0 commit comments

Comments
 (0)