brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 157aa8e Raw
39 lines · plain
1; Tests that CoroEarly pass correctly lowers coro.resume, coro.destroy2; RUN: opt < %s -S -passes=coro-early | FileCheck %s3 4; CHECK-LABEL: @callResume(5define void @callResume(ptr %hdl) {6; CHECK-NEXT: entry7entry: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)11 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)15 16  ret void17; CHECK-NEXT: ret void18}19 20; CHECK-LABEL: @eh(21define void @eh(ptr %hdl) personality ptr null {22; CHECK-NEXT: entry23entry: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 %ehcleanup28cont:29  ret void30 31ehcleanup:32  %0 = cleanuppad within none []33  cleanupret from %0 unwind to caller34}35 36 37declare void @llvm.coro.resume(ptr)38declare void @llvm.coro.destroy(ptr)39