1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // class sequenced_policy;
10 // class parallel_policy;
11 // class parallel_unsequenced_policy;
12 // class unsequenced_policy; // since C++20
14 // inline constexpr sequenced_policy seq = implementation-defined;
15 // inline constexpr parallel_policy par = implementation-defined;
16 // inline constexpr parallel_unsequenced_policy par_unseq = implementation-defined;
17 // inline constexpr unsequenced_policy unseq = implementation-defined; // since C++20
19 // UNSUPPORTED: c++03, c++11, c++14
21 // UNSUPPORTED: libcpp-has-no-incomplete-pstl
24 #include <type_traits>
26 #include "test_macros.h"
29 using remove_cvref_t
= std::remove_cv_t
<std::remove_reference_t
<T
>>;
32 TEST_NOINLINE
void use(T
&) {}
34 static_assert(std::is_same_v
<remove_cvref_t
<decltype(std::execution::seq
)>, std::execution::sequenced_policy
>);
35 static_assert(std::is_same_v
<remove_cvref_t
<decltype(std::execution::par
)>, std::execution::parallel_policy
>);
37 std::is_same_v
<remove_cvref_t
<decltype(std::execution::par_unseq
)>, std::execution::parallel_unsequenced_policy
>);
39 #if TEST_STD_VER >= 20
40 static_assert(std::is_same_v
<remove_cvref_t
<decltype(std::execution::unseq
)>, std::execution::unsequenced_policy
>);
43 int main(int, char**) {
44 use(std::execution::seq
);
45 use(std::execution::par
);
46 use(std::execution::par_unseq
);
47 #if TEST_STD_VER >= 20
48 use(std::execution::unseq
);