1 // RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -std=c++20 \
2 // RUN: -fsyntax-only -ast-dump | FileCheck %s
4 #include "Inputs/std-coroutine.h"
10 std::suspend_always
initial_suspend() { return {}; }
11 Chat
get_return_object() {
12 return std::coroutine_handle
<promise_type
>::from_promise(*this);
14 std::suspend_always
yield_value(int m
) { return {}; }
15 std::suspend_always
final_suspend() noexcept
{ return {}; }
16 std::suspend_always
return_value(int) { return {}; }
17 void unhandled_exception() {}
19 auto await_transform(int s
) {
21 promise_type
*promise
;
22 bool await_ready() { return true; }
23 int await_resume() { return promise
->message
; }
24 void await_suspend(std::coroutine_handle
<>) {}
32 Chat(std::coroutine_handle
<promise_type
> promise
);
34 std::coroutine_handle
<promise_type
> handle
;
38 // CHECK: CoyieldExpr {{.*}} <col:3, col:12>
39 // CHECK-NEXT: CXXMemberCallExpr {{.*}} <col:3, col:12> {{.*}}
40 // CHECK-NEXT: MemberExpr {{.*}} <col:3> {{.*}}
41 // CHECK-NEXT: DeclRefExpr {{.*}} <col:3> {{.*}}
42 // CHECK-NEXT: ImplicitCastExpr {{.*}} <col:12> {{.*}}
43 // CHECK-NEXT: DeclRefExpr {{.*}} <col:12> {{.*}}
45 // CHECK: CoreturnStmt {{.*}} <line:{{.*}}:3, col:13>
47 // CHECK: CoawaitExpr {{.*}} <col:3, col:12> 'int'