1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=x86_64-pc-windows-coreclr < %s | FileCheck %s 2*9880d681SAndroid Build Coastguard Worker 3*9880d681SAndroid Build Coastguard Workerdeclare void @ProcessCLRException() 4*9880d681SAndroid Build Coastguard Worker 5*9880d681SAndroid Build Coastguard Workerdeclare void @f() 6*9880d681SAndroid Build Coastguard Worker 7*9880d681SAndroid Build Coastguard Workerdefine void @test1() personality void ()* @ProcessCLRException { 8*9880d681SAndroid Build Coastguard Workerentry: 9*9880d681SAndroid Build Coastguard Worker invoke void @f() 10*9880d681SAndroid Build Coastguard Worker to label %exit unwind label %catch.dispatch.1 11*9880d681SAndroid Build Coastguard Workerexit: 12*9880d681SAndroid Build Coastguard Worker ret void 13*9880d681SAndroid Build Coastguard Worker 14*9880d681SAndroid Build Coastguard Workercatch.dispatch.1: 15*9880d681SAndroid Build Coastguard Worker %cs1 = catchswitch within none [label %outer.catch] unwind to caller 16*9880d681SAndroid Build Coastguard Worker 17*9880d681SAndroid Build Coastguard Workerouter.catch: 18*9880d681SAndroid Build Coastguard Worker %cp1 = catchpad within %cs1 [i32 1] 19*9880d681SAndroid Build Coastguard Worker invoke void @f() [ "funclet"(token %cp1) ] 20*9880d681SAndroid Build Coastguard Worker to label %outer.ret unwind label %catch.dispatch.2 21*9880d681SAndroid Build Coastguard Workerouter.ret: 22*9880d681SAndroid Build Coastguard Worker catchret from %cp1 to label %exit 23*9880d681SAndroid Build Coastguard Worker 24*9880d681SAndroid Build Coastguard Workercatch.dispatch.2: 25*9880d681SAndroid Build Coastguard Worker %cs2 = catchswitch within %cp1 [label %inner.catch] unwind to caller 26*9880d681SAndroid Build Coastguard Workerinner.catch: 27*9880d681SAndroid Build Coastguard Worker %cp2 = catchpad within %cs2 [i32 2] 28*9880d681SAndroid Build Coastguard Worker catchret from %cp2 to label %outer.ret 29*9880d681SAndroid Build Coastguard Worker} 30*9880d681SAndroid Build Coastguard Worker 31*9880d681SAndroid Build Coastguard Worker; Check the catchret targets 32*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: test1: # @test1 33*9880d681SAndroid Build Coastguard Worker; CHECK: [[Exit:^[^: ]+]]: # Block address taken 34*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: # %exit 35*9880d681SAndroid Build Coastguard Worker; CHECK: [[OuterRet:^[^: ]+]]: # Block address taken 36*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: # %outer.ret 37*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: leaq [[Exit]](%rip), %rax 38*9880d681SAndroid Build Coastguard Worker; CHECK: retq # CATCHRET 39*9880d681SAndroid Build Coastguard Worker; CHECK: {{^[^: ]+}}: # %inner.catch 40*9880d681SAndroid Build Coastguard Worker; CHECK: .seh_endprolog 41*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: leaq [[OuterRet]](%rip), %rax 42*9880d681SAndroid Build Coastguard Worker; CHECK: retq # CATCHRET 43