[libc-commits] [libc] [libc][math] add smoke tests to shared/math.h (PR #149741)
via libc-commits
libc-commits at lists.llvm.org
Sun Jul 20 14:33:37 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp,h -- libc/test/shared/smoke/acos_test.cpp libc/src/__support/math/acos.h libc/src/__support/math/acosf.h libc/src/__support/math/asin_utils.h libc/src/__support/math/inv_trigf_utils.h libc/src/math/generic/asin.cpp libc/src/math/generic/asinf.cpp libc/src/math/generic/atan2f.cpp libc/src/math/generic/atanf.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libc/src/__support/math/acosf.h b/libc/src/__support/math/acosf.h
index 100f1393a..153087e99 100644
--- a/libc/src/__support/math/acosf.h
+++ b/libc/src/__support/math/acosf.h
@@ -43,7 +43,7 @@ static constexpr fputil::ExceptValues<float, N_EXCEPTS> ACOSF_EXCEPTS = {{
#endif // !LIBC_MATH_HAS_SKIP_ACCURATE_PASS
-} //namespace acosf_internal
+} // namespace acosf_internal
static constexpr float acosf(float x) {
using namespace acosf_internal;
diff --git a/libc/test/shared/smoke/acos_test.cpp b/libc/test/shared/smoke/acos_test.cpp
index 89f08b675..71db88150 100644
--- a/libc/test/shared/smoke/acos_test.cpp
+++ b/libc/test/shared/smoke/acos_test.cpp
@@ -13,24 +13,24 @@
using LlvmLibcAcosTest = LIBC_NAMESPACE::testing::FPTest<double>;
TEST_F(LlvmLibcAcosTest, SpecialNumbers) {
- EXPECT_FP_EQ_WITH_EXCEPTION_ALL_ROUNDING(aNaN, LIBC_NAMESPACE::math::acos(sNaN),
- FE_INVALID);
+ EXPECT_FP_EQ_WITH_EXCEPTION_ALL_ROUNDING(
+ aNaN, LIBC_NAMESPACE::math::acos(sNaN), FE_INVALID);
EXPECT_FP_EQ_ALL_ROUNDING(aNaN, LIBC_NAMESPACE::math::acos(aNaN));
EXPECT_FP_EQ(0x1.921fb54442d18p0, LIBC_NAMESPACE::math::acos(zero));
EXPECT_FP_EQ(0x1.921fb54442d18p0, LIBC_NAMESPACE::math::acos(neg_zero));
libc_errno = 0;
- EXPECT_FP_EQ_WITH_EXCEPTION_ALL_ROUNDING(aNaN, LIBC_NAMESPACE::math::acos(inf),
- FE_INVALID);
+ EXPECT_FP_EQ_WITH_EXCEPTION_ALL_ROUNDING(
+ aNaN, LIBC_NAMESPACE::math::acos(inf), FE_INVALID);
EXPECT_MATH_ERRNO(EDOM);
- EXPECT_FP_EQ_WITH_EXCEPTION_ALL_ROUNDING(aNaN, LIBC_NAMESPACE::math::acos(neg_inf),
- FE_INVALID);
+ EXPECT_FP_EQ_WITH_EXCEPTION_ALL_ROUNDING(
+ aNaN, LIBC_NAMESPACE::math::acos(neg_inf), FE_INVALID);
EXPECT_MATH_ERRNO(EDOM);
- EXPECT_FP_EQ_WITH_EXCEPTION_ALL_ROUNDING(aNaN, LIBC_NAMESPACE::math::acos(2.0),
- FE_INVALID);
+ EXPECT_FP_EQ_WITH_EXCEPTION_ALL_ROUNDING(
+ aNaN, LIBC_NAMESPACE::math::acos(2.0), FE_INVALID);
EXPECT_MATH_ERRNO(EDOM);
- EXPECT_FP_EQ_WITH_EXCEPTION_ALL_ROUNDING(aNaN, LIBC_NAMESPACE::math::acos(-2.0),
- FE_INVALID);
+ EXPECT_FP_EQ_WITH_EXCEPTION_ALL_ROUNDING(
+ aNaN, LIBC_NAMESPACE::math::acos(-2.0), FE_INVALID);
EXPECT_MATH_ERRNO(EDOM);
EXPECT_FP_EQ(zero, LIBC_NAMESPACE::math::acos(1.0));
EXPECT_FP_EQ(0x1.921fb54442d18p1, LIBC_NAMESPACE::math::acos(-1.0));
``````````
</details>
https://github.com/llvm/llvm-project/pull/149741
More information about the libc-commits
mailing list