1 ; RUN: opt -S < %s -inline -argpromotion | FileCheck %s
2 ; RUN: opt -S < %s -passes=inline,argpromotion | FileCheck %s
6 ; Inlining should nuke the invoke (and any inlined calls) here even with
7 ; argument promotion running along with it.
8 define void @zot() personality i32 (...)* @wibble {
9 ; CHECK-LABEL: define void @zot() personality i32 (...)* @wibble
14 to label %bb1 unwind label %bb2
20 %tmp = landingpad { i8*, i32 }
25 define internal void @hoge() {
27 %tmp = call fastcc i8* @spam(i1 (i8*)* @eggs)
28 %tmp1 = call fastcc i8* @spam(i1 (i8*)* @barney)
32 define internal fastcc i8* @spam(i1 (i8*)* %arg) {
37 define internal i1 @eggs(i8* %arg) {
39 %tmp = call zeroext i1 @barney(i8* %arg)
43 define internal i1 @barney(i8* %arg) {
48 define i32 @test_inf_promote_caller(i32 %arg) {
49 ; CHECK-LABEL: define i32 @test_inf_promote_caller(
53 %tmp2 = call i32 @test_inf_promote_callee(%S* %tmp, %S* %tmp1)
54 ; CHECK: call i32 @test_inf_promote_callee(%S* %{{.*}}, %S* %{{.*}})
59 define internal i32 @test_inf_promote_callee(%S* %arg, %S* %arg1) {
60 ; CHECK-LABEL: define internal i32 @test_inf_promote_callee(
61 ; CHECK: %S* %{{.*}}, %S* %{{.*}})
63 %tmp = getelementptr %S, %S* %arg1, i32 0, i32 0
64 %tmp2 = load %S*, %S** %tmp
65 %tmp3 = getelementptr %S, %S* %arg, i32 0, i32 0
66 %tmp4 = load %S*, %S** %tmp3
67 %tmp5 = call i32 @test_inf_promote_callee(%S* %tmp4, %S* %tmp2)
68 ; CHECK: call i32 @test_inf_promote_callee(%S* %{{.*}}, %S* %{{.*}})
73 declare i32 @wibble(...)