1 ; RUN: llc -verify-machineinstrs -mtriple=i686-pc-windows-msvc < %s \
2 ; RUN: | FileCheck --check-prefix=CHECK --check-prefix=X86 %s
3 ; RUN: llc -verify-machineinstrs -mtriple=x86_64-pc-windows-msvc < %s \
4 ; RUN: | FileCheck --check-prefix=CHECK --check-prefix=X64 %s
6 ; Loosely based on IR for this C++ source code:
8 ; void try_in_catch() {
20 declare void @f(i32 %p)
21 declare i32 @__CxxFrameHandler3(...)
23 define i32 @try_in_catch() personality i32 (...)* @__CxxFrameHandler3 {
26 to label %try.cont unwind label %catch.dispatch.1
31 %cs1 = catchswitch within none [label %handler1] unwind to caller
33 %h1 = catchpad within %cs1 [i8* null, i32 64, i8* null]
34 invoke void @f(i32 2) [ "funclet"(token %h1) ]
35 to label %catchret1 unwind label %catch.dispatch.2
37 catchret from %h1 to label %try.cont
40 %cs2 = catchswitch within %h1 [label %handler2] unwind to caller
42 %h2 = catchpad within %cs2 [i8* null, i32 64, i8* null]
44 catchret from %h2 to label %catchret1
47 ; X86-LABEL: L__ehtable$try_in_catch:
48 ; X64-LABEL: $cppxdata$try_in_catch:
49 ; CHECK-NEXT: .long 429065506
51 ; CHECK-NEXT: .long ($stateUnwindMap$try_in_catch)
53 ; CHECK-NEXT: .long ($tryMap$try_in_catch)
58 ; X64-NEXT: .long ($ip2state$try_in_catch)
65 ; CHECK: $tryMap$try_in_catch:
70 ; CHECK-NEXT: .long ($handlerMap$0$try_in_catch)
75 ; CHECK-NEXT: .long ($handlerMap$1$try_in_catch)
77 ; CHECK: $handlerMap$0$try_in_catch:
78 ; CHECK-NEXT: .long 64
81 ; CHECK-NEXT: .long "?catch${{[0-9]+}}@?0?try_in_catch@4HA"
84 ; CHECK: $handlerMap$1$try_in_catch:
85 ; CHECK-NEXT: .long 64
88 ; CHECK-NEXT: .long "?catch${{[0-9]+}}@?0?try_in_catch@4HA"
91 ; X64: $ip2state$try_in_catch:
92 ; X64-NEXT: .long .Lfunc_begin0@IMGREL
94 ; X64-NEXT: .long .Ltmp0@IMGREL+1
96 ; X64-NEXT: .long .Ltmp1@IMGREL+1
98 ; X64-NEXT: .long "?catch$2@?0?try_in_catch@4HA"@IMGREL
100 ; X64-NEXT: .long .Ltmp2@IMGREL+1
102 ; X64-NEXT: .long .Ltmp3@IMGREL+1
104 ; X64-NEXT: .long "?catch$4@?0?try_in_catch@4HA"@IMGREL