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 // Check that PSTL algorithms aren't marked [[nodiscard]] when
10 // _LIBCPP_DISABLE_NODISCARD_EXT is defined
11
12 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_NODISCARD_EXT
13
14 // UNSUPPORTED: libcpp-has-no-incomplete-pstl
15
16 // UNSUPPORTED: c++03, c++11, c++14
17
18 #include <algorithm>
19 #include <execution>
20 #include <iterator>
21
test()22 void test() {
23 int a[] = {1};
24 auto pred = [](auto) { return false; };
25 std::all_of(std::execution::par, std::begin(a), std::end(a), pred);
26 std::any_of(std::execution::par, std::begin(a), std::end(a), pred);
27 std::none_of(std::execution::par, std::begin(a), std::end(a), pred);
28 }
29