From d15fad2653d429efbf1a7c63c375530f8a1a1fa3 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Sun, 19 Jan 2020 21:49:14 -0500 Subject: [PATCH] [libc++][libc++abi] Fix or suppress failing tests in single-threaded builds. Fix a libc++abi test that was incorrectly checking for threading primitives even when threading was disabled. Additionally, temporarily XFAIL some module tests that fail because the header is unsupported but still built as a part of the std module. To properly address this libc++ would either need to produce a different module.modulemap for single-threaded configurations, or it would need to make the header not hard-error and instead be empty for single-threaded configurations --- libcxx/test/libcxx/modules/cinttypes_exports.sh.cpp | 4 ++++ libcxx/test/libcxx/modules/clocale_exports.sh.cpp | 4 ++++ libcxx/test/libcxx/modules/cstdint_exports.sh.cpp | 4 ++++ libcxx/test/libcxx/modules/inttypes_h_exports.sh.cpp | 4 ++++ libcxx/test/libcxx/modules/stdint_h_exports.sh.cpp | 4 ++++ libcxxabi/test/guard_test_basic.pass.cpp | 2 +- 6 files changed, 21 insertions(+), 1 deletion(-) diff --git a/libcxx/test/libcxx/modules/cinttypes_exports.sh.cpp b/libcxx/test/libcxx/modules/cinttypes_exports.sh.cpp index a24aafdcc737f..70477d97678ac 100644 --- a/libcxx/test/libcxx/modules/cinttypes_exports.sh.cpp +++ b/libcxx/test/libcxx/modules/cinttypes_exports.sh.cpp @@ -10,6 +10,10 @@ // are not modular // XFAIL: LIBCXX-WINDOWS-FIXME +// FIXME: The header is not supported for single-threaded systems, +// but still gets built as part of the 'std' module, which breaks the build. +// XFAIL: libcpp-has-no-threads + // REQUIRES: modules-support // Test that re-exports diff --git a/libcxx/test/libcxx/modules/clocale_exports.sh.cpp b/libcxx/test/libcxx/modules/clocale_exports.sh.cpp index 3225155ca3685..6c4bc2675bb9e 100644 --- a/libcxx/test/libcxx/modules/clocale_exports.sh.cpp +++ b/libcxx/test/libcxx/modules/clocale_exports.sh.cpp @@ -10,6 +10,10 @@ // are not modular // XFAIL: LIBCXX-WINDOWS-FIXME +// FIXME: The header is not supported for single-threaded systems, +// but still gets built as part of the 'std' module, which breaks the build. +// XFAIL: libcpp-has-no-threads + // REQUIRES: modules-support // UNSUPPORTED: c++98, c++03 diff --git a/libcxx/test/libcxx/modules/cstdint_exports.sh.cpp b/libcxx/test/libcxx/modules/cstdint_exports.sh.cpp index 315d9ac17b916..c473245fe64ff 100644 --- a/libcxx/test/libcxx/modules/cstdint_exports.sh.cpp +++ b/libcxx/test/libcxx/modules/cstdint_exports.sh.cpp @@ -10,6 +10,10 @@ // are not modular // XFAIL: LIBCXX-WINDOWS-FIXME +// FIXME: The header is not supported for single-threaded systems, +// but still gets built as part of the 'std' module, which breaks the build. +// XFAIL: libcpp-has-no-threads + // REQUIRES: modules-support // Test that re-exports diff --git a/libcxx/test/libcxx/modules/inttypes_h_exports.sh.cpp b/libcxx/test/libcxx/modules/inttypes_h_exports.sh.cpp index 4cbb1d5742064..a653b05932778 100644 --- a/libcxx/test/libcxx/modules/inttypes_h_exports.sh.cpp +++ b/libcxx/test/libcxx/modules/inttypes_h_exports.sh.cpp @@ -10,6 +10,10 @@ // are not modular // XFAIL: LIBCXX-WINDOWS-FIXME +// FIXME: The header is not supported for single-threaded systems, +// but still gets built as part of the 'std' module, which breaks the build. +// XFAIL: libcpp-has-no-threads + // REQUIRES: modules-support // Test that intypes.h re-exports stdint.h diff --git a/libcxx/test/libcxx/modules/stdint_h_exports.sh.cpp b/libcxx/test/libcxx/modules/stdint_h_exports.sh.cpp index 5b35ba30ca6d5..ec86ad827dd88 100644 --- a/libcxx/test/libcxx/modules/stdint_h_exports.sh.cpp +++ b/libcxx/test/libcxx/modules/stdint_h_exports.sh.cpp @@ -6,6 +6,10 @@ // //===----------------------------------------------------------------------===// +// FIXME: The header is not supported for single-threaded systems, +// but still gets built as part of the 'std' module, which breaks the build. +// XFAIL: libcpp-has-no-threads + // REQUIRES: modules-support // Test that int8_t and the like are exported from stdint.h not inttypes.h diff --git a/libcxxabi/test/guard_test_basic.pass.cpp b/libcxxabi/test/guard_test_basic.pass.cpp index 7e5b7acc38872..1c756f4034409 100644 --- a/libcxxabi/test/guard_test_basic.pass.cpp +++ b/libcxxabi/test/guard_test_basic.pass.cpp @@ -127,7 +127,7 @@ int main() { #endif } { -#if defined(__APPLE__) || defined(__linux__) +#if (defined(__APPLE__) || defined(__linux__)) && !defined(_LIBCXXABI_HAS_NO_THREADS) assert(PlatformThreadID); #endif if (PlatformSupportsThreadID()) {