llvm.org GIT mirror llvm / 94046b2
new testcase, checking to ensure we handle yet-another spiffy case correctly git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10357 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 15 years ago
1 changed file(s) with 25 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; This testcase checks to make sure we can sink values which are only live on
1 ; some exits out of the loop, and that we can do so without breaking dominator
2 ; info.
3 ;
4 ; RUN: llvm-as < %s | opt -licm | llvm-dis | grep -C1 add | grep exit2:
5
6 implementation ; Functions:
7
8 int %test(bool %C1, bool %C2, int *%P, int* %Q) {
9 Entry:
10 br label %Loop
11
12 Loop:
13 br bool %C1, label %Cont, label %exit1
14 Cont:
15 %X = load int* %P
16 store int %X, int* %Q
17 %V = add int %X, 1
18 br bool %C2, label %Loop, label %exit2
19
20 exit1:
21 ret int 0
22 exit2:
23 ret int %V
24 }