[clang][Modules] Raise empty.modulemap expected size to <70KB to fix RISC-V failure...
[llvm-project.git] / libcxx / test / std / thread / futures / futures.unique_future / move_ctor.pass.cpp
blob168ba1953e1846f2636e09f629bcad1e883dfee3
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: no-threads, c++03
11 // <future>
13 // class future<R>
15 // future(future&& rhs);
17 #include <future>
18 #include <cassert>
20 #include "test_macros.h"
22 int main(int, char**)
25 typedef int T;
26 std::promise<T> p;
27 std::future<T> f0 = p.get_future();
28 std::future<T> f = std::move(f0);
29 assert(!f0.valid());
30 assert(f.valid());
33 typedef int T;
34 std::future<T> f0;
35 std::future<T> f = std::move(f0);
36 assert(!f0.valid());
37 assert(!f.valid());
40 typedef int& T;
41 std::promise<T> p;
42 std::future<T> f0 = p.get_future();
43 std::future<T> f = std::move(f0);
44 assert(!f0.valid());
45 assert(f.valid());
48 typedef int& T;
49 std::future<T> f0;
50 std::future<T> f = std::move(f0);
51 assert(!f0.valid());
52 assert(!f.valid());
55 typedef void T;
56 std::promise<T> p;
57 std::future<T> f0 = p.get_future();
58 std::future<T> f = std::move(f0);
59 assert(!f0.valid());
60 assert(f.valid());
63 typedef void T;
64 std::future<T> f0;
65 std::future<T> f = std::move(f0);
66 assert(!f0.valid());
67 assert(!f.valid());
70 return 0;