1 ; RUN: llc -mtriple=x86_64-pc-windows-coreclr < %s | FileCheck %s
3 declare void @ProcessCLRException()
7 define void @test1() personality void ()* @ProcessCLRException {
10 to label %exit unwind label %catch.dispatch.1
15 %cs1 = catchswitch within none [label %outer.catch] unwind to caller
18 %cp1 = catchpad within %cs1 [i32 1]
19 invoke void @f() [ "funclet"(token %cp1) ]
20 to label %outer.ret unwind label %catch.dispatch.2
22 catchret from %cp1 to label %exit
25 %cs2 = catchswitch within %cp1 [label %inner.catch] unwind to caller
27 %cp2 = catchpad within %cs2 [i32 2]
28 catchret from %cp2 to label %outer.ret
31 ; Check the catchret targets
32 ; CHECK-LABEL: test1: # @test1
33 ; CHECK: [[Exit:^[^: ]+]]: # Block address taken
35 ; CHECK: [[OuterRet:^[^: ]+]]: # Block address taken
36 ; CHECK-NEXT: # %outer.ret
37 ; CHECK-NEXT: leaq [[Exit]](%rip), %rax
38 ; CHECK: retq # CATCHRET
39 ; CHECK: {{^[^: ]+}}: # %inner.catch
40 ; CHECK: .seh_endprolog
41 ; CHECK-NEXT: leaq [[OuterRet]](%rip), %rax
42 ; CHECK: retq # CATCHRET