[libcxx-commits] [libcxx] [libc++] tests with picolibc: add has-compolete-fenv feature (PR #74610)
Dominik Wójt via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Dec 6 07:43:37 PST 2023
https://github.com/domin144 created https://github.com/llvm/llvm-project/pull/74610
The FE_* macros checked for in cfenv.pass.cpp are not required to be defined, if the relevant options are available. Picolibc happens not to provide these on some platforms.
Added a test in features.py to skip fenv test automatically.
>From 58abdbb78ffb59dd369509a3787d499a17e405e3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20W=C3=B3jt?= <dominik.wojt at arm.com>
Date: Tue, 24 Oct 2023 12:12:27 +0200
Subject: [PATCH] [libc++] tests with picolibc: add has-compolete-fenv feature
The FE_* macros checked for in cfenv.pass.cpp are not required to be
defined, if the relevant options are available. Picolibc happens not to
provide these on some platforms.
Added a test in features.py to skip fenv test automatically.
---
.../depr.c.headers/fenv_h.compile.pass.cpp | 2 +-
.../numerics/cfenv/cfenv.syn/cfenv.pass.cpp | 2 +-
libcxx/utils/libcxx/test/features.py | 29 +++++++++++++++++++
3 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/libcxx/test/std/depr/depr.c.headers/fenv_h.compile.pass.cpp b/libcxx/test/std/depr/depr.c.headers/fenv_h.compile.pass.cpp
index dcc97573d6073..a896f5e03c3af 100644
--- a/libcxx/test/std/depr/depr.c.headers/fenv_h.compile.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/fenv_h.compile.pass.cpp
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
// Floating point exceptions are required for the FE_... macros to be defined.
-// XFAIL: LIBCXX-PICOLIBC-FIXME
+// REQUIRES: has-compolete-fenv
// <fenv.h>
diff --git a/libcxx/test/std/numerics/cfenv/cfenv.syn/cfenv.pass.cpp b/libcxx/test/std/numerics/cfenv/cfenv.syn/cfenv.pass.cpp
index 7b3b490eba273..5a39003d00d0f 100644
--- a/libcxx/test/std/numerics/cfenv/cfenv.syn/cfenv.pass.cpp
+++ b/libcxx/test/std/numerics/cfenv/cfenv.syn/cfenv.pass.cpp
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
// Floating point exceptions are required for the FE_... macros to be defined.
-// XFAIL: LIBCXX-PICOLIBC-FIXME
+// REQUIRES: has-compolete-fenv
// <cfenv>
diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py
index ccabb48833f10..f5b12f90c0510 100644
--- a/libcxx/utils/libcxx/test/features.py
+++ b/libcxx/utils/libcxx/test/features.py
@@ -212,6 +212,35 @@ def _getAndroidDeviceApi(cfg):
""",
),
),
+ # Some platform do not provide complete floating point environment.
+ Feature(
+ name="has-compolete-fenv",
+ when=lambda cfg: sourceBuilds(
+ cfg,
+ """
+ #include <fenv.h>
+
+ #if !( \
+ defined FE_DIVBYZERO \
+ && defined FE_INEXACT \
+ && defined FE_INVALID \
+ && defined FE_INEXACT \
+ && defined FE_OVERFLOW \
+ && defined FE_UNDERFLOW \
+ && defined FE_ALL_EXCEPT \
+ && defined FE_DOWNWARD \
+ && defined FE_TONEAREST \
+ && defined FE_TOWARDZERO \
+ && defined FE_UPWARD \
+ && defined FE_DFL_ENV \
+ && defined FE_INEXACT)
+ #error Floating point environment not complete
+ #endif
+
+ int main(int, char**) { return 0; }
+ """,
+ ),
+ ),
# Check for a Windows UCRT bug (fixed in UCRT/Windows 10.0.20348.0):
# https://developercommunity.visualstudio.com/t/utf-8-locales-break-ctype-functions-for-wchar-type/1653678
Feature(
More information about the libcxx-commits
mailing list