Fix PR1146: parameter attributes are longer part of
[oota-llvm.git] / test / Transforms / SimplifyCFG / 2003-08-17-BranchFoldOrdering.ll
1 ; This test checks to make sure that 'br X, Dest, Dest' is folded into 
2 ; 'br Dest'.  This can only happen after the 'Z' block is eliminated.  This is
3 ; due to the fact that the SimplifyCFG function does not use 
4 ; the ConstantFoldTerminator function.
5
6 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplifycfg | llvm-dis | \
7 ; RUN:   not grep {br bool %c2}
8
9 declare void %noop()
10
11 int %test(bool %c1, bool %c2) {
12         call void %noop()
13         br bool %c1, label %A, label %Y
14 A:
15         call void %noop()
16         br bool %c2, label %Z, label %X   ; Can be converted to unconditional br
17 Z:
18         br label %X
19 X:
20         call void %noop()
21         ret int 0
22 Y:
23         call void %noop()
24         br label %X
25 }