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: c++03, c++11, c++14, c++17 10 11 // <coroutine> 12 13 // template <class Promise = void> 14 // struct coroutine_handle; 15 16 // bool done() const 17 18 #include <coroutine> 19 #include <type_traits> 20 #include <memory> 21 #include <utility> 22 #include <cstdint> 23 #include <cassert> 24 25 #include "test_macros.h" 26 27 template <class Promise> do_test(std::coroutine_handle<Promise> const & H)28void do_test(std::coroutine_handle<Promise> const& H) { 29 // FIXME Add a runtime test 30 { 31 ASSERT_SAME_TYPE(decltype(H.done()), bool); 32 LIBCPP_ASSERT_NOT_NOEXCEPT(H.done()); 33 } 34 } 35 main(int,char **)36int main(int, char**) 37 { 38 do_test(std::coroutine_handle<>{}); 39 do_test(std::coroutine_handle<int>{}); 40 41 return 0; 42 } 43