Chris Lattner | 8c4b0d0 | 2003-06-26 05:05:51 +0000 | [diff] [blame] | 1 | ; This test makes sure that these instructions are properly eliminated. |
| 2 | ; |
| 3 | |
Misha Brukman | edf4bab | 2003-09-16 15:29:54 +0000 | [diff] [blame^] | 4 | ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep load |
Chris Lattner | 8c4b0d0 | 2003-06-26 05:05:51 +0000 | [diff] [blame] | 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 | int %test1() { |
| 10 | %B = load int* %X |
| 11 | ret int %B |
| 12 | } |
| 13 | |
| 14 | float %test2() { |
| 15 | %A = getelementptr [2 x { int, float}]* %Y, long 0, long 1, ubyte 1 |
| 16 | %B = load float* %A |
| 17 | ret float %B |
| 18 | } |
| 19 | |
| 20 | int %test3() { |
| 21 | %A = getelementptr [2 x { int, float}]* %Y, long 0, long 0, ubyte 0 |
| 22 | %B = load int* %A |
| 23 | ret int %B |
| 24 | } |
| 25 | |
| 26 | |