1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes
2 ; RUN: opt < %s -passes=argpromotion -S | FileCheck %s
4 %T = type { i32, i32, i32, i32 }
5 @G = constant %T { i32 0, i32 0, i32 17, i32 25 }
7 define internal i32 @test(ptr %p) {
8 ; CHECK-LABEL: define {{[^@]+}}@test
9 ; CHECK-SAME: (i32 [[P_12_VAL:%.*]]) {
11 ; CHECK-NEXT: [[V:%.*]] = add i32 [[P_12_VAL]], 10
12 ; CHECK-NEXT: ret i32 [[V]]
15 %a.gep = getelementptr %T, ptr %p, i64 0, i32 3
16 %b.gep = getelementptr %T, ptr %p, i64 0, i32 2
17 %a = load i32, ptr %a.gep
22 define i32 @caller() {
23 ; CHECK-LABEL: define {{[^@]+}}@caller() {
25 ; CHECK-NEXT: [[TMP0:%.*]] = getelementptr i8, ptr @G, i64 12
26 ; CHECK-NEXT: [[G_VAL:%.*]] = load i32, ptr [[TMP0]], align 4
27 ; CHECK-NEXT: [[V:%.*]] = call i32 @test(i32 [[G_VAL]])
28 ; CHECK-NEXT: ret i32 [[V]]
31 %v = call i32 @test(ptr @G)