[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / thread / futures / futures.promise / set_value_void.pass.cpp
blob9f12e498b84ec52c16eecd00e1a7c1e43a0f54a9
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-exceptions
10 // UNSUPPORTED: no-threads
11 // UNSUPPORTED: c++03
13 // <future>
15 // class promise<R>
17 // void promise<void>::set_value();
19 #include <future>
20 #include <cassert>
22 #include "test_macros.h"
24 int main(int, char**)
27 typedef void T;
28 std::promise<T> p;
29 std::future<T> f = p.get_future();
30 p.set_value();
31 f.get();
32 try
34 p.set_value();
35 assert(false);
37 catch (const std::future_error& e)
39 assert(e.code() == make_error_code(std::future_errc::promise_already_satisfied));
43 return 0;