1 ; RUN: %lli -extra-module=%p/Inputs/multi-module-eh-b.ll %s 2 ; XFAIL: arm, cygwin, win32, mingw 3 declare i8* @__cxa_allocate_exception(i64) 4 declare void @__cxa_throw(i8*, i8*, i8*) 5 declare i32 @__gxx_personality_v0(...) 6 declare void @__cxa_end_catch() 7 declare i8* @__cxa_begin_catch(i8*) 8 9 @_ZTIi = external constant i8* 10 11 declare i32 @FB() 12 13 define 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 19 define i32 @main() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { 20 entry: 21 invoke void @throwException() 22 to label %try.cont unwind label %lpad 23 24 lpad: 25 %p = landingpad { i8*, i32 } 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 32 try.cont: 33 %r = call i32 @FB( ) 34 ret i32 %r 35 } 36