Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / test / std / utilities / expol / policies.compile.pass.cpp
bloba4cecc4d1dcda785a261c3206aa44d8869a635b9
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 //===----------------------------------------------------------------------===//
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
23 #include <execution>
24 #include <type_traits>
26 #include "test_macros.h"
28 template <class T>
29 using remove_cvref_t = std::remove_cv_t<std::remove_reference_t<T>>;
31 template <class 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>);
36 static_assert(
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>);
41 #endif
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
51 return 0;