1 ; RUN: opt -lowerinvoke -S < %s | FileCheck %s
3 ; Test if invoke instructions that have a funclet operand bundle can be lowered.
5 %struct.Cleanup = type { i8 }
7 define void @lowerinvoke_funclet() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
8 ; CHECK-LABEL: @lowerinvoke_funclet
10 %c = alloca %struct.Cleanup, align 1
12 to label %try.cont unwind label %catch.dispatch
14 catch.dispatch: ; preds = %entry
15 %0 = catchswitch within none [label %catch] unwind to caller
17 catch: ; preds = %catch.dispatch
18 %1 = catchpad within %0 [i8* null, i32 64, i8* null]
19 invoke void @bar(i32 3) [ "funclet"(token %1), "test"(i32 0) ]
20 to label %invoke.cont1 unwind label %ehcleanup
21 ; CHECK: call void @bar(i32 3) [ "funclet"(token %1), "test"(i32 0) ]
23 invoke.cont1: ; preds = %catch
24 call void @"??1Cleanup@@QEAA@XZ"(%struct.Cleanup* %c) #3 [ "funclet"(token %1) ]
25 catchret from %1 to label %try.cont
27 try.cont: ; preds = %entry, %invoke.cont1
30 ehcleanup: ; preds = %catch
31 %2 = cleanuppad within %1 []
32 call void @"??1Cleanup@@QEAA@XZ"(%struct.Cleanup* %c) #3 [ "funclet"(token %2) ]
33 cleanupret from %2 unwind to caller
37 declare void @bar(i32)
38 declare i32 @__CxxFrameHandler3(...)
39 declare void @"??1Cleanup@@QEAA@XZ"(%struct.Cleanup*) unnamed_addr