2003-08-17 19:29:34 +00:00
|
|
|
; This test checks to make sure that 'br X, Dest, Dest' is folded into
|
|
|
|
; 'br Dest'
|
|
|
|
|
2008-03-10 07:21:50 +00:00
|
|
|
; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | \
|
2008-05-01 23:50:07 +00:00
|
|
|
; RUN: not grep {br i1 %c2}
|
2003-08-17 19:29:34 +00:00
|
|
|
|
2008-03-10 07:21:50 +00:00
|
|
|
declare void @noop()
|
2003-08-17 19:29:34 +00:00
|
|
|
|
2008-03-10 07:21:50 +00:00
|
|
|
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( )
|
2003-08-17 19:29:34 +00:00
|
|
|
br label %X
|
|
|
|
}
|
2008-03-10 07:21:50 +00:00
|
|
|
|