blob: 45efc4238114f1b0d550ef6163182c5ff90aade2 [file] [log] [blame]
Bill Wendling1981c0e2012-04-24 10:45:44 +00001; RUN: opt < %s -domtree -break-crit-edges -analyze -domtree | FileCheck %s
Chris Lattner2a7e3c22006-10-03 07:00:13 +00002; PR932
Chris Lattner2a7e3c22006-10-03 07:00:13 +00003
Bill Wendling1981c0e2012-04-24 10:45:44 +00004; CHECK: [3] %brtrue {1,2}
5
Tanya Lattnerf865dcd2008-02-14 06:56:27 +00006declare void @use1(i32)
Chris Lattner2a7e3c22006-10-03 07:00:13 +00007
Tanya Lattnerf865dcd2008-02-14 06:56:27 +00008define void @f(i32 %i, i1 %c) {
Chris Lattner2a7e3c22006-10-03 07:00:13 +00009entry:
Tanya Lattnerf865dcd2008-02-14 06:56:27 +000010 %A = icmp eq i32 %i, 0 ; <i1> [#uses=1]
11 br i1 %A, label %brtrue, label %brfalse
Chris Lattner2a7e3c22006-10-03 07:00:13 +000012
13brtrue: ; preds = %brtrue, %entry
Tanya Lattnerf865dcd2008-02-14 06:56:27 +000014 %B = phi i1 [ true, %brtrue ], [ false, %entry ] ; <i1> [#uses=1]
15 call void @use1( i32 %i )
16 br i1 %B, label %brtrue, label %brfalse
Chris Lattner2a7e3c22006-10-03 07:00:13 +000017
18brfalse: ; preds = %brtrue, %entry
Tanya Lattnerf865dcd2008-02-14 06:56:27 +000019 call void @use1( i32 %i )
Chris Lattner2a7e3c22006-10-03 07:00:13 +000020 ret void
21}