brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · a4cecc4 Raw
53 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// class sequenced_policy;10// class parallel_policy;11// class parallel_unsequenced_policy;12// class unsequenced_policy; // since C++2013//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++2018 19// UNSUPPORTED: c++03, c++11, c++1420 21// UNSUPPORTED: libcpp-has-no-incomplete-pstl22 23#include <execution>24#include <type_traits>25 26#include "test_macros.h"27 28template <class T>29using remove_cvref_t = std::remove_cv_t<std::remove_reference_t<T>>;30 31template <class T>32TEST_NOINLINE void use(T&) {}33 34static_assert(std::is_same_v<remove_cvref_t<decltype(std::execution::seq)>, std::execution::sequenced_policy>);35static_assert(std::is_same_v<remove_cvref_t<decltype(std::execution::par)>, std::execution::parallel_policy>);36static_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 >= 2040static_assert(std::is_same_v<remove_cvref_t<decltype(std::execution::unseq)>, std::execution::unsequenced_policy>);41#endif42 43int main(int, char**) {44  use(std::execution::seq);45  use(std::execution::par);46  use(std::execution::par_unseq);47#if TEST_STD_VER >= 2048  use(std::execution::unseq);49#endif50 51  return 0;52}53