Skip to content

[libc][math] Disable FEnvSafeTest.cpp if AArch64 target has no FP support#166370

Merged
vhscampos merged 1 commit into
llvm:mainfrom
vhscampos:fenvsafetest
Nov 5, 2025
Merged

[libc][math] Disable FEnvSafeTest.cpp if AArch64 target has no FP support#166370
vhscampos merged 1 commit into
llvm:mainfrom
vhscampos:fenvsafetest

Conversation

@vhscampos

Copy link
Copy Markdown
Member

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.

…upport

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.
@llvmbot llvmbot added the libc label Nov 4, 2025
@llvmbot

llvmbot commented Nov 4, 2025

Copy link
Copy Markdown
Member

@llvm/pr-subscribers-libc

Author: Victor Campos (vhscampos)

Changes

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

@SchrodingerZhu SchrodingerZhu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vhscampos vhscampos merged commit d249e67 into llvm:main Nov 5, 2025
22 checks passed
@vhscampos vhscampos deleted the fenvsafetest branch November 5, 2025 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants