blob: ea74692d05f765cb5a0943377d472a8d86441127 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; This test checks to make sure that 'br X, Dest, Dest' is folded into
2; 'br Dest'
3
Tanya Lattner003eae52008-03-10 07:21:50 +00004; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | \
Dan Gohman3c250772008-05-01 23:50:07 +00005; RUN: not grep {br i1 %c2}
Dan Gohmanf17a25c2007-07-18 16:29:46 +00006
Tanya Lattner003eae52008-03-10 07:21:50 +00007declare void @noop()
Dan Gohmanf17a25c2007-07-18 16:29:46 +00008
Tanya Lattner003eae52008-03-10 07:21:50 +00009define i32 @test(i1 %c1, i1 %c2) {
10 call void @noop( )
11 br i1 %c1, label %A, label %Y
12A: ; preds = %0
13 call void @noop( )
14 br i1 %c2, label %X, label %X
15X: ; preds = %Y, %A, %A
16 call void @noop( )
17 ret i32 0
18Y: ; preds = %0
19 call void @noop( )
Dan Gohmanf17a25c2007-07-18 16:29:46 +000020 br label %X
21}
Tanya Lattner003eae52008-03-10 07:21:50 +000022