blob: 018d21f7cc02948e6cca817a5f1873d602b44cb3 [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
Dan Gohman5bb7c7c2009-09-08 22:34:10 +00004; RUN: opt %s -simplifycfg -S | \
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