X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=test%2FTransforms%2FInstCombine%2Fload.ll;h=d11e08e10de95b23e615e6f50e860cc79afa1932;hb=8294eb5599092e3d8e95c9c4d323ffa139499acf;hp=59d7bb3bcfbe3241a68172f41e64553af3cf6acf;hpb=b1e1e82c54c060ea5dae09dae043234826ca2539;p=oota-llvm.git diff --git a/test/Transforms/InstCombine/load.ll b/test/Transforms/InstCombine/load.ll index 59d7bb3bcfb..d11e08e10de 100644 --- a/test/Transforms/InstCombine/load.ll +++ b/test/Transforms/InstCombine/load.ll @@ -1,12 +1,15 @@ ; This test makes sure that these instructions are properly eliminated. ; -; RUN: opt %s -instcombine | llvm-dis | not grep load +; RUN: opt < %s -instcombine -S | not grep load @X = constant i32 42 ; [#uses=2] @X2 = constant i32 47 ; [#uses=1] @Y = constant [2 x { i32, float }] [ { i32, float } { i32 12, float 1.000000e+00 }, { i32, float } { i32 37, float 0x3FF3B2FEC0000000 } ] ; <[2 x { i32, float }]*> [#uses=2] @Z = constant [2 x { i32, float }] zeroinitializer ; <[2 x { i32, float }]*> [#uses=1] +@GLOBAL = internal constant [4 x i32] zeroinitializer + + define i32 @test1() { %B = load i32* @X ; [#uses=1] ret i32 %B @@ -76,3 +79,20 @@ define double @test11(double* %p) { %x = load double* %t1 ret double %x } + +define i32 @test12(i32* %P) { + %A = alloca i32 + store i32 123, i32* %A + ; Cast the result of the load not the source + %Q = bitcast i32* %A to i32* + %V = load i32* %Q + ret i32 %V +} + +define <16 x i8> @test13(<2 x i64> %x) { +entry: + %tmp = load <16 x i8> * bitcast ([4 x i32]* @GLOBAL to <16 x i8>*) + ret <16 x i8> %tmp +} + +