[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGenCoroutines / coro-attributes.cpp
blob8f171771a8cbca1750addd6385dd2bbc2c7201e5
1 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -std=c++20 -disable-llvm-passes -emit-llvm %s -o - | FileCheck %s
2 #include "Inputs/coroutine.h"
4 using namespace std;
6 struct coro {
7 struct promise_type {
8 coro get_return_object();
9 suspend_never initial_suspend();
10 suspend_never final_suspend() noexcept;
11 void return_void();
12 static void unhandled_exception();
16 // CHECK: void @_Z3foov() #[[FOO_ATTR_NUM:[0-9]+]]
17 // CHECK: declare token @llvm.coro.save(ptr) #[[SAVE_ATTR_NUM:[0-9]+]]
18 // CHECK: attributes #[[FOO_ATTR_NUM]] = { {{.*}} presplitcoroutine
19 // CHECK: attributes #[[SAVE_ATTR_NUM]] = { {{.*}}nomerge
20 coro foo() {
21 co_await suspend_always{};