Skip to content

Commit d249e67

Browse files
authored
[libc][math] Disable FEnvSafeTest.cpp if AArch64 target has no FP support (#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.
1 parent 5821b09 commit d249e67

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libc/test/UnitTest/FEnvSafeTest.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ void FEnvSafeTest::set_fenv(const fenv_t &fenv) {
4343

4444
void FEnvSafeTest::expect_fenv_eq(const fenv_t &before_fenv,
4545
const fenv_t &after_fenv) {
46-
#if defined(LIBC_TARGET_ARCH_IS_AARCH64) && !defined(LIBC_COMPILER_IS_MSVC)
46+
#if defined(LIBC_TARGET_ARCH_IS_AARCH64) && !defined(LIBC_COMPILER_IS_MSVC) && \
47+
defined(__ARM_FP)
4748
using FPState = LIBC_NAMESPACE::fputil::FEnv::FPState;
4849
const FPState &before_state = reinterpret_cast<const FPState &>(before_fenv);
4950
const FPState &after_state = reinterpret_cast<const FPState &>(after_fenv);

0 commit comments

Comments
 (0)