| 1 |
// Override default options. |
| 2 |
// { dg-options "-std=c++20 -fno-exceptions -Wall -Wextra" } |
| 3 |
|
| 4 |
#include <coroutine> |
| 5 |
|
| 6 |
struct SuspendNever { |
| 7 |
bool await_ready(); |
| 8 |
void await_suspend(std::coroutine_handle<>); |
| 9 |
void await_resume(); |
| 10 |
}; |
| 11 |
|
| 12 |
struct Coroutine; |
| 13 |
|
| 14 |
struct PromiseType { |
| 15 |
Coroutine get_return_object(); |
| 16 |
SuspendNever initial_suspend(); |
| 17 |
SuspendNever final_suspend(); |
| 18 |
#if __cpp_exceptions |
| 19 |
void unhandled_exception() { /*std::terminate();*/ }; |
| 20 |
#endif |
| 21 |
void return_void(); |
| 22 |
}; |
| 23 |
|
| 24 |
struct Coroutine { |
| 25 |
using promise_type = PromiseType; |
| 26 |
}; |
| 27 |
|
| 28 |
Coroutine __async_test_input_basic() { |
| 29 |
co_return; |
| 30 |
} |