[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / thread / futures / futures.shared_future / copy_ctor.pass.cpp
blob35f19e44ecba10c76f9f7cdb440cc082c4519d0d
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
10 // UNSUPPORTED: c++03
12 // <future>
14 // class shared_future<R>
16 // shared_future(const shared_future& rhs);
17 // noexcept in C++17
19 #include <future>
20 #include <cassert>
22 #include "test_macros.h"
24 int main(int, char**)
27 typedef int T;
28 std::promise<T> p;
29 std::shared_future<T> f0 = p.get_future();
30 std::shared_future<T> f = f0;
31 #if TEST_STD_VER > 14
32 static_assert(noexcept(std::shared_future<T>{f0}), "" );
33 #endif
34 assert(f0.valid());
35 assert(f.valid());
38 typedef int T;
39 std::shared_future<T> f0;
40 std::shared_future<T> f = f0;
41 assert(!f0.valid());
42 assert(!f.valid());
45 typedef int& T;
46 std::promise<T> p;
47 std::shared_future<T> f0 = p.get_future();
48 std::shared_future<T> f = f0;
49 assert(f0.valid());
50 assert(f.valid());
53 typedef int& T;
54 std::shared_future<T> f0;
55 std::shared_future<T> f = std::move(f0);
56 assert(!f0.valid());
57 assert(!f.valid());
60 typedef void T;
61 std::promise<T> p;
62 std::shared_future<T> f0 = p.get_future();
63 std::shared_future<T> f = f0;
64 assert(f0.valid());
65 assert(f.valid());
68 typedef void T;
69 std::shared_future<T> f0;
70 std::shared_future<T> f = f0;
71 assert(!f0.valid());
72 assert(!f.valid());
75 return 0;