blob: 78f74a0abe56eefe59deafee6663def12f9ef102 [file] [log] [blame]
Bill Wendlingd5cc8b82012-04-24 09:15:38 +00001; RUN: opt < %s -basicaa -gvn -instcombine -S | FileCheck %s
Chris Lattner63a6e772003-04-22 22:00:15 +00002
3; BasicAA was incorrectly concluding that P1 and P2 didn't conflict!
4
Tanya Lattnerdcd188d2008-02-14 06:56:27 +00005define i32 @test(i32 *%Ptr, i64 %V) {
Bill Wendlingd5cc8b82012-04-24 09:15:38 +00006; CHECK: sub i32 %X, %Y
7 %P2 = getelementptr i32* %Ptr, i64 1
8 %P1 = getelementptr i32* %Ptr, i64 %V
9 %X = load i32* %P1
10 store i32 5, i32* %P2
11 %Y = load i32* %P1
12 %Z = sub i32 %X, %Y
13 ret i32 %Z
Chris Lattner63a6e772003-04-22 22:00:15 +000014}