| 1 |
// RUN: %clang_cc1 -std=c++20 -triple=x86_64-- -emit-llvm -fcxx-exceptions \ |
| 2 |
// RUN: -disable-llvm-passes %s -o - | FileCheck %s |
| 3 |
|
| 4 |
#include "Inputs/coroutine.h" |
| 5 |
|
| 6 |
struct task { |
| 7 |
struct promise_type { |
| 8 |
task get_return_object(); |
| 9 |
std::suspend_never initial_suspend(); |
| 10 |
std::suspend_never final_suspend() noexcept; |
| 11 |
void return_void(); |
| 12 |
void unhandled_exception() noexcept; |
| 13 |
}; |
| 14 |
}; |
| 15 |
|
| 16 |
task f() try { |
| 17 |
co_return; |
| 18 |
} catch(...) { |
| 19 |
} |
| 20 |
|
| 21 |
// CHECK-LABEL: define{{.*}} void @_Z1fv( |
| 22 |
// CHECK: call void @llvm.coro.await.suspend.void( |
| 23 |
// CHECK: call void @_ZN4task12promise_type11return_voidEv( |