Debian Codegraph @

clang/test/CodeGenCoroutines/coro-promise-dtor.cpp

raw
1 // RUN: %clang_cc1 -std=c++20 -triple=x86_64-pc-windows-msvc18.0.0 -emit-llvm -o - %s -fexceptions -fcxx-exceptions -disable-llvm-passes | FileCheck %s
2 // -triple=x86_64-unknown-linux-gnu
3
4 #include "Inputs/coroutine.h"
5
6 struct coro_t {
7 void* p;
8 ~coro_t();
9 struct promise_type {
10 coro_t get_return_object();
11 std::suspend_never initial_suspend();
12 std::suspend_never final_suspend() noexcept;
13 void return_void();
14 promise_type();
15 ~promise_type();
16 void unhandled_exception();
17 };
18 };
19
20 struct Cleanup { ~Cleanup(); };
21 void may_throw();
22
23 coro_t f() {
24 Cleanup cleanup;
25 may_throw();
26 co_return;
27 }
28
29 // CHECK-LABEL: define dso_local void @"?f@@YA?AUcoro_t@@XZ"(
30
31 // CHECK: invoke noundef ptr @"??0promise_type@coro_t@@QEAA@XZ"(
32 // CHECK: invoke void @"?get_return_object@promise_type@coro_t@@QEAA?AU2@XZ"(
33
34 // CHECK: call void @"??1promise_type@coro_t@@QEAA@XZ"