aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCoroutines/coro-ret-void.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenCoroutines/coro-ret-void.cpp')
-rw-r--r--test/CodeGenCoroutines/coro-ret-void.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CodeGenCoroutines/coro-ret-void.cpp b/test/CodeGenCoroutines/coro-ret-void.cpp
index 6b07f6ea1d64..6ebb44dfaefa 100644
--- a/test/CodeGenCoroutines/coro-ret-void.cpp
+++ b/test/CodeGenCoroutines/coro-ret-void.cpp
@@ -21,6 +21,20 @@ coro1 f() {
// CHECK: call void @_ZNSt12experimental13coroutines_v113suspend_never12await_resumeEv(%"struct.std::experimental::coroutines_v1::suspend_never"*
// CHECK: call void @_ZN5coro112promise_type11return_voidEv(%"struct.coro1::promise_type"* %__promise)
+struct A {
+ A();
+ ~A();
+};
+
+coro1 f2() {
+ co_return (void) A{};
+}
+
+// CHECK-LABEL: define void @_Z2f2v(
+// CHECK: call void @_ZN1AC1Ev(%struct.A* %[[AVar:.*]])
+// CHECK-NEXT: call void @_ZN1AD1Ev(%struct.A* %[[AVar]])
+// CHECK-NEXT: call void @_ZN5coro112promise_type11return_voidEv(%"struct.coro1::promise_type"*
+
struct coro2 {
struct promise_type {
coro2 get_return_object();