Arnold Schwaighofer | 1a44448 | 2014-03-26 21:30:19 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -basicaa -gvn -S | FileCheck %s |
| 2 | |
| 3 | ; PR15967 |
| 4 | ; BasicAA claims no alias when there is (due to a problem when the MaxLookup |
| 5 | ; limit was reached). |
| 6 | |
| 7 | target datalayout = "e" |
| 8 | |
| 9 | %struct.foo = type { i32, i32 } |
| 10 | |
| 11 | define i32 @main() { |
| 12 | %t = alloca %struct.foo, align 4 |
| 13 | %1 = getelementptr inbounds %struct.foo* %t, i32 0, i32 0 |
| 14 | store i32 1, i32* %1, align 4 |
| 15 | %2 = getelementptr inbounds %struct.foo* %t, i64 1 |
| 16 | %3 = bitcast %struct.foo* %2 to i8* |
| 17 | %4 = getelementptr inbounds i8* %3, i32 -1 |
| 18 | store i8 0, i8* %4 |
| 19 | %5 = getelementptr inbounds i8* %4, i32 -1 |
| 20 | store i8 0, i8* %5 |
| 21 | %6 = getelementptr inbounds i8* %5, i32 -1 |
| 22 | store i8 0, i8* %6 |
| 23 | %7 = getelementptr inbounds i8* %6, i32 -1 |
| 24 | store i8 0, i8* %7 |
| 25 | %8 = getelementptr inbounds i8* %7, i32 -1 |
| 26 | store i8 0, i8* %8 |
| 27 | %9 = getelementptr inbounds i8* %8, i32 -1 |
| 28 | store i8 0, i8* %9 |
| 29 | %10 = getelementptr inbounds i8* %9, i32 -1 |
| 30 | store i8 0, i8* %10 |
| 31 | %11 = getelementptr inbounds i8* %10, i32 -1 |
| 32 | store i8 0, i8* %11 |
| 33 | %12 = load i32* %1, align 4 |
| 34 | ret i32 %12 |
| 35 | ; CHECK: ret i32 %12 |
| 36 | } |