blob: 47da1ff00686b962620db87d53cc89ddab881462 [file] [log] [blame]
Chris Lattner8c4b0d02003-06-26 05:05:51 +00001; This test makes sure that these instructions are properly eliminated.
2;
3
4; RUN: if as < %s | opt -instcombine | dis | grep load
5; RUN: then exit 1
6; RUN: else exit 0
7; RUN: fi
8
9%X = constant int 42
10%Y = constant [2 x { int, float }] [ { int, float } { int 12, float 1.0 },
11 { int, float } { int 37, float 1.2312 } ]
12int %test1() {
13 %B = load int* %X
14 ret int %B
15}
16
17float %test2() {
18 %A = getelementptr [2 x { int, float}]* %Y, long 0, long 1, ubyte 1
19 %B = load float* %A
20 ret float %B
21}
22
23int %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