Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame^] | 1 | ; This test makes sure that these instructions are properly constant propagated. |
| 2 | ; |
| 3 | |
| 4 | ; RUN: llvm-upgrade < %s | llvm-as | opt -sccp | 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 | 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, uint 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, uint 0 |
| 22 | %B = load int* %A |
| 23 | ret int %B |
| 24 | } |
| 25 | |
| 26 | |