1 ; RUN: opt < %s -argpromotion -S | FileCheck %s
2 ; RUN: opt < %s -passes=argpromotion -S | FileCheck %s
5 @G2 = constant i32* @G1
7 define internal i32 @test(i32** %x) {
8 ; CHECK-LABEL: define internal i32 @test(
11 %y = load i32*, i32** %x
12 %z = load i32, i32* %y
18 define i32 @caller() {
19 ; CHECK-LABEL: define i32 @caller()
21 %x = call i32 @test(i32** @G2)
22 ; CHECK: %[[Y:.*]] = load i32*, i32** @G2
23 ; CHECK: %[[Z:.*]] = load i32, i32* %[[Y]]
24 ; CHECK: call i32 @test(i32 %[[Z]])