Change CallGraphNode to maintain it's Function as an AssertingVH
[oota-llvm.git] / test / Transforms / ArgumentPromotion / chained.ll
1 ; RUN: llvm-as < %s | opt -argpromotion -instcombine | llvm-dis | not grep load
2
3 @G1 = constant i32 0            ; <i32*> [#uses=1]
4 @G2 = constant i32* @G1         ; <i32**> [#uses=1]
5
6 define internal i32 @test(i32** %X) {
7         %Y = load i32** %X              ; <i32*> [#uses=1]
8         %X.upgrd.1 = load i32* %Y               ; <i32> [#uses=1]
9         ret i32 %X.upgrd.1
10 }
11
12 define i32 @caller(i32** %P) {
13         %X = call i32 @test( i32** @G2 )                ; <i32> [#uses=1]
14         ret i32 %X
15 }
16