1 ; REQUIRES: cxx-shared-library
2 ; RUN: %lli -jit-kind=mcjit %s
4 ; XFAIL: target=arm{{.*}}, target={{.*-(cygwin|windows-msvc|windows-gnu)}}
5 declare ptr @__cxa_allocate_exception(i64)
6 declare void @__cxa_throw(ptr, ptr, ptr)
7 declare i32 @__gxx_personality_v0(...)
8 declare void @__cxa_end_catch()
9 declare ptr @__cxa_begin_catch(ptr)
11 @_ZTIi = external constant ptr
13 define void @throwException() {
14 %exception = tail call ptr @__cxa_allocate_exception(i64 4)
15 call void @__cxa_throw(ptr %exception, ptr @_ZTIi, ptr null)
19 define i32 @main() personality ptr @__gxx_personality_v0 {
21 invoke void @throwException()
22 to label %try.cont unwind label %lpad
25 %p = landingpad { ptr, i32 }
27 %e = extractvalue { ptr, i32 } %p, 0
28 call ptr @__cxa_begin_catch(ptr %e)
29 call void @__cxa_end_catch()