Chris Lattner | debcbd0 | 2004-01-12 04:28:32 +0000 | [diff] [blame] | 1 | ; This test makes sure that these instructions are properly constant propagated. |
| 2 | ; |
| 3 | |
Reid Spencer | 69ccadd | 2006-12-02 04:23:10 +0000 | [diff] [blame] | 4 | ; RUN: llvm-upgrade < %s | llvm-as | opt -sccp | llvm-dis | not grep load |
Chris Lattner | debcbd0 | 2004-01-12 04:28:32 +0000 | [diff] [blame] | 5 | |
| 6 | %X = constant int 42 |
| 7 | %Y = constant [2 x { int, float }] [ { int, float } { int 12, float 1.0 }, |
Dale Johannesen | c2ec2ba | 2007-09-05 17:50:36 +0000 | [diff] [blame] | 8 | { int, float } { int 37, float 0x3FF3B2FEC0000000 } ] |
Chris Lattner | debcbd0 | 2004-01-12 04:28:32 +0000 | [diff] [blame] | 9 | int %test1() { |
| 10 | %B = load int* %X |
| 11 | ret int %B |
| 12 | } |
| 13 | |
| 14 | float %test2() { |
Reid Spencer | e5d4efa | 2006-11-23 15:14:52 +0000 | [diff] [blame] | 15 | %A = getelementptr [2 x { int, float}]* %Y, long 0, long 1, uint 1 |
Chris Lattner | debcbd0 | 2004-01-12 04:28:32 +0000 | [diff] [blame] | 16 | %B = load float* %A |
| 17 | ret float %B |
| 18 | } |
| 19 | |
| 20 | int %test3() { |
Reid Spencer | e5d4efa | 2006-11-23 15:14:52 +0000 | [diff] [blame] | 21 | %A = getelementptr [2 x { int, float}]* %Y, long 0, long 0, uint 0 |
Chris Lattner | debcbd0 | 2004-01-12 04:28:32 +0000 | [diff] [blame] | 22 | %B = load int* %A |
| 23 | ret int %B |
| 24 | } |
| 25 | |
| 26 | |