blob: b9cbbcc59ef64069f7fb5c6ed192a9278f91cbfd [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
Kenneth Uildriks90fedc62009-11-03 15:29:06 +00005target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"
Chris Lattnerbfee2cc2004-11-26 19:19:28 +00006
Tanya Lattnerf865dcd2008-02-14 06:56:27 +00007@B = global i16 8 ; <i16*> [#uses=2]
Chris Lattnerbfee2cc2004-11-26 19:19:28 +00008
Tanya Lattnerf865dcd2008-02-14 06:56:27 +00009define i16 @test(i32* %P) {
10 %X = load i16* @B ; <i16> [#uses=1]
11 store i32 7, i32* %P
12 %Y = load i16* @B ; <i16> [#uses=1]
13 %Z = sub i16 %Y, %X ; <i16> [#uses=1]
14 ret i16 %Z
Chris Lattnerbfee2cc2004-11-26 19:19:28 +000015}
16