[libc-commits] [libc] [libc][math] Disable `FEnvSafeTest.cpp` if AArch64 target has no FP support (PR #166370)
via libc-commits
libc-commits at lists.llvm.org
Tue Nov 4 05:34:01 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libc
Author: Victor Campos (vhscampos)
<details>
<summary>Changes</summary>
The `FEnvSafeTest.cpp` test fails on AArch64 soft nofp configurations because LLVM libc does not provide a floating-point environment in these configurations.
This patch adds another preprocessor guard on `__ARM_FP` to disable the test on those.
---
Full diff: https://github.com/llvm/llvm-project/pull/166370.diff
1 Files Affected:
- (modified) libc/test/UnitTest/FEnvSafeTest.cpp (+2-1)
``````````diff
diff --git a/libc/test/UnitTest/FEnvSafeTest.cpp b/libc/test/UnitTest/FEnvSafeTest.cpp
index 4393f9d5e5c3b..64f50d7be7fe3 100644
--- a/libc/test/UnitTest/FEnvSafeTest.cpp
+++ b/libc/test/UnitTest/FEnvSafeTest.cpp
@@ -43,7 +43,8 @@ void FEnvSafeTest::set_fenv(const fenv_t &fenv) {
void FEnvSafeTest::expect_fenv_eq(const fenv_t &before_fenv,
const fenv_t &after_fenv) {
-#if defined(LIBC_TARGET_ARCH_IS_AARCH64) && !defined(LIBC_COMPILER_IS_MSVC)
+#if defined(LIBC_TARGET_ARCH_IS_AARCH64) && !defined(LIBC_COMPILER_IS_MSVC) && \
+ defined(__ARM_FP)
using FPState = LIBC_NAMESPACE::fputil::FEnv::FPState;
const FPState &before_state = reinterpret_cast<const FPState &>(before_fenv);
const FPState &after_state = reinterpret_cast<const FPState &>(after_fenv);
``````````
</details>
https://github.com/llvm/llvm-project/pull/166370
More information about the libc-commits
mailing list