1 ; RUN: llc -verify-machineinstrs -mtriple=aarch64-pc-windows-msvc < %s \
2 ; RUN: | FileCheck --check-prefix=CHECK %s
4 ; Loosely based on IR for this C++ source code:
6 ; void try_in_catch() {
18 declare void @f(i32 %p)
19 declare i32 @__CxxFrameHandler3(...)
21 define i32 @try_in_catch() personality i32 (...)* @__CxxFrameHandler3 {
24 to label %try.cont unwind label %catch.dispatch.1
29 %cs1 = catchswitch within none [label %handler1] unwind to caller
31 %h1 = catchpad within %cs1 [i8* null, i32 64, i8* null]
32 invoke void @f(i32 2) [ "funclet"(token %h1) ]
33 to label %catchret1 unwind label %catch.dispatch.2
35 catchret from %h1 to label %try.cont
38 %cs2 = catchswitch within %h1 [label %handler2] unwind to caller
40 %h2 = catchpad within %cs2 [i8* null, i32 64, i8* null]
42 catchret from %h2 to label %catchret1
45 ; CHECK-LABEL: $cppxdata$try_in_catch:
46 ; CHECK-NEXT: .word 429065506
48 ; CHECK-NEXT: .word ($stateUnwindMap$try_in_catch)
50 ; CHECK-NEXT: .word ($tryMap$try_in_catch)
53 ; CHECK-NEXT: .word ($ip2state$try_in_catch)
55 ; CHECK-NEXT: .word -16
60 ; CHECK-LABEL: $tryMap$try_in_catch:
65 ; CHECK-NEXT: .word ($handlerMap$0$try_in_catch)
70 ; CHECK-NEXT: .word ($handlerMap$1$try_in_catch)
72 ; CHECK: $handlerMap$0$try_in_catch:
73 ; CHECK-NEXT: .word 64
76 ; CHECK-NEXT: .word "?catch${{[0-9]+}}@?0?try_in_catch@4HA"
79 ; CHECK: $handlerMap$1$try_in_catch:
80 ; CHECK-NEXT: .word 64
83 ; CHECK-NEXT: .word "?catch${{[0-9]+}}@?0?try_in_catch@4HA"
86 ; CHECK: $ip2state$try_in_catch:
87 ; CHECK-NEXT: .word .Lfunc_begin0@IMGREL
88 ; CHECK-NEXT: .word -1
89 ; CHECK-NEXT: .word .Ltmp0@IMGREL
91 ; CHECK-NEXT: .word .Ltmp1@IMGREL
92 ; CHECK-NEXT: .word -1
93 ; CHECK-NEXT: .word "?catch$2@?0?try_in_catch@4HA"@IMGREL
95 ; CHECK-NEXT: .word .Ltmp2@IMGREL
97 ; CHECK-NEXT: .word .Ltmp3@IMGREL
99 ; CHECK-NEXT: .word "?catch$4@?0?try_in_catch@4HA"@IMGREL
100 ; CHECK-NEXT: .word 3