brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 9e0344b Raw
42 lines · plain
1; RUN: opt %s -passes=inline -S | FileCheck %s2; RUN: opt %s -passes='cgscc(inline)' -S | FileCheck %s3; RUN: opt %s -passes='module-inline' -S | FileCheck %s4 5declare void @external_func()6 7@exception_type1 = external global i88@exception_type2 = external global i89 10 11define internal void @inner() personality ptr null {12  invoke void @external_func()13      to label %cont unwind label %lpad14cont:15  ret void16lpad:17  %lp = landingpad i3218      catch ptr @exception_type119  resume i32 %lp20}21 22; Test that the "cleanup" clause is kept when inlining @inner() into23; this call site (PR17872), otherwise C++ destructors will not be24; called when they should be.25 26define void @outer() personality ptr null {27  invoke void @inner()28      to label %cont unwind label %lpad29cont:30  ret void31lpad:32  %lp = landingpad i3233      cleanup34      catch ptr @exception_type235  resume i32 %lp36}37; CHECK: define void @outer38; CHECK: landingpad39; CHECK-NEXT: cleanup40; CHECK-NEXT: catch ptr @exception_type141; CHECK-NEXT: catch ptr @exception_type242