[libc-commits] [libc] [libc][NFC] Remove libcpp include from atanf_test (PR #71449)
via libc-commits
libc-commits at lists.llvm.org
Mon Nov 6 14:31:41 PST 2023
https://github.com/michaelrj-google created https://github.com/llvm/llvm-project/pull/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.
>From 47333a8605765f44f424975fefaf0079060df161 Mon Sep 17 00:00:00 2001
From: Michael Jones <michaelrj at google.com>
Date: Mon, 6 Nov 2023 14:14:32 -0800
Subject: [PATCH] [libc][NFC] Remove libcpp include from atanf_test
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.
---
libc/test/src/math/atanf_test.cpp | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
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);
More information about the libc-commits
mailing list