1 ; Tests that CoroEarly pass correctly lowers coro.resume, coro.destroy
2 ; RUN: opt < %s -S -passes=coro-early | FileCheck %s
4 ; CHECK-LABEL: @callResume(
5 define void @callResume(ptr %hdl) {
8 ; CHECK-NEXT: %0 = call ptr @llvm.coro.subfn.addr(ptr %hdl, i8 0)
9 ; CHECK-NEXT: call fastcc void %0(ptr %hdl)
10 call void @llvm.coro.resume(ptr %hdl)
12 ; CHECK-NEXT: %1 = call ptr @llvm.coro.subfn.addr(ptr %hdl, i8 1)
13 ; CHECK-NEXT: call fastcc void %1(ptr %hdl)
14 call void @llvm.coro.destroy(ptr %hdl)
17 ; CHECK-NEXT: ret void
21 define void @eh(ptr %hdl) personality ptr null {
24 ; CHECK-NEXT: %0 = call ptr @llvm.coro.subfn.addr(ptr %hdl, i8 0)
25 ; CHECK-NEXT: invoke fastcc void %0(ptr %hdl)
26 invoke void @llvm.coro.resume(ptr %hdl)
27 to label %cont unwind label %ehcleanup
32 %0 = cleanuppad within none []
33 cleanupret from %0 unwind to caller
37 declare void @llvm.coro.resume(ptr)
38 declare void @llvm.coro.destroy(ptr)