1 ; RUN: llc -mtriple=x86_64-pc-windows-coreclr < %s | FileCheck %s 2 3 declare void @ProcessCLRException() 4 5 declare void @f() 6 7 define void @test1() personality void ()* @ProcessCLRException { 8 entry: 9 invoke void @f() 10 to label %exit unwind label %catch.dispatch.1 11 exit: 12 ret void 13 14 catch.dispatch.1: 15 %cs1 = catchswitch within none [label %outer.catch] unwind to caller 16 17 outer.catch: 18 %cp1 = catchpad within %cs1 [i32 1] 19 invoke void @f() [ "funclet"(token %cp1) ] 20 to label %outer.ret unwind label %catch.dispatch.2 21 outer.ret: 22 catchret from %cp1 to label %exit 23 24 catch.dispatch.2: 25 %cs2 = catchswitch within %cp1 [label %inner.catch] unwind to caller 26 inner.catch: 27 %cp2 = catchpad within %cs2 [i32 2] 28 catchret from %cp2 to label %outer.ret 29 } 30 31 ; Check the catchret targets 32 ; CHECK-LABEL: test1: # @test1 33 ; CHECK: [[Exit:^[^: ]+]]: # Block address taken 34 ; CHECK-NEXT: # %exit 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 43