[PowerPC][NFC] Cleanup PPCCTRLoopsVerify pass
[llvm-project.git] / libcxx / test / std / thread / futures / futures.async / async.verify.cpp
blob176459eb571c3bad1001820d47aed631bc16a510
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 // UNSUPPORTED: libcpp-has-no-threads
10 // UNSUPPORTED: c++03, c++11, c++14, c++17
12 // <future>
14 // template <class F, class... Args>
15 // future<typename result_of<F(Args...)>::type>
16 // async(F&& f, Args&&... args);
18 // template <class F, class... Args>
19 // future<typename result_of<F(Args...)>::type>
20 // async(launch policy, F&& f, Args&&... args);
23 #include <future>
24 #include <atomic>
25 #include <memory>
26 #include <cassert>
28 #include "test_macros.h"
30 int foo (int x) { return x; }
32 int main(int, char**)
34 std::async( foo, 3); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
35 std::async(std::launch::async, foo, 3); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
37 return 0;