Home | History | Annotate | Download | only in BasicAA
      1 ; RUN: opt -S -basicaa -gvn < %s | FileCheck %s
      2 
      3 target datalayout = "e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128"
      4 target 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 
     10 define i32 @foo(i8* %buffer) {
     11 entry:
     12   %tmp2 = getelementptr i8, i8* %buffer, i32 -2071408432
     13   %tmp3 = bitcast i8* %tmp2 to i32*
     14   %tmp4 = getelementptr i8, i8* %buffer, i32 128
     15   %tmp5 = bitcast i8* %tmp4 to i32*
     16   store i32 32, i32* %tmp5, align 4
     17   %tmp12 = getelementptr i32, i32* %tmp3, i32 -1629631508
     18   store i32 28, i32* %tmp12, align 4
     19   %tmp13 = getelementptr i8, i8* %buffer, i32 128
     20   %tmp14 = bitcast i8* %tmp13 to i32*
     21   %tmp2083 = load i32, i32* %tmp14, align 4
     22 ; CHECK: ret i32 28
     23   ret i32 %tmp2083
     24 }
     25