1 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -std=c++20 \
2 // RUN: -O0 %s -o - | FileCheck %s
3 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -std=c++20 \
4 // RUN: -fno-inline -O0 %s -o - | FileCheck %s
11 bool await_ready() noexcept
{ return true; }
12 // CHECK-NOT: await_suspend
13 inline void __attribute__((__always_inline__
)) await_suspend(handle
) noexcept
{}
14 bool await_resume() noexcept
{ return true; }
18 struct coroutine_handle
{
19 static handle
from_address(void *address
) noexcept
{ return {}; }
22 template <typename T
= void>
23 struct coroutine_traits
{
25 awaitable
initial_suspend() { return {}; }
26 awaitable
final_suspend() noexcept
{ return {}; }
28 T
get_return_object() { return T(); }
29 void unhandled_exception() {}
34 // CHECK-LABEL: @_Z3foov
35 // CHECK-LABEL: entry:
36 // CHECK: %ref.tmp.reload.addr = getelementptr
37 // CHECK: %ref.tmp3.reload.addr = getelementptr
38 void foo() { co_return
; }
40 // Check that bar is not inlined even it's marked as always_inline.
42 // CHECK-LABEL: define {{.*}} void @_Z3bazv()
43 // CHECK: call void @_Z3barv(
44 __attribute__((__always_inline__
)) void bar() {