[libc++] Allow backdeployment CI to run on newer macOS

This should work now that we are using a matching libunwind.dylib when
we run the tests in back-deployment scenarios. The only restriction we
have now is to run on macOS x86_64, since that's what the old dylibs
were compiled for. This should allow us to move to newer AppleClangs
in the CI.

As a fly-by, fix missing availability annotations on optional's
monadic operations.

Differential Revision: https://reviews.llvm.org/D119840
This commit is contained in:
Louis Dionne 2022-02-15 09:34:04 -05:00
parent 690287b199
commit fd4cc87022
4 changed files with 19 additions and 11 deletions

View File

@ -1043,7 +1043,7 @@ public:
#if _LIBCPP_STD_VER > 20
template<class _Func>
_LIBCPP_HIDE_FROM_ABI
_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
constexpr auto and_then(_Func&& __f) & {
using _Up = invoke_result_t<_Func, value_type&>;
static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,
@ -1054,7 +1054,7 @@ public:
}
template<class _Func>
_LIBCPP_HIDE_FROM_ABI
_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
constexpr auto and_then(_Func&& __f) const& {
using _Up = invoke_result_t<_Func, const value_type&>;
static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,
@ -1065,7 +1065,7 @@ public:
}
template<class _Func>
_LIBCPP_HIDE_FROM_ABI
_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
constexpr auto and_then(_Func&& __f) && {
using _Up = invoke_result_t<_Func, value_type&&>;
static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,
@ -1087,7 +1087,7 @@ public:
}
template<class _Func>
_LIBCPP_HIDE_FROM_ABI
_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
constexpr auto transform(_Func&& __f) & {
using _Up = remove_cv_t<invoke_result_t<_Func, value_type&>>;
static_assert(!is_array_v<_Up>, "Result of f(value()) should not be an Array");
@ -1102,7 +1102,7 @@ public:
}
template<class _Func>
_LIBCPP_HIDE_FROM_ABI
_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
constexpr auto transform(_Func&& __f) const& {
using _Up = remove_cv_t<invoke_result_t<_Func, const value_type&>>;
static_assert(!is_array_v<_Up>, "Result of f(value()) should not be an Array");
@ -1117,7 +1117,7 @@ public:
}
template<class _Func>
_LIBCPP_HIDE_FROM_ABI
_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
constexpr auto transform(_Func&& __f) && {
using _Up = remove_cv_t<invoke_result_t<_Func, value_type&&>>;
static_assert(!is_array_v<_Up>, "Result of f(std::move(value())) should not be an Array");
@ -1132,7 +1132,7 @@ public:
}
template<class _Func>
_LIBCPP_HIDE_FROM_ABI
_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
constexpr auto transform(_Func&& __f) const&& {
using _Up = remove_cvref_t<invoke_result_t<_Func, const value_type&&>>;
static_assert(!is_array_v<_Up>, "Result of f(std::move(value())) should not be an Array");

View File

@ -7,6 +7,10 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// Throwing bad_optional_access is supported starting in macosx10.13
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
// <optional>
// template<class F> constexpr auto and_then(F&&) &;

View File

@ -7,6 +7,10 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// Throwing bad_optional_access is supported starting in macosx10.13
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
// <optional>
// template<class F> constexpr auto transform(F&&) &;

View File

@ -616,8 +616,8 @@ steps:
- "**/test-results.xml"
agents:
queue: "libcxx-builders"
os: "macos10.15" # TODO: For now, we're running the back-deployment tests for 10.9 on 10.15, because we don't have proper 10.9 machines
arch: "x86_64"
os: "macos"
arch: "x86_64" # We need to use x86_64 for back-deployment CI, since the old dylibs were compiled for x86_64
retry:
automatic:
- exit_status: -1 # Agent was lost
@ -630,8 +630,8 @@ steps:
- "**/test-results.xml"
agents:
queue: "libcxx-builders"
os: "macos10.15"
arch: "x86_64"
os: "macos"
arch: "x86_64" # We need to use x86_64 for back-deployment CI, since the old dylibs were compiled for x86_64
retry:
automatic:
- exit_status: -1 # Agent was lost