[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGenCoroutines / coro-promise-dtor-exp-namespace.cpp
blob30b655c03bb2b4589f45c0fd1722dbae4d4e1af9
1 // RUN: %clang_cc1 -std=c++14 -fcoroutines-ts -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
4 #include "Inputs/coroutine-exp-namespace.h"
6 namespace coro = std::experimental::coroutines_v1;
8 struct coro_t {
9 void *p;
10 ~coro_t();
11 struct promise_type {
12 coro_t get_return_object();
13 coro::suspend_never initial_suspend();
14 coro::suspend_never final_suspend() noexcept;
15 void return_void();
16 promise_type();
17 ~promise_type();
18 void unhandled_exception();
22 struct Cleanup {
23 ~Cleanup();
25 void may_throw();
27 coro_t f() {
28 Cleanup cleanup;
29 may_throw();
30 co_return;
33 // CHECK-LABEL: define dso_local void @"?f@@YA?AUcoro_t@@XZ"(
35 // CHECK: invoke noundef ptr @"??0promise_type@coro_t@@QEAA@XZ"(
36 // CHECK: invoke void @"?get_return_object@promise_type@coro_t@@QEAA?AU2@XZ"(
38 // CHECK: call void @"??1promise_type@coro_t@@QEAA@XZ"