filecheckize
[oota-llvm.git] / test / Transforms / ScalarRepl / badarray.ll
1 ; RUN: opt < %s -scalarrepl -S | FileCheck %s
2
3 ; PR3466
4 ; Off end of array, don't transform.
5 define i32 @test1() {
6 ; CHECK: @test1
7 ; CHECK: %X = alloca
8         %X = alloca [4 x i32]
9         %Y = getelementptr [4 x i32]* %X, i64 0, i64 6          ; <i32*> [#uses=2]
10         store i32 0, i32* %Y
11         %Z = load i32* %Y               ; <i32> [#uses=1]
12         ret i32 %Z
13 }
14
15
16 ; Off end of array, don't transform.
17 define i32 @test2() nounwind {
18 entry:
19 ; CHECK: @test2
20 ; CHECK: %yx2.i = alloca
21         %yx2.i = alloca float, align 4          ; <float*> [#uses=1]            
22         %yx26.i = bitcast float* %yx2.i to i64*         ; <i64*> [#uses=1]      
23         %0 = load i64* %yx26.i, align 8         ; <i64> [#uses=0]               
24         unreachable
25 }