diff options
Diffstat (limited to 'libcxx/test/std/thread/futures/futures.promise/default.pass.cpp')
-rw-r--r-- | libcxx/test/std/thread/futures/futures.promise/default.pass.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/libcxx/test/std/thread/futures/futures.promise/default.pass.cpp b/libcxx/test/std/thread/futures/futures.promise/default.pass.cpp new file mode 100644 index 00000000000..95c9657c633 --- /dev/null +++ b/libcxx/test/std/thread/futures/futures.promise/default.pass.cpp @@ -0,0 +1,38 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// UNSUPPORTED: libcpp-has-no-threads + +// <future> + +// class promise<R> + +// promise(); + +#include <future> +#include <cassert> + +int main() +{ + { + std::promise<int> p; + std::future<int> f = p.get_future(); + assert(f.valid()); + } + { + std::promise<int&> p; + std::future<int&> f = p.get_future(); + assert(f.valid()); + } + { + std::promise<void> p; + std::future<void> f = p.get_future(); + assert(f.valid()); + } +} |