1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes
2 ; RUN: opt -S < %s -passes=inline,argpromotion | FileCheck %s --check-prefix=ARGPROMOTION
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 ptr @wibble {
9 ; ARGPROMOTION-LABEL: define {{[^@]+}}@zot() personality ptr @wibble {
10 ; ARGPROMOTION-NEXT: bb:
11 ; ARGPROMOTION-NEXT: unreachable
12 ; ARGPROMOTION: hoge.exit:
13 ; ARGPROMOTION-NEXT: br label [[BB1:%.*]]
15 ; ARGPROMOTION-NEXT: unreachable
17 ; ARGPROMOTION-NEXT: [[TEMP:%.*]] = landingpad { ptr, i32 }
18 ; ARGPROMOTION-NEXT: cleanup
19 ; ARGPROMOTION-NEXT: unreachable
23 to label %bb1 unwind label %bb2
29 %temp = landingpad { ptr, i32 }
34 define internal void @hoge() {
36 %temp = call fastcc ptr @spam(ptr @eggs)
37 %temp1 = call fastcc ptr @spam(ptr @barney)
41 define internal fastcc ptr @spam(ptr %arg) {
46 define internal i1 @eggs(ptr %arg) {
47 ; ARGPROMOTION-LABEL: define {{[^@]+}}@eggs() {
48 ; ARGPROMOTION-NEXT: bb:
49 ; ARGPROMOTION-NEXT: unreachable
52 %temp = call zeroext i1 @barney(ptr %arg)
56 define internal i1 @barney(ptr %arg) {
61 define i32 @test_inf_promote_caller(i32 %arg) {
62 ; ARGPROMOTION-LABEL: define {{[^@]+}}@test_inf_promote_caller
63 ; ARGPROMOTION-SAME: (i32 [[ARG:%.*]]) {
64 ; ARGPROMOTION-NEXT: bb:
65 ; ARGPROMOTION-NEXT: [[TEMP:%.*]] = alloca [[S:%.*]], align 8
66 ; ARGPROMOTION-NEXT: [[TEMP1:%.*]] = alloca [[S]], align 8
67 ; ARGPROMOTION-NEXT: [[TEMP2:%.*]] = call i32 @test_inf_promote_callee(ptr [[TEMP]], ptr [[TEMP1]])
68 ; ARGPROMOTION-NEXT: ret i32 0
73 %temp2 = call i32 @test_inf_promote_callee(ptr %temp, ptr %temp1)
78 define internal i32 @test_inf_promote_callee(ptr %arg, ptr %arg1) {
79 ; ARGPROMOTION-LABEL: define {{[^@]+}}@test_inf_promote_callee
80 ; ARGPROMOTION-SAME: (ptr [[ARG:%.*]], ptr [[ARG1:%.*]]) {
81 ; ARGPROMOTION-NEXT: bb:
82 ; ARGPROMOTION-NEXT: [[TEMP2:%.*]] = load ptr, ptr [[ARG1]], align 8
83 ; ARGPROMOTION-NEXT: [[TEMP4:%.*]] = load ptr, ptr [[ARG]], align 8
84 ; ARGPROMOTION-NEXT: [[TEMP5:%.*]] = call i32 @test_inf_promote_callee(ptr [[TEMP4]], ptr [[TEMP2]])
85 ; ARGPROMOTION-NEXT: ret i32 0
88 %temp2 = load ptr, ptr %arg1
89 %temp4 = load ptr, ptr %arg
90 %temp5 = call i32 @test_inf_promote_callee(ptr %temp4, ptr %temp2)
95 declare i32 @wibble(...)