xref: /llvm-project/llvm/test/Analysis/BasicAA/noalias-wraparound-bug.ll (revision 05ff7606c9d47135ecf5b69e25b1327634f6fa27)
1; RUN: opt -S -aa-pipeline=basic-aa -passes=gvn < %s | FileCheck %s
2
3target datalayout = "e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128"
4target triple = "i386-apple-macosx10.6.0"
5
6; We incorrectly returned noalias in the example below for "tmp5" and
7; "tmp12" returning i32 32, since basicaa converted the offsets to 64b
8; and missed the wrap-around
9
10define i32 @foo(ptr %buffer) {
11entry:
12  %tmp2 = getelementptr i8, ptr %buffer, i32 -2071408432
13  %tmp4 = getelementptr i8, ptr %buffer, i32 128
14  store i32 32, ptr %tmp4, align 4
15  %tmp12 = getelementptr i32, ptr %tmp2, i32 -1629631508
16  store i32 28, ptr %tmp12, align 4
17  %tmp13 = getelementptr i8, ptr %buffer, i32 128
18  %tmp2083 = load i32, ptr %tmp13, align 4
19; CHECK: ret i32 28
20  ret i32 %tmp2083
21}
22