aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms/SimplifyCFG/2003-08-17-BranchFold.ll
blob: 55199ab2a19e0065bc6359a7b2e938af477cbb2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
; This test checks to make sure that 'br X, Dest, Dest' is folded into 
; 'br Dest'

; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep 'br bool %c2'

declare void %noop()

int %test(bool %c1, bool %c2) {
	call void %noop()
	br bool %c1, label %A, label %Y
A:
	call void %noop()
 	br bool %c2, label %X, label %X   ; Can be converted to unconditional br
X:
	call void %noop()
	ret int 0
Y:
	call void %noop()
	br label %X
}