Add another testcase
[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 float %test2() {
12         %A = getelementptr [2 x { int, float}]* %Y, long 0, long 1, ubyte 1
13         %B = load float* %A
14         ret float %B
15 }
16
17
18 int %test3() {
19         %A = getelementptr [2 x { int, float}]* %Y, long 0, long 0, ubyte 0
20         %B = load int* %A
21         ret int %B
22 }
23
24 int %test4() {
25         %A = getelementptr [2 x { int, float}]* %Z, long 0, long 1, ubyte 0
26         %B = load int* %A
27         ret int %B
28 }