blob: 05c19be7a9acc668091bac4d666bed971d81d545 [file] [log] [blame]
Mark Seaborn277fbe12014-03-20 14:12:47 +00001; RUN: opt < %s -lowerinvoke -S | FileCheck %s
2
3declare i32 @external_func(i64 %arg)
4
5define i32 @invoke_test(i64 %arg) {
6entry:
7 %result = invoke fastcc i32 @external_func(i64 inreg %arg)
8 to label %cont unwind label %lpad
9cont:
10 ret i32 %result
11lpad:
12 %phi = phi i32 [ 99, %entry ]
13 %lp = landingpad { i8*, i32 } personality i8* null 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