1 ; RUN: opt < %s -argpromotion -S | FileCheck %s
3 ; Arg promotion eliminates the struct argument.
4 ; FIXME: Should it eliminate the i32* argument?
6 %struct.ss = type { i32, i64 }
8 define internal void @f(%struct.ss* byval %b, i32* byval %X) nounwind {
9 ; CHECK-LABEL: define internal void @f(i32 %b.0, i64 %b.1, i32* byval %X)
11 %tmp = getelementptr %struct.ss* %b, i32 0, i32 0
12 %tmp1 = load i32* %tmp, align 4
13 %tmp2 = add i32 %tmp1, 1
14 store i32 %tmp2, i32* %tmp, align 4
20 define i32 @test(i32* %X) {
21 ; CHECK-LABEL: define i32 @test
23 %S = alloca %struct.ss
24 %tmp1 = getelementptr %struct.ss* %S, i32 0, i32 0
25 store i32 1, i32* %tmp1, align 8
26 %tmp4 = getelementptr %struct.ss* %S, i32 0, i32 1
27 store i64 2, i64* %tmp4, align 4
28 call void @f( %struct.ss* byval %S, i32* byval %X)
29 ; CHECK: call void @f(i32 %{{.*}}, i64 %{{.*}}, i32* byval %{{.*}})