brintos

brintos / llvm-project-archived public Read only

0
0
Text · 822 B · c09e7aa Raw
35 lines · plain
1; Test that we can inline a simple function, turning the calls in it into invoke2; instructions3 4; RUN: opt < %s -passes=inline -S | FileCheck %s5; RUN: opt < %s -passes='cgscc(inline)' -S | FileCheck %s6; RUN: opt < %s -passes='module-inline' -S | FileCheck %s7 8declare void @might_throw()9 10define internal void @callee() {11entry:12  call void @might_throw()13  ret void14}15 16; caller returns true if might_throw throws an exception...17define i32 @caller() personality ptr @__gxx_personality_v0 {18; CHECK-LABEL: define i32 @caller() personality ptr @__gxx_personality_v019entry:20  invoke void @callee()21      to label %cont unwind label %exc22; CHECK-NOT: @callee23; CHECK: invoke void @might_throw()24 25cont:26  ret i32 027 28exc:29  %exn = landingpad {ptr, i32}30         cleanup31  ret i32 132}33 34declare i32 @__gxx_personality_v0(...)35