Add back a test I accidentally removed
[oota-llvm.git] / test / Transforms / InstCombine / load.ll
1 ; This test makes sure that these instructions are properly eliminated.
2 ;
3
4 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep load
5
6 %X = constant int 42
7 %Y = constant [2 x { int, float }] [ { int, float } { int 12, float 1.0 }, 
8                                      { int, float } { int 37, float 1.2312 } ]
9 %Z = constant [2 x { int, float }] zeroinitializer
10
11 int %test1() {
12         %B = load int* %X
13         ret int %B
14 }
15
16 float %test2() {
17         %A = getelementptr [2 x { int, float}]* %Y, long 0, long 1, ubyte 1
18         %B = load float* %A
19         ret float %B
20 }
21
22
23 int %test3() {
24         %A = getelementptr [2 x { int, float}]* %Y, long 0, long 0, ubyte 0
25         %B = load int* %A
26         ret int %B
27 }
28
29 int %test4() {
30         %A = getelementptr [2 x { int, float}]* %Z, long 0, long 1, ubyte 0
31         %B = load int* %A
32         ret int %B
33 }