Add global variable to test for consistency
[oota-llvm.git] / test / Transforms / LICM / sink_only_some_exits.ll
1 ; This testcase checks to make sure we can sink values which are only live on
2 ; some exits out of the loop, and that we can do so without breaking dominator
3 ; info.
4 ;
5 ; RUN: llvm-as < %s | opt -licm | llvm-dis | \
6 ; RUN:   %prcontext add 1 | grep exit2:
7
8 define i32 @test(i1 %C1, i1 %C2, i32* %P, i32* %Q) {
9 Entry:
10         br label %Loop
11 Loop:           ; preds = %Cont, %Entry
12         br i1 %C1, label %Cont, label %exit1
13 Cont:           ; preds = %Loop
14         %X = load i32* %P               ; <i32> [#uses=2]
15         store i32 %X, i32* %Q
16         %V = add i32 %X, 1              ; <i32> [#uses=1]
17         br i1 %C2, label %Loop, label %exit2
18 exit1:          ; preds = %Loop
19         ret i32 0
20 exit2:          ; preds = %Cont
21         ret i32 %V
22 }
23