llvm.org GIT mirror llvm / 578aa74
New testcases git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6854 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 16 years ago
2 changed file(s) with 42 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; This test checks to make sure phi nodes are updated properly
1 ;
2 ; RUN: as < %s | opt -tailduplicate -disable-output
3
4
5
6 int %test(bool %c, int %X, int %Y) {
7 br label %L
8
9 L:
10 %A = add int %X, %Y
11 br bool %c, label %T, label %F
12
13 F:
14 br bool %c, label %L, label %T
15
16 T:
17 %V = phi int [%A, %L], [0, %F]
18 ret int %V
19 }
0 ; RUN: as < %s | opt -tailduplicate -disable-output
1
2 declare void %__main()
3
4 int %main() {
5 entry: ; No predecessors!
6 call void %__main( )
7 br label %loopentry
8
9 loopentry: ; preds = %entry, %no_exit
10 %i.0 = phi int [ %inc, %no_exit ], [ 0, %entry ] ; [#uses=2]
11 %tmp.1 = setle int %i.0, 99 ; [#uses=1]
12 br bool %tmp.1, label %no_exit, label %return
13
14 no_exit: ; preds = %loopentry
15 %tmp.51 = call int %main( ) ; [#uses=0]
16 %inc = add int %i.0, 1 ; [#uses=1]
17 br label %loopentry
18
19 return: ; preds = %loopentry
20 ret int %i.0
21 }