blob: 0a643d4d080d003d0bc8e2201f581b92b73ad9ae [file] [log] [blame]
Chris Lattnerbfee2cc2004-11-26 19:19:28 +00001; A store or load cannot alias a global if the accessed amount is larger then
2; the global.
3
Dan Gohman18800922009-09-11 18:01:28 +00004; RUN: opt < %s -basicaa -gvn -instcombine -S | not grep load
Chris Lattnerbfee2cc2004-11-26 19:19:28 +00005
Tanya Lattnerf865dcd2008-02-14 06:56:27 +00006@B = global i16 8 ; <i16*> [#uses=2]
Chris Lattnerbfee2cc2004-11-26 19:19:28 +00007
Tanya Lattnerf865dcd2008-02-14 06:56:27 +00008define i16 @test(i32* %P) {
9 %X = load i16* @B ; <i16> [#uses=1]
10 store i32 7, i32* %P
11 %Y = load i16* @B ; <i16> [#uses=1]
12 %Z = sub i16 %Y, %X ; <i16> [#uses=1]
13 ret i16 %Z
Chris Lattnerbfee2cc2004-11-26 19:19:28 +000014}
15