[libc-commits] [libc] [libc][math] Add tolerance for powf smoke test when skipping accurate pass. (PR #229656)

via libc-commits libc-commits at lists.llvm.org
Tue Oct 6 21:51:32 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: lntue

<details>
<summary>Changes</summary>



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


1 Files Affected:

- (modified) libc/test/src/math/smoke/powf_test.cpp (+8-3) 


``````````diff
diff --git a/libc/test/src/math/smoke/powf_test.cpp b/libc/test/src/math/smoke/powf_test.cpp
index bda8d34f7c5f1..46d4f1b712094 100644
--- a/libc/test/src/math/smoke/powf_test.cpp
+++ b/libc/test/src/math/smoke/powf_test.cpp
@@ -21,6 +21,12 @@
 #include "test/UnitTest/FPMatcher.h"
 #include "test/UnitTest/Test.h"
 
+#ifdef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
+#define TOLERANCE 1
+#else
+#define TOLERANCE 0
+#endif // LIBC_MATH_HAS_SKIP_ACCURATE_PASS
+
 using LIBC_NAMESPACE::fputil::testing::ForceRoundingMode;
 using LIBC_NAMESPACE::fputil::testing::RoundingMode;
 
@@ -295,8 +301,7 @@ class PowfTest : public LIBC_NAMESPACE::testing::FPTest<float> {
   LIST_POWF_FTZ_DAZ_TESTS(suffix, func)                                        \
   static_assert(true, "Require semicolon.")
 
-LIST_POWF_TESTS(Default, LIBC_NAMESPACE::powf, /*tolerance=*/0);
-LIST_POWF_TESTS(DoubleEval, LIBC_NAMESPACE::math::double_eval::powf,
-                /*tolerance=*/0);
+LIST_POWF_TESTS(Default, LIBC_NAMESPACE::powf, TOLERANCE);
+LIST_POWF_TESTS(DoubleEval, LIBC_NAMESPACE::math::double_eval::powf, TOLERANCE);
 LIST_POWF_TESTS(FloatEval, LIBC_NAMESPACE::math::float_eval::powf,
                 /*tolerance=*/1);

``````````

</details>


https://github.com/llvm/llvm-project/pull/229656


More information about the libc-commits mailing list