blob: 58a9ff6a2898ab8be7f127ffdec77a12d2757373 [file] [log] [blame]
Chris Lattnerdebcbd02004-01-12 04:28:32 +00001; This test makes sure that these instructions are properly constant propagated.
2;
3
Reid Spencer69ccadd2006-12-02 04:23:10 +00004; RUN: llvm-upgrade < %s | llvm-as | opt -sccp | llvm-dis | not grep load
Chris Lattnerdebcbd02004-01-12 04:28:32 +00005
6%X = constant int 42
7%Y = constant [2 x { int, float }] [ { int, float } { int 12, float 1.0 },
Dale Johannesenc2ec2ba2007-09-05 17:50:36 +00008 { int, float } { int 37, float 0x3FF3B2FEC0000000 } ]
Chris Lattnerdebcbd02004-01-12 04:28:32 +00009int %test1() {
10 %B = load int* %X
11 ret int %B
12}
13
14float %test2() {
Reid Spencere5d4efa2006-11-23 15:14:52 +000015 %A = getelementptr [2 x { int, float}]* %Y, long 0, long 1, uint 1
Chris Lattnerdebcbd02004-01-12 04:28:32 +000016 %B = load float* %A
17 ret float %B
18}
19
20int %test3() {
Reid Spencere5d4efa2006-11-23 15:14:52 +000021 %A = getelementptr [2 x { int, float}]* %Y, long 0, long 0, uint 0
Chris Lattnerdebcbd02004-01-12 04:28:32 +000022 %B = load int* %A
23 ret int %B
24}
25
26