1 ; Test that any rethrown exceptions in an inlined function are automatically
2 ; turned into branches to the invoke destination.
4 ; RUN: opt < %s -inline -S | not grep unwind$
6 declare void @might_throw()
8 define internal i32 @callee() {
9 invoke void @might_throw( )
10 to label %cont unwind label %exc
16 ; This just rethrows the exception!
17 %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
19 resume { i8*, i32 } %exn
22 ; caller returns true if might_throw throws an exception... which gets
23 ; propagated by callee.
24 define i32 @caller() {
25 %X = invoke i32 @callee( )
26 to label %cont unwind label %Handler ; <i32> [#uses=1]
32 ; This consumes an exception thrown by might_throw
33 %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
38 declare i32 @__gxx_personality_v0(...)