blob: 8626626e75f69902073dd72cf42f8defe429acea [file] [log] [blame]
Eric Christopher79cc1e32014-09-02 22:28:02 +00001; RUN: %lli -extra-module=%p/Inputs/multi-module-eh-b.ll %s
Alexey Samsonov82826f72015-01-07 21:27:26 +00002; XFAIL: arm, cygwin, win32, mingw, asan, msan
Andrew Kaylor7bb13442013-10-11 21:25:48 +00003declare i8* @__cxa_allocate_exception(i64)
4declare void @__cxa_throw(i8*, i8*, i8*)
5declare i32 @__gxx_personality_v0(...)
6declare void @__cxa_end_catch()
7declare i8* @__cxa_begin_catch(i8*)
8
9@_ZTIi = external constant i8*
10
11declare i32 @FB()
12
13define void @throwException() {
14 %exception = tail call i8* @__cxa_allocate_exception(i64 4)
15 call void @__cxa_throw(i8* %exception, i8* bitcast (i8** @_ZTIi to i8*), i8* null)
16 unreachable
17}
18
19define i32 @main() {
20entry:
21 invoke void @throwException()
22 to label %try.cont unwind label %lpad
23
24lpad:
25 %p = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
26 catch i8* bitcast (i8** @_ZTIi to i8*)
27 %e = extractvalue { i8*, i32 } %p, 0
28 call i8* @__cxa_begin_catch(i8* %e)
29 call void @__cxa_end_catch()
30 br label %try.cont
31
32try.cont:
33 %r = call i32 @FB( )
34 ret i32 %r
35}