new testcase
[oota-llvm.git] / test / Transforms / InstCombine / store-merge.ll
1 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i32 %storemerge} | wc -l | grep 2
2 ;; Simple sinking tests
3
4 ; "if then else"
5 define i32 @test1(i1 %C) {
6         %A = alloca i32
7         br i1 %C, label %Cond, label %Cond2
8
9 Cond:
10         store i32 -987654321, i32* %A
11         br label %Cont
12
13 Cond2:
14         store i32 47, i32* %A
15         br label %Cont
16
17 Cont:
18         %V = load i32* %A
19         ret i32 %V
20 }
21
22 ; "if then"
23 define i32 @test2(i1 %C) {
24         %A = alloca i32
25         store i32 47, i32* %A
26         br i1 %C, label %Cond, label %Cont
27
28 Cond:
29         store i32 -987654321, i32* %A
30         br label %Cont
31
32 Cont:
33         %V = load i32* %A
34         ret i32 %V
35 }
36