diff --git a/libcxx/include/variant b/libcxx/include/variant --- a/libcxx/include/variant +++ b/libcxx/include/variant @@ -521,7 +521,7 @@ }; template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS static constexpr auto __make_vtable_impl(_Fp __f, _Rp (*)(_Args...)) { array<_Rp (*)(_Args...), (1 * ... * _Ns) + 1> __result = { [](_Args...) -> _Rp { __throw_bad_variant_access(); } @@ -552,7 +552,7 @@ }; template - inline _LIBCPP_INLINE_VISIBILITY + inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS static constexpr decltype(auto) __visit_alt_at(size_t __index, _Vis&& __vis, _Vp&& __v, _Wp&& __w) { constexpr size_t __size = __uncvref_t<_Vp>::__size(); @@ -598,7 +598,7 @@ } template - inline _LIBCPP_INLINE_VISIBILITY + inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS static constexpr decltype(auto) __visit_alt_impl(index_sequence<_Is...>, _Vis&& __vis, _Vs&&... __vs) { using __multi = __multi<__uncvref_t<_Vs>::__size()...>; diff --git a/libcxx/test/libcxx/thread/thread.condition/PR30202_notify_from_pthread_created_thread.pass.cpp b/libcxx/test/libcxx/thread/thread.condition/PR30202_notify_from_pthread_created_thread.pass.cpp --- a/libcxx/test/libcxx/thread/thread.condition/PR30202_notify_from_pthread_created_thread.pass.cpp +++ b/libcxx/test/libcxx/thread/thread.condition/PR30202_notify_from_pthread_created_thread.pass.cpp @@ -13,13 +13,18 @@ // unique_lock. // UNSUPPORTED: c++03 +// PR30202 was fixed starting in macosx10.13. +// UNSUPPORTED: with_system_cxx_lib=macosx10.12 +// UNSUPPORTED: with_system_cxx_lib=macosx10.11 +// UNSUPPORTED: with_system_cxx_lib=macosx10.10 +// UNSUPPORTED: with_system_cxx_lib=macosx10.9 + // -// void -// notify_all_at_thread_exit(condition_variable& cond, unique_lock lk); +// void notify_all_at_thread_exit(condition_variable& cond, unique_lock lk); // Test that this function works with threads that were not created by -// std::thread. See: https://bugs.llvm.org/show_bug.cgi?id=30202 +// std::thread. See https://llvm.org/PR30202 #include diff --git a/libcxx/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp b/libcxx/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp --- a/libcxx/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp +++ b/libcxx/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp @@ -8,12 +8,12 @@ // UNSUPPORTED: libcpp-has-no-threads -// Until 58a0a70fb2f1, this_thread::sleep_for could get interrupted by -// signals and this test would fail. Disable the test on the corresponding -// system libraries. -// XFAIL: with_system_cxx_lib=macosx10.11 -// XFAIL: with_system_cxx_lib=macosx10.10 -// XFAIL: with_system_cxx_lib=macosx10.9 +// Until 58a0a70fb2f1, this_thread::sleep_for could sometimes get interrupted +// by signals and this test would fail spuriously. Disable the test on the +// corresponding system libraries. +// UNSUPPORTED: with_system_cxx_lib=macosx10.11 +// UNSUPPORTED: with_system_cxx_lib=macosx10.10 +// UNSUPPORTED: with_system_cxx_lib=macosx10.9 // diff --git a/libcxx/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.signals.pass.cpp b/libcxx/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.signals.pass.cpp --- a/libcxx/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.signals.pass.cpp +++ b/libcxx/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.signals.pass.cpp @@ -11,9 +11,9 @@ // This test uses the POSIX header which Windows doesn't provide // UNSUPPORTED: windows -// Until 58a0a70fb2f1, this_thread::sleep_for could get interrupted by -// signals and this test would fail. Disable the test on the corresponding -// system libraries. +// Until 58a0a70fb2f1, this_thread::sleep_for misbehaves when interrupted by +// a signal, as tested here. Disable the test on the corresponding system +// libraries. // XFAIL: with_system_cxx_lib=macosx10.11 // XFAIL: with_system_cxx_lib=macosx10.10 // XFAIL: with_system_cxx_lib=macosx10.9 diff --git a/libcxx/test/std/utilities/variant/variant.hash/hash.pass.cpp b/libcxx/test/std/utilities/variant/variant.hash/hash.pass.cpp --- a/libcxx/test/std/utilities/variant/variant.hash/hash.pass.cpp +++ b/libcxx/test/std/utilities/variant/variant.hash/hash.pass.cpp @@ -9,6 +9,12 @@ // UNSUPPORTED: c++03, c++11, c++14 +// Throwing bad_variant_access is supported starting in macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 && !no-exceptions +// XFAIL: with_system_cxx_lib=macosx10.11 && !no-exceptions +// XFAIL: with_system_cxx_lib=macosx10.10 && !no-exceptions +// XFAIL: with_system_cxx_lib=macosx10.9 && !no-exceptions + // // template struct hash>; diff --git a/libcxx/test/std/utilities/variant/variant.relops/relops.pass.cpp b/libcxx/test/std/utilities/variant/variant.relops/relops.pass.cpp --- a/libcxx/test/std/utilities/variant/variant.relops/relops.pass.cpp +++ b/libcxx/test/std/utilities/variant/variant.relops/relops.pass.cpp @@ -9,6 +9,12 @@ // UNSUPPORTED: c++03, c++11, c++14 +// Throwing bad_variant_access is supported starting in macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 && !no-exceptions +// XFAIL: with_system_cxx_lib=macosx10.11 && !no-exceptions +// XFAIL: with_system_cxx_lib=macosx10.10 && !no-exceptions +// XFAIL: with_system_cxx_lib=macosx10.9 && !no-exceptions + // // template diff --git a/libcxx/test/std/utilities/variant/variant.relops/relops_bool_conv.fail.cpp b/libcxx/test/std/utilities/variant/variant.relops/relops_bool_conv.fail.cpp --- a/libcxx/test/std/utilities/variant/variant.relops/relops_bool_conv.fail.cpp +++ b/libcxx/test/std/utilities/variant/variant.relops/relops_bool_conv.fail.cpp @@ -9,6 +9,12 @@ // UNSUPPORTED: c++03, c++11, c++14 +// Throwing bad_variant_access is supported starting in macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 && !no-exceptions +// XFAIL: with_system_cxx_lib=macosx10.11 && !no-exceptions +// XFAIL: with_system_cxx_lib=macosx10.10 && !no-exceptions +// XFAIL: with_system_cxx_lib=macosx10.9 && !no-exceptions + // // template diff --git a/libcxx/test/std/utilities/variant/variant.variant/variant.dtor/dtor.pass.cpp b/libcxx/test/std/utilities/variant/variant.variant/variant.dtor/dtor.pass.cpp --- a/libcxx/test/std/utilities/variant/variant.variant/variant.dtor/dtor.pass.cpp +++ b/libcxx/test/std/utilities/variant/variant.variant/variant.dtor/dtor.pass.cpp @@ -9,6 +9,12 @@ // UNSUPPORTED: c++03, c++11, c++14 +// Throwing bad_variant_access is supported starting in macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 && !no-exceptions +// XFAIL: with_system_cxx_lib=macosx10.11 && !no-exceptions +// XFAIL: with_system_cxx_lib=macosx10.10 && !no-exceptions +// XFAIL: with_system_cxx_lib=macosx10.9 && !no-exceptions + // // template class variant; diff --git a/libcxx/test/std/utilities/variant/variant.variant/variant.status/index.pass.cpp b/libcxx/test/std/utilities/variant/variant.variant/variant.status/index.pass.cpp --- a/libcxx/test/std/utilities/variant/variant.variant/variant.status/index.pass.cpp +++ b/libcxx/test/std/utilities/variant/variant.variant/variant.status/index.pass.cpp @@ -9,6 +9,12 @@ // UNSUPPORTED: c++03, c++11, c++14 +// Throwing bad_variant_access is supported starting in macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 && !no-exceptions +// XFAIL: with_system_cxx_lib=macosx10.11 && !no-exceptions +// XFAIL: with_system_cxx_lib=macosx10.10 && !no-exceptions +// XFAIL: with_system_cxx_lib=macosx10.9 && !no-exceptions + // // template class variant; diff --git a/libcxx/test/std/utilities/variant/variant.variant/variant.status/valueless_by_exception.pass.cpp b/libcxx/test/std/utilities/variant/variant.variant/variant.status/valueless_by_exception.pass.cpp --- a/libcxx/test/std/utilities/variant/variant.variant/variant.status/valueless_by_exception.pass.cpp +++ b/libcxx/test/std/utilities/variant/variant.variant/variant.status/valueless_by_exception.pass.cpp @@ -9,6 +9,12 @@ // UNSUPPORTED: c++03, c++11, c++14 +// Throwing bad_variant_access is supported starting in macosx10.13 +// XFAIL: with_system_cxx_lib=macosx10.12 && !no-exceptions +// XFAIL: with_system_cxx_lib=macosx10.11 && !no-exceptions +// XFAIL: with_system_cxx_lib=macosx10.10 && !no-exceptions +// XFAIL: with_system_cxx_lib=macosx10.9 && !no-exceptions + // // template class variant; diff --git a/libcxx/utils/ci/buildkite-pipeline.yml b/libcxx/utils/ci/buildkite-pipeline.yml --- a/libcxx/utils/ci/buildkite-pipeline.yml +++ b/libcxx/utils/ci/buildkite-pipeline.yml @@ -257,3 +257,15 @@ automatic: - exit_status: -1 # Agent was lost limit: 2 + + # Test back-deployment to older Apple platforms + - label: "Apple back-deployment macosx10.9" + command: "libcxx/utils/ci/run-buildbot.sh x86_64-apple-system-backdeployment-10.9" + artifact_paths: + - "**/test-results.xml" + agents: + queue: "libcxx-macos-builders" + retry: + automatic: + - exit_status: -1 # Agent was lost + limit: 2 diff --git a/libcxx/utils/ci/run-buildbot.sh b/libcxx/utils/ci/run-buildbot.sh --- a/libcxx/utils/ci/run-buildbot.sh +++ b/libcxx/utils/ci/run-buildbot.sh @@ -25,7 +25,14 @@ -DLLVM_ENABLE_PROJECTS="libcxx;libunwind;libcxxabi" \ -DLLVM_LIT_ARGS="-sv --show-unsupported --xunit-xml-output test-results.xml" \ -DLIBCXX_CXX_ABI=libcxxabi \ - ${@} + "${@}" +} + +function download-osx-roots() { + echo "--- Downloading previous macOS dylibs" + PREVIOUS_DYLIBS_URL="http://lab.llvm.org:8080/roots/libcxx-roots.tar.gz" + mkdir -p "${BUILD_DIR}/macos-roots" + curl "${PREVIOUS_DYLIBS_URL}" | tar -xz --strip-components=1 -C "${BUILD_DIR}/macos-roots" } function check-cxx-cxxabi() { @@ -163,6 +170,28 @@ -DLIBCXXABI_ENABLE_EXCEPTIONS=OFF check-cxx-cxxabi ;; +x86_64-apple-system-backdeployment-*) + DEPLOYMENT_TARGET="${BUILDER#x86_64-apple-system-backdeployment-}" + PARAMS="target_triple=x86_64-apple-macosx${DEPLOYMENT_TARGET}" + PARAMS+=";cxx_runtime_root=${BUILD_DIR}/macos-roots/macOS/libc++/${DEPLOYMENT_TARGET}" + PARAMS+=";abi_library_path=${BUILD_DIR}/macos-roots/macOS/libc++abi/${DEPLOYMENT_TARGET}" + PARAMS+=";use_system_cxx_lib=True" + # Filesystem is supported on Apple platforms starting with macosx10.15. + if [[ ${DEPLOYMENT_TARGET} =~ ^10.9|10.10|10.11|10.12|10.13|10.14$ ]]; then + PARAMS+=";enable_filesystem=False" + fi + + export CC=clang + export CXX=clang++ + generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \ + -DLIBCXX_TEST_PARAMS="${PARAMS}" \ + -DLIBCXXABI_TEST_PARAMS="${PARAMS}" + download-osx-roots + + # TODO: Also run the libc++abi tests + echo "+++ Running the libc++ tests" + ninja -C "${BUILD_DIR}" check-cxx +;; benchmarks) export CC=clang export CXX=clang++