[libc-commits] [libc] [libc] Xfail a couple of testcases in smoke/powf_test.cpp in skip accurate pass mode (PR #241337)

Victor Campos via libc-commits libc-commits at lists.llvm.org
Wed Nov 11 06:46:13 PST 2026


https://github.com/vhscampos updated https://github.com/llvm/llvm-project/pull/241337

>From 6d35ec82cca719c5c67a2e966a3f05e3a3022385 Mon Sep 17 00:00:00 2001
From: Victor Campos <victor.campos at arm.com>
Date: Wed, 11 Nov 2026 13:46:35 +0000
Subject: [PATCH 1/2] [libc] Xfail a couple of testcases in smoke/powf_test.cpp
 in skip accurate pass mode

These two testcases fail if libc is build with math skip accurate pass.

This is a limitation in powf implementation and needs to be fixed. This
current patch is just to disable them while the implementation remains
unfixed.
---
 libc/test/src/math/smoke/powf_test.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libc/test/src/math/smoke/powf_test.cpp b/libc/test/src/math/smoke/powf_test.cpp
index 57c6c1fb9ad0a7..bef16df77bb818 100644
--- a/libc/test/src/math/smoke/powf_test.cpp
+++ b/libc/test/src/math/smoke/powf_test.cpp
@@ -269,17 +269,21 @@ class PowfTest : public LIBC_NAMESPACE::testing::FPTest<float> {
                                   FE_UNDERFLOW | FE_INEXACT);
       EXPECT_FP_EQ_WITH_EXCEPTION(negative, func(-0x1.8p-130f, 3.0f),
                                   FE_UNDERFLOW | FE_INEXACT);
+
+      constexpr float SUBNORMAL_BOUND = 150.0f / 126.0f;
+      uint32_t bound_bits = FPBits(SUBNORMAL_BOUND).uintval();
+#ifndef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
+      // FIXME: this should work even with skip accurate pass
       float boundary = ROUNDING_MODES[mode] == RoundingMode::Upward ||
                                ROUNDING_MODES[mode] == RoundingMode::Nearest
                            ? min_denormal
                            : zero;
       EXPECT_FP_EQ_WITH_EXCEPTION(boundary, func(0x1.fffffep-2f, 0x1.2bfffep7f),
                                   FE_UNDERFLOW | FE_INEXACT);
-      constexpr float SUBNORMAL_BOUND = 150.0f / 126.0f;
-      uint32_t bound_bits = FPBits(SUBNORMAL_BOUND).uintval();
       EXPECT_FP_EQ_WITH_EXCEPTION(
           boundary, func(0x1.fffffcp-127f, FPBits(bound_bits - 1).get_val()),
           FE_UNDERFLOW | FE_INEXACT);
+#endif
       EXPECT_FP_EQ_WITH_EXCEPTION(
           positive, func(0x1.fffffcp-127f, FPBits(bound_bits + 1).get_val()),
           FE_UNDERFLOW | FE_INEXACT);

>From d4c3bc05556feea461b9a9a32fb81777b3718ea9 Mon Sep 17 00:00:00 2001
From: Victor Campos <victor.campos at arm.com>
Date: Wed, 11 Nov 2026 14:45:06 +0000
Subject: [PATCH 2/2] Fix nit

---
 libc/test/src/math/smoke/powf_test.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libc/test/src/math/smoke/powf_test.cpp b/libc/test/src/math/smoke/powf_test.cpp
index bef16df77bb818..134b961b0363ff 100644
--- a/libc/test/src/math/smoke/powf_test.cpp
+++ b/libc/test/src/math/smoke/powf_test.cpp
@@ -283,7 +283,7 @@ class PowfTest : public LIBC_NAMESPACE::testing::FPTest<float> {
       EXPECT_FP_EQ_WITH_EXCEPTION(
           boundary, func(0x1.fffffcp-127f, FPBits(bound_bits - 1).get_val()),
           FE_UNDERFLOW | FE_INEXACT);
-#endif
+#endif // ndef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
       EXPECT_FP_EQ_WITH_EXCEPTION(
           positive, func(0x1.fffffcp-127f, FPBits(bound_bits + 1).get_val()),
           FE_UNDERFLOW | FE_INEXACT);



More information about the libc-commits mailing list