Skip to content

Commit 2cf2f1b

Browse files
authored
[libc++] Test suite adjustments on macOS (llvm#95835)
This patch makes a few adjustments to the way we run the tests in the Apple configuration on macOS: First, we stop using DYLD_LIBRARY_PATH. Using that environment variable leads to libc++.dylib being replaced by the just-built one for the whole process, and that assumes compatibility between the system-provided dylib and the just-built one. Unfortunately, that is not the case anymore due to typed allocation, which is only available in the system one. Instead, we want to layer the just-built libc++ on top of the system-provided one, which seems to be what happens when we set a rpath instead. Second, add a missing XFAIL for a std::print test that didn't work as expected when building with availability annotations enabled. When we enable these annotations, std::print falls back to a non-unicode and non-terminal output, which breaks the test.
1 parent 753498e commit 2cf2f1b

File tree

5 files changed

+8
-70
lines changed

5 files changed

+8
-70
lines changed

libcxx/cmake/caches/Apple.cmake

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,3 @@ set(LIBCXXABI_HERMETIC_STATIC_LIBRARY ON CACHE BOOL "")
1515
set(LIBCXXABI_ENABLE_ASSERTIONS OFF CACHE BOOL "")
1616
set(LIBCXXABI_ENABLE_FORGIVING_DYNAMIC_CAST ON CACHE BOOL "")
1717
set(LIBCXXABI_USE_LLVM_UNWINDER OFF CACHE BOOL "") # libunwind is built separately
18-
19-
set(LIBCXX_TEST_CONFIG "apple-libc++-shared.cfg.in" CACHE STRING "")
20-
set(LIBCXXABI_TEST_CONFIG "apple-libc++abi-shared.cfg.in" CACHE STRING "")

libcxx/test/configs/apple-libc++-shared.cfg.in

Lines changed: 0 additions & 35 deletions
This file was deleted.

libcxx/test/libcxx/input.output/iostream.format/output.streams/ostream.formatted/ostream.formatted.print/vprint_unicode.pass.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111

1212
// XFAIL: availability-fp_to_chars-missing
1313

14+
// When std::print is unavailable, we don't rely on an implementation of
15+
// std::__is_terminal and we always assume a non-unicode and non-terminal
16+
// output.
17+
// XFAIL: availability-print-missing
18+
1419
// Clang modules do not work with the definiton of _LIBCPP_TESTING_PRINT_IS_TERMINAL
1520
// XFAIL: clang-modules-build
1621
// <ostream>

libcxx/utils/ci/apple-install-libcxx.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ for arch in ${architectures}; do
127127
-DCMAKE_OSX_ARCHITECTURES="${arch}" \
128128
-DLIBCXXABI_LIBRARY_VERSION="${version}" \
129129
-DLIBCXX_LIBRARY_VERSION="${version}" \
130-
-DLIBCXX_TEST_PARAMS="target_triple=${target}" \
131-
-DLIBCXXABI_TEST_PARAMS="target_triple=${target}" \
132-
-DLIBUNWIND_TEST_PARAMS="target_triple=${target}"
130+
-DLIBCXX_TEST_PARAMS="target_triple=${target};stdlib=apple-libc++" \
131+
-DLIBCXXABI_TEST_PARAMS="target_triple=${target};stdlib=apple-libc++" \
132+
-DLIBUNWIND_TEST_PARAMS="target_triple=${target};stdlib=apple-libc++"
133133
134134
if [ "$headers_only" = true ]; then
135135
xcrun cmake --build "${build_dir}/${arch}" --target install-cxx-headers install-cxxabi-headers -- -v

libcxxabi/test/configs/apple-libc++abi-shared.cfg.in

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)