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

; RUN: opt < %s -simplifycfg -S | FileCheck %s

declare void @noop()

; CHECK-NOT: br i1 %c2
define i32 @test(i1 %c1, i1 %c2) {
	call void @noop( )
	br i1 %c1, label %A, label %Y
A:		; preds = %0
	call void @noop( )
	br i1 %c2, label %X, label %X
X:		; preds = %Y, %A, %A
	call void @noop( )
	ret i32 0
Y:		; preds = %0
	call void @noop( )
	br label %X
}