1 | //===----------------------------------------------------------------------===// |
2 | // |
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 |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | // class sequenced_policy; |
10 | // class parallel_policy; |
11 | // class parallel_unsequenced_policy; |
12 | // class unsequenced_policy; // since C++20 |
13 | // |
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 |
18 | |
19 | // UNSUPPORTED: c++03, c++11, c++14 |
20 | |
21 | // UNSUPPORTED: libcpp-has-no-incomplete-pstl |
22 | |
23 | #include <execution> |
24 | #include <type_traits> |
25 | |
26 | #include "test_macros.h" |
27 | |
28 | template <class T> |
29 | using remove_cvref_t = std::remove_cv_t<std::remove_reference_t<T>>; |
30 | |
31 | template <class T> |
32 | TEST_NOINLINE void use(T&) {} |
33 | |
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>); |
36 | static_assert( |
37 | std::is_same_v<remove_cvref_t<decltype(std::execution::par_unseq)>, std::execution::parallel_unsequenced_policy>); |
38 | |
39 | #if TEST_STD_VER >= 20 |
40 | static_assert(std::is_same_v<remove_cvref_t<decltype(std::execution::unseq)>, std::execution::unsequenced_policy>); |
41 | #endif |
42 | |
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); |
49 | #endif |
50 | |
51 | return 0; |
52 | } |
53 | |