1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=sccp -S | FileCheck %s
5 define i32 @main(i1 %arg) {
8 ; CHECK-NEXT: br label [[BB:%.*]]
10 ; CHECK-NEXT: [[INDVAR:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[K:%.*]], [[BB_BACKEDGE:%.*]] ]
11 ; CHECK-NEXT: [[K]] = add i32 [[INDVAR]], 1
12 ; CHECK-NEXT: br i1 [[ARG:%.*]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
14 ; CHECK-NEXT: [[TMP97:%.*]] = icmp slt i32 [[K]], 10
15 ; CHECK-NEXT: br i1 [[TMP97]], label [[BB_BACKEDGE]], label [[BB12:%.*]]
17 ; CHECK-NEXT: br label [[BB]]
19 ; CHECK-NEXT: [[TMP9:%.*]] = icmp slt i32 [[K]], 10
20 ; CHECK-NEXT: br i1 [[TMP9]], label [[BB_BACKEDGE]], label [[BB12]]
22 ; CHECK-NEXT: [[TMP14:%.*]] = icmp eq i32 [[K]], 10
23 ; CHECK-NEXT: br i1 [[TMP14]], label [[COND_NEXT18:%.*]], label [[COND_TRUE17:%.*]]
25 ; CHECK-NEXT: tail call void @abort()
26 ; CHECK-NEXT: unreachable
28 ; CHECK-NEXT: ret i32 0
34 %indvar = phi i32 [ 0, %entry ], [ %k, %bb.backedge ]
35 %k = add i32 %indvar, 1
36 br i1 %arg, label %cond_true, label %cond_false
39 %tmp97 = icmp slt i32 %k, 10
40 br i1 %tmp97, label %bb.backedge, label %bb12
46 %tmp9 = icmp slt i32 %k, 10
47 br i1 %tmp9, label %bb.backedge, label %bb12
50 %tmp14 = icmp eq i32 %k, 10
51 br i1 %tmp14, label %cond_next18, label %cond_true17
54 tail call void @abort( )