blob: 99bd6bd547857e2902acfcb02fe9330cbd3577d6 [file] [log] [blame]
Dan Gohman3e054fe2009-09-08 22:34:10 +00001; RUN: opt %s -argpromotion -instcombine -S | not grep load
Chris Lattnerafa38572004-03-07 22:52:41 +00002
Tanya Lattnerec9a35a2008-03-01 09:15:35 +00003@G1 = constant i32 0 ; <i32*> [#uses=1]
4@G2 = constant i32* @G1 ; <i32**> [#uses=1]
Chris Lattnerafa38572004-03-07 22:52:41 +00005
Tanya Lattnerec9a35a2008-03-01 09:15:35 +00006define 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
Chris Lattnerafa38572004-03-07 22:52:41 +000010}
11
Tanya Lattnerec9a35a2008-03-01 09:15:35 +000012define i32 @caller(i32** %P) {
13 %X = call i32 @test( i32** @G2 ) ; <i32> [#uses=1]
14 ret i32 %X
Chris Lattnerafa38572004-03-07 22:52:41 +000015}
Tanya Lattnerec9a35a2008-03-01 09:15:35 +000016