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 | FileCheck %s
5 ; RUN: opt < %s -passes='cgscc(inline)' -S | FileCheck %s
7 declare void @might_throw()
9 define internal i32 @callee() personality i32 (...)* @__gxx_personality_v0 {
11 invoke void @might_throw()
12 to label %cont unwind label %exc
18 ; This just rethrows the exception!
19 %exn = landingpad {i8*, i32}
21 resume { i8*, i32 } %exn
24 ; caller returns true if might_throw throws an exception... which gets
25 ; propagated by callee.
26 define i32 @caller() personality i32 (...)* @__gxx_personality_v0 {
27 ; CHECK-LABEL: define i32 @caller()
29 %X = invoke i32 @callee()
30 to label %cont unwind label %Handler
32 ; CHECK: invoke void @might_throw()
33 ; At this point we just check that the rest of the function does not 'resume'
34 ; at any point and instead the inlined resume is threaded into normal control
42 ; This consumes an exception thrown by might_throw
43 %exn = landingpad {i8*, i32}
48 declare i32 @__gxx_personality_v0(...)