Add support for eliminating stores that store the same value that was just loaded.
[oota-llvm.git] / test / Transforms / DeadStoreElimination / 2004-12-28-PartialStore.ll
1 ; RUN: llvm-as < %s | opt -dse | llvm-dis | \
2 ; RUN:    grep {store i32 1234567}
3
4 ; Do not delete stores that are only partially killed.
5
6 define i32 @test() {
7         %V = alloca i32         ; <i32*> [#uses=3]
8         store i32 1234567, i32* %V
9         %V2 = bitcast i32* %V to i8*            ; <i8*> [#uses=1]
10         store i8 0, i8* %V2
11         %X = load i32* %V               ; <i32> [#uses=1]
12         ret i32 %X
13 }