blob: 504861030d96840970352391fe06d9f968829e35 [file] [log] [blame]
Dan Gohmanfea1dd02009-08-25 15:38:29 +00001; RUN: llvm-as %s -o /dev/null
Duncan P. N. Exon Smith13f5c582014-08-19 21:08:27 +00002; RUN: verify-uselistorder %s
Tanya Lattnere7e3f2e2004-11-06 22:07:09 +00003
Chris Lattnerc6424352002-08-22 20:30:06 +00004; Dominance relationships is not calculated correctly for unreachable blocks,
5; which causes the verifier to barf on this input.
6
Tanya Lattner6e9bcee2008-02-14 07:57:12 +00007define i32 @test(i1 %b) {
8BB0:
9 ret i32 7 ; Loop is unreachable
Chris Lattnerc6424352002-08-22 20:30:06 +000010
Tanya Lattner6e9bcee2008-02-14 07:57:12 +000011Loop: ; preds = %L2, %Loop
12 %B = phi i32 [ %B, %L2 ], [ %B, %Loop ] ;PHI has same value always.
13 br i1 %b, label %L2, label %Loop
14
15L2: ; preds = %Loop
Chris Lattnerc6424352002-08-22 20:30:06 +000016 br label %Loop
17}
18