[OpenACC] Enable 'attach' clause for combined constructs
[llvm-project.git] / clang / test / CodeGenCoroutines / coro-dealloc.cpp
blob5a699ac9b5851194e2a9ead532edc9dbbef70cd1
1 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -std=c++20 \
2 // RUN: -emit-llvm %s -o - -disable-llvm-passes \
3 // RUN: | FileCheck %s
5 #include "Inputs/coroutine.h"
7 namespace std {
8 typedef __SIZE_TYPE__ size_t;
9 enum class align_val_t : size_t {};
12 struct task {
13 struct promise_type {
14 auto initial_suspend() { return std::suspend_always{}; }
15 auto final_suspend() noexcept { return std::suspend_always{}; }
16 auto get_return_object() { return task{}; }
17 void unhandled_exception() {}
18 void return_value(int) {}
22 // Test the compiler will chose sized deallocation correctly.
23 void operator delete(void *ptr, std::size_t size) noexcept;
25 // CHECK: define{{.*}}@_Z1fv
26 // CHECK: %[[coro_free:.+]] = call{{.*}}@llvm.coro.free
27 // CHECK: coro.free:
28 // CHECK: %[[coro_size:.+]] = call{{.*}}@llvm.coro.size
29 // CHECK: call{{.*}}void @_ZdlPvm(ptr{{.*}}%[[coro_free]], i64{{.*}}%[[coro_size]])
31 task f() {
32 co_return 43;