[libc-commits] [libc] 5876a7a - [libc][math] Add tolerance for powf smoke test when skipping accurate pass. (#229656)
via libc-commits
libc-commits at lists.llvm.org
Tue Oct 6 22:01:49 PDT 2026
Author: lntue
Date: 2026-10-07T05:01:41Z
New Revision: 5876a7a512379dd27b3a7082cf652448f103f514
URL: https://github.com/llvm/llvm-project/commit/5876a7a512379dd27b3a7082cf652448f103f514
DIFF: https://github.com/llvm/llvm-project/commit/5876a7a512379dd27b3a7082cf652448f103f514.diff
LOG: [libc][math] Add tolerance for powf smoke test when skipping accurate pass. (#229656)
Added:
Modified:
libc/test/src/math/smoke/powf_test.cpp
Removed:
################################################################################
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);
More information about the libc-commits
mailing list