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