1 ; RUN: opt %s -inline -S | FileCheck %s
3 declare void @external_func()
5 @exception_type1 = external global i8
6 @exception_type2 = external global i8
9 define internal void @inner() {
10 invoke void @external_func()
11 to label %cont unwind label %lpad
15 %lp = landingpad i32 personality i8* null
16 catch i8* @exception_type1
20 ; Test that the "cleanup" clause is kept when inlining @inner() into
21 ; this call site (PR17872), otherwise C++ destructors will not be
22 ; called when they should be.
24 define void @outer() {
26 to label %cont unwind label %lpad
30 %lp = landingpad i32 personality i8* null
32 catch i8* @exception_type2
35 ; CHECK: define void @outer
38 ; CHECK-NEXT: catch i8* @exception_type1
39 ; CHECK-NEXT: catch i8* @exception_type2