xref: /aosp_15_r20/external/llvm/test/Transforms/DeadArgElim/funclet.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: opt -S -deadargelim < %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Workertarget triple = "x86_64-pc-windows-msvc"
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Workerdefine internal void @callee(i8*) {
5*9880d681SAndroid Build Coastguard Workerentry:
6*9880d681SAndroid Build Coastguard Worker  call void @thunk()
7*9880d681SAndroid Build Coastguard Worker  ret void
8*9880d681SAndroid Build Coastguard Worker}
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Workerdefine void @test1() personality i32 (...)* @__CxxFrameHandler3 {
11*9880d681SAndroid Build Coastguard Workerentry:
12*9880d681SAndroid Build Coastguard Worker  invoke void @thunk()
13*9880d681SAndroid Build Coastguard Worker          to label %good1 unwind label %bad1
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Workergood1:                                            ; preds = %entry-block
16*9880d681SAndroid Build Coastguard Worker  ret void
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Workerbad1:                                             ; preds = %entry-block
19*9880d681SAndroid Build Coastguard Worker  %pad1 = cleanuppad within none []
20*9880d681SAndroid Build Coastguard Worker  call void @callee(i8* null) [ "funclet"(token %pad1) ]
21*9880d681SAndroid Build Coastguard Worker  cleanupret from %pad1 unwind to caller
22*9880d681SAndroid Build Coastguard Worker}
23*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: define void @test1(
24*9880d681SAndroid Build Coastguard Worker; CHECK:      %[[pad:.*]] = cleanuppad within none []
25*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: call void @callee() [ "funclet"(token %[[pad]]) ]
26*9880d681SAndroid Build Coastguard Worker
27*9880d681SAndroid Build Coastguard Workerdeclare void @thunk()
28*9880d681SAndroid Build Coastguard Worker
29*9880d681SAndroid Build Coastguard Workerdeclare i32 @__CxxFrameHandler3(...)
30