1 ; RUN: llc < %s | FileCheck %s
3 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
4 target triple = "x86_64-pc-windows-msvc"
6 ; This test case is equivalent to:
20 %rtti.TypeDescriptor2 = type { i8**, i8*, [3 x i8] }
21 %eh.CatchHandlerType = type { i32, i8* }
23 $"\01??_R0N@8" = comdat any
25 $"\01??_R0H@8" = comdat any
27 @"\01??_7type_info@@6B@" = external constant i8*
28 @"\01??_R0N@8" = linkonce_odr global %rtti.TypeDescriptor2 { i8** @"\01??_7type_info@@6B@", i8* null, [3 x i8] c".N\00" }, comdat
29 @llvm.eh.handlertype.N.0 = private unnamed_addr constant %eh.CatchHandlerType { i32 0, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0N@8" to i8*) }, section "llvm.metadata"
30 @"\01??_R0H@8" = linkonce_odr global %rtti.TypeDescriptor2 { i8** @"\01??_7type_info@@6B@", i8* null, [3 x i8] c".H\00" }, comdat
31 @llvm.eh.handlertype.H.8 = private unnamed_addr constant %eh.CatchHandlerType { i32 8, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*) }, section "llvm.metadata"
33 define internal i8* @"\01?f@@YAXXZ.catch"(i8*, i8*) #4 {
35 %.i8 = call i8* @llvm.framerecover(i8* bitcast (void ()* @"\01?f@@YAXXZ" to i8*), i8* %1, i32 0)
36 %bc2 = bitcast i8* %.i8 to i32**
37 %bc3 = bitcast i32** %bc2 to i8*
38 invoke void @"\01?may_throw@@YAXXZ"()
39 to label %invoke.cont2 unwind label %lpad1
41 invoke.cont2: ; preds = %entry
42 ret i8* blockaddress(@"\01?f@@YAXXZ", %try.cont)
44 lpad1: ; preds = %entry
45 %lp4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
47 catch %eh.CatchHandlerType* @llvm.eh.handlertype.N.0
48 %recover = call i8* (...)* @llvm.eh.actions(i32 1, i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.N.0 to i8*), i32 1, i8* (i8*, i8*)* @"\01?f@@YAXXZ.catch1")
49 indirectbr i8* %recover, [label %invoke.cont2]
52 ; CHECK-LABEL: "?f@@YAXXZ.catch":
53 ; CHECK: .seh_handlerdata
54 ; CHECK: .long ("$cppxdata$?f@@YAXXZ")@IMGREL
57 define internal i8* @"\01?f@@YAXXZ.catch1"(i8*, i8*) #4 {
59 %.i8 = call i8* @llvm.framerecover(i8* bitcast (void ()* @"\01?f@@YAXXZ" to i8*), i8* %1, i32 1)
60 %2 = bitcast i8* %.i8 to double*
61 %3 = bitcast double* %2 to i8*
62 invoke void (...)* @llvm.donothing()
63 to label %done unwind label %lpad
66 ret i8* blockaddress(@"\01?f@@YAXXZ", %try.cont8)
68 lpad: ; preds = %entry
69 %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
74 ; CHECK-LABEL: "?f@@YAXXZ.catch1":
75 ; CHECK: ".L?f@@YAXXZ.catch1$parent_frame_offset" = 16
76 ; CHECK: movq %rdx, 16(%rsp)
77 ; CHECK: .seh_handlerdata
78 ; CHECK: .long ("$cppxdata$?f@@YAXXZ")@IMGREL
80 define void @"\01?f@@YAXXZ"() #0 {
82 %exn.slot = alloca i8*
83 %ehselector.slot = alloca i32
84 %0 = alloca i32*, align 8
85 %1 = alloca double, align 8
86 call void (...)* @llvm.frameescape(i32** %0, double* %1)
87 invoke void @"\01?may_throw@@YAXXZ"()
88 to label %invoke.cont unwind label %lpad2
90 invoke.cont: ; preds = %entry
93 lpad2: ; preds = %entry
94 %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
95 catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.8
96 catch %eh.CatchHandlerType* @llvm.eh.handlertype.N.0
97 %recover = call i8* (...)* @llvm.eh.actions(i32 1, i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.H.8 to i8*), i32 0, i8* (i8*, i8*)* @"\01?f@@YAXXZ.catch", i32 1, i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.N.0 to i8*), i32 1, i8* (i8*, i8*)* @"\01?f@@YAXXZ.catch1")
98 indirectbr i8* %recover, [label %try.cont, label %try.cont8]
100 try.cont: ; preds = %lpad2, %invoke.cont
101 invoke void @"\01?may_throw@@YAXXZ"()
102 to label %try.cont8 unwind label %lpad1
105 %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
106 catch %eh.CatchHandlerType* @llvm.eh.handlertype.N.0
107 %recover2 = call i8* (...)* @llvm.eh.actions(i32 1, i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.N.0 to i8*), i32 1, i8* (i8*, i8*)* @"\01?f@@YAXXZ.catch1")
108 indirectbr i8* %recover2, [label %try.cont8]
110 try.cont8: ; preds = %lpad2, %try.cont
114 ; CHECK-LABEL: "?f@@YAXXZ":
115 ; CHECK: .seh_handlerdata
116 ; CHECK-NEXT: .long ("$cppxdata$?f@@YAXXZ")@IMGREL
117 ; CHECK-NEXT:"$cppxdata$?f@@YAXXZ":
118 ; CHECK-NEXT: .long 429065506
119 ; CHECK-NEXT: .long 4
120 ; CHECK-NEXT: .long ("$stateUnwindMap$?f@@YAXXZ")@IMGREL
121 ; CHECK-NEXT: .long 2
122 ; CHECK-NEXT: .long ("$tryMap$?f@@YAXXZ")@IMGREL
123 ; CHECK-NEXT: .long 3
124 ; CHECK-NEXT: .long ("$ip2state$?f@@YAXXZ")@IMGREL
125 ; CHECK-NEXT: .long 32
126 ; CHECK-NEXT: .long 0
127 ; CHECK-NEXT: .long 1
128 ; CHECK-NEXT:"$stateUnwindMap$?f@@YAXXZ":
129 ; CHECK-NEXT: .long -1
130 ; CHECK-NEXT: .long 0
131 ; CHECK-NEXT: .long 0
132 ; CHECK-NEXT: .long 0
133 ; CHECK-NEXT: .long 0
134 ; CHECK-NEXT: .long 0
135 ; CHECK-NEXT: .long -1
136 ; CHECK-NEXT: .long 0
137 ; CHECK-NEXT:"$tryMap$?f@@YAXXZ":
138 ; CHECK-NEXT: .long 1
139 ; CHECK-NEXT: .long 1
140 ; CHECK-NEXT: .long 2147483647
141 ; CHECK-NEXT: .long 1
142 ; CHECK-NEXT: .long ("$handlerMap$0$?f@@YAXXZ")@IMGREL
143 ; CHECK-NEXT: .long 0
144 ; CHECK-NEXT: .long 2
145 ; CHECK-NEXT: .long 2147483647
146 ; CHECK-NEXT: .long 1
147 ; CHECK-NEXT: .long ("$handlerMap$1$?f@@YAXXZ")@IMGREL
148 ; CHECK-NEXT:"$handlerMap$0$?f@@YAXXZ":
149 ; CHECK-NEXT: .long 8
150 ; CHECK-NEXT: .long "??_R0H@8"@IMGREL
151 ; CHECK-NEXT: .long 0
152 ; CHECK-NEXT: .long "?f@@YAXXZ.catch"@IMGREL
153 ; CHECK-NEXT: .long ".L?f@@YAXXZ.catch$parent_frame_offset"
154 ; CHECK-NEXT:"$handlerMap$1$?f@@YAXXZ":
155 ; CHECK-NEXT: .long 0
156 ; CHECK-NEXT: .long "??_R0N@8"@IMGREL
157 ; CHECK-NEXT: .long 0
158 ; CHECK-NEXT: .long "?f@@YAXXZ.catch1"@IMGREL
159 ; CHECK-NEXT: .long ".L?f@@YAXXZ.catch1$parent_frame_offset"
160 ; CHECK-NEXT:"$ip2state$?f@@YAXXZ":
161 ; CHECK-NEXT: .long .Ltmp0@IMGREL
162 ; CHECK-NEXT: .long 0
163 ; CHECK-NEXT: .long .Ltmp13@IMGREL
164 ; CHECK-NEXT: .long 1
165 ; CHECK-NEXT: .long .Ltmp16@IMGREL
166 ; CHECK-NEXT: .long 0
169 declare void @"\01?may_throw@@YAXXZ"() #1
171 declare i32 @__CxxFrameHandler3(...)
173 ; Function Attrs: nounwind readnone
174 declare i32 @llvm.eh.typeid.for(i8*) #2
176 ; Function Attrs: nounwind
177 declare void @llvm.eh.begincatch(i8* nocapture, i8* nocapture) #3
179 ; Function Attrs: nounwind
180 declare void @llvm.eh.endcatch() #3
182 ; Function Attrs: nounwind
183 declare i8* @llvm.eh.actions(...) #3
185 ; Function Attrs: nounwind
186 declare void @llvm.frameescape(...) #3
188 ; Function Attrs: nounwind readnone
189 declare i8* @llvm.framerecover(i8*, i8*, i32) #2
191 declare void @llvm.donothing(...)
193 attributes #0 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" "wineh-parent"="
\ 1?f@@YAXXZ" }
194 attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
195 attributes #2 = { nounwind readnone }
196 attributes #3 = { nounwind }
197 attributes #4 = { "wineh-parent"="
\ 1?f@@YAXXZ" }