From 07d5be28203742d39e1bcb09e7333fd311074f0b Mon Sep 17 00:00:00 2001 From: David Spickett Date: Wed, 14 Aug 2024 12:49:05 +0000 Subject: [PATCH 1/2] [libcxx][test] Add feature for platforms where sizeof(long double) == sizeof(double) Instead of having to match a whole bunch of different target names. --- .../cmp.alg/strong_order_long_double.verify.cpp | 17 +---------------- libcxx/utils/libcxx/test/features.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/libcxx/test/std/language.support/cmp/cmp.alg/strong_order_long_double.verify.cpp b/libcxx/test/std/language.support/cmp/cmp.alg/strong_order_long_double.verify.cpp index c9c2ba2002149..7310a38509a3f 100644 --- a/libcxx/test/std/language.support/cmp/cmp.alg/strong_order_long_double.verify.cpp +++ b/libcxx/test/std/language.support/cmp/cmp.alg/strong_order_long_double.verify.cpp @@ -6,22 +6,7 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03, c++11, c++14, c++17 - -// The following platforms have sizeof(long double) == sizeof(double), so this test doesn't apply to them. -// This test does apply to aarch64 where Arm's AAPCS64 is followed. There they are different sizes. -// XFAIL: target={{arm64|arm64e|armv(7|8)(l|m)?|powerpc|powerpc64}}-{{.+}} - -// MSVC configurations have long double equal to regular double on all -// architectures. -// XFAIL: target={{.+}}-pc-windows-msvc - -// ARM/AArch64 MinGW also has got long double equal to regular double, just -// like MSVC (thus match both MinGW and MSVC here, for those architectures). -// XFAIL: target={{aarch64|armv7}}-{{.*}}-windows-{{.+}} - -// Android's 32-bit x86 target has long double equal to regular double. -// XFAIL: target=i686-{{.+}}-android{{.*}} +// UNSUPPORTED: c++03, c++11, c++14, c++17, long-double-is-double // diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py index 97cdb0349885d..cc0de556ae82c 100644 --- a/libcxx/utils/libcxx/test/features.py +++ b/libcxx/utils/libcxx/test/features.py @@ -227,6 +227,18 @@ def _mingwSupportsModules(cfg): """, ), ), + Feature( + name="long-double-is-double", + when=lambda cfg: sourceBuilds( + cfg, + """ + int main(int, char**) { + static_assert(sizeof(long double) == sizeof(double)); + 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( From 1fb787c9d6c6c63925d6520b7f0b6b759a19481f Mon Sep 17 00:00:00 2001 From: David Spickett Date: Wed, 14 Aug 2024 12:55:30 +0000 Subject: [PATCH 2/2] xfail instead. --- .../cmp/cmp.alg/strong_order_long_double.verify.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libcxx/test/std/language.support/cmp/cmp.alg/strong_order_long_double.verify.cpp b/libcxx/test/std/language.support/cmp/cmp.alg/strong_order_long_double.verify.cpp index 7310a38509a3f..7d3a1309814aa 100644 --- a/libcxx/test/std/language.support/cmp/cmp.alg/strong_order_long_double.verify.cpp +++ b/libcxx/test/std/language.support/cmp/cmp.alg/strong_order_long_double.verify.cpp @@ -6,7 +6,9 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03, c++11, c++14, c++17, long-double-is-double +// UNSUPPORTED: c++03, c++11, c++14, c++17 + +// XFAIL: long-double-is-double //