blob: 314c8069cacefc69f5a0dc9379e9e4f793a440af [file] [log] [blame]
Dan Gohman02538ac2010-10-18 18:04:47 +00001; RUN: opt < %s -basicaa -gvn -instcombine -S | grep {ret i32 0}
Chris Lattner02274a72009-05-25 21:28:56 +00002; PR4189
3@G = external constant [4 x i32]
4
5define i32 @test(i8* %p, i32 %i) nounwind {
6entry:
7 %P = getelementptr [4 x i32]* @G, i32 0, i32 %i
8 %A = load i32* %P
9 store i8 4, i8* %p
10 %B = load i32* %P
11 %C = sub i32 %A, %B
12 ret i32 %C
13}