OSDN Git Service

Update aosp/master LLVM for rebase to r256229
[android-x86/external-llvm.git] / test / Transforms / LowerInvoke / lowerinvoke.ll
1 ; RUN: opt < %s -lowerinvoke -S | FileCheck %s
2
3 declare i32 @external_func(i64 %arg)
4
5 define i32 @invoke_test(i64 %arg) personality i8* null {
6 entry:
7   %result = invoke fastcc i32 @external_func(i64 inreg %arg)
8       to label %cont unwind label %lpad
9 cont:
10   ret i32 %result
11 lpad:
12   %phi = phi i32 [ 99, %entry ]
13   %lp = landingpad { i8*, i32 } cleanup
14   ret i32 %phi
15 }
16
17 ; The "invoke" should be converted to a "call".
18 ; CHECK-LABEL: define i32 @invoke_test
19 ; CHECK: %result = call fastcc i32 @external_func(i64 inreg %arg)
20 ; CHECK-NEXT: br label %cont
21
22 ; Note that this pass does not remove dead landingpad blocks.
23 ; CHECK: lpad:
24 ; CHECK-NOT: phi
25 ; CHECK: landingpad