[libc-commits] [libc] [libc][math] Disable `FEnvSafeTest.cpp` if AArch64 target has no FP support (PR #166370)

Victor Campos via libc-commits libc-commits at lists.llvm.org
Tue Nov 4 05:33:19 PST 2025


https://github.com/vhscampos created https://github.com/llvm/llvm-project/pull/166370

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.

>From 90b47731cf7bd0f5e595c28411fab3c8fed86ccb Mon Sep 17 00:00:00 2001
From: Victor Campos <victor.campos at arm.com>
Date: Mon, 3 Nov 2025 11:48:57 +0000
Subject: [PATCH] [libc][math] Disable `FEnvSafeTest.cpp` if AArch64 target has
 no FP support

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.
---
 libc/test/UnitTest/FEnvSafeTest.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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);



More information about the libc-commits mailing list