llvm.org GIT mirror llvm / release_29 test / Transforms / SimplifyCFG / 2003-08-17-BranchFold.ll
release_29

Tree @release_29 (Download .tar.gz)

2003-08-17-BranchFold.ll @release_29raw · history · blame

; This test checks to make sure that 'br X, Dest, Dest' is folded into 
; 'br Dest'

; RUN: opt < %s -simplifycfg -S | \
; RUN:   not grep {br i1 %c2}

declare void @noop()

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
}