2003-08-18 03:29:34 +08:00
|
|
|
; This test checks to make sure that 'br X, Dest, Dest' is folded into
|
|
|
|
; 'br Dest'
|
|
|
|
|
2007-04-15 17:21:47 +08:00
|
|
|
; RUN: llvm-upgrade < %s | llvm-as | opt -simplifycfg | llvm-dis | \
|
|
|
|
; RUN: not grep {br bool %c2}
|
2003-08-18 03:29:34 +08:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|