1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes
2 ; RUN: opt < %s -argpromotion -S | FileCheck %s
3 ; RUN: opt < %s -passes=argpromotion -S | FileCheck %s
6 @G2 = constant i32* @G1
8 define internal i32 @test(i32** %x) {
9 ; CHECK-LABEL: define {{[^@]+}}@test
10 ; CHECK-SAME: (i32 [[X_VAL_VAL:%.*]])
12 ; CHECK-NEXT: ret i32 [[X_VAL_VAL]]
15 %y = load i32*, i32** %x
16 %z = load i32, i32* %y
20 define i32 @caller() {
21 ; CHECK-LABEL: define {{[^@]+}}@caller()
23 ; CHECK-NEXT: [[G2_VAL:%.*]] = load i32*, i32** @G2
24 ; CHECK-NEXT: [[G2_VAL_VAL:%.*]] = load i32, i32* [[G2_VAL]]
25 ; CHECK-NEXT: [[X:%.*]] = call i32 @test(i32 [[G2_VAL_VAL]])
26 ; CHECK-NEXT: ret i32 [[X]]
29 %x = call i32 @test(i32** @G2)