40 lines · plain
1; RUN: opt -passes=lower-invoke -S < %s | FileCheck %s2 3; Test if invoke instructions that have a funclet operand bundle can be lowered.4 5%struct.Cleanup = type { i8 }6 7define void @lowerinvoke_funclet() personality ptr @__CxxFrameHandler3 {8; CHECK-LABEL: @lowerinvoke_funclet9entry:10 %c = alloca %struct.Cleanup, align 111 invoke void @foo()12 to label %try.cont unwind label %catch.dispatch13 14catch.dispatch: ; preds = %entry15 %0 = catchswitch within none [label %catch] unwind to caller16 17catch: ; preds = %catch.dispatch18 %1 = catchpad within %0 [ptr null, i32 64, ptr null]19 invoke void @bar(i32 3) [ "funclet"(token %1), "test"(i32 0) ]20 to label %invoke.cont1 unwind label %ehcleanup21; CHECK: call void @bar(i32 3) [ "funclet"(token %1), "test"(i32 0) ]22 23invoke.cont1: ; preds = %catch24 call void @"??1Cleanup@@QEAA@XZ"(ptr %c) #3 [ "funclet"(token %1) ]25 catchret from %1 to label %try.cont26 27try.cont: ; preds = %entry, %invoke.cont128 ret void29 30ehcleanup: ; preds = %catch31 %2 = cleanuppad within %1 []32 call void @"??1Cleanup@@QEAA@XZ"(ptr %c) #3 [ "funclet"(token %2) ]33 cleanupret from %2 unwind to caller34}35 36declare void @foo()37declare void @bar(i32)38declare i32 @__CxxFrameHandler3(...)39declare void @"??1Cleanup@@QEAA@XZ"(ptr) unnamed_addr40