1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=indvars -S | FileCheck %s
3 ; rdar://10359193: assert "IndVar type must match IVInit type"
5 target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n32-S32"
6 target triple = "thumbv7-apple-darwin"
8 define void @test() nounwind {
11 ; CHECK-NEXT: br label [[WHILE_COND:%.*]]
12 ; CHECK: while.cond.loopexit:
13 ; CHECK-NEXT: br label [[WHILE_COND_BACKEDGE:%.*]]
15 ; CHECK-NEXT: br i1 true, label [[WHILE_END:%.*]], label [[WHILE_BODY:%.*]]
17 ; CHECK-NEXT: br i1 undef, label [[IF_THEN165:%.*]], label [[WHILE_COND_BACKEDGE]]
18 ; CHECK: while.cond.backedge:
19 ; CHECK-NEXT: br label [[WHILE_COND]]
21 ; CHECK-NEXT: br i1 undef, label [[WHILE_COND_BACKEDGE]], label [[FOR_BODY_LR_PH_I81:%.*]]
22 ; CHECK: for.body.lr.ph.i81:
23 ; CHECK-NEXT: br label [[FOR_BODY_I86:%.*]]
24 ; CHECK: for.body.i86:
25 ; CHECK-NEXT: [[CMP196_I:%.*]] = icmp ult i32 0, undef
26 ; CHECK-NEXT: br i1 [[CMP196_I]], label [[FOR_BODY21_LR_PH_I:%.*]], label [[FOR_END_I129:%.*]]
27 ; CHECK: for.body21.lr.ph.i:
28 ; CHECK-NEXT: br label [[FOR_BODY21_I:%.*]]
29 ; CHECK: for.body21.i:
30 ; CHECK-NEXT: [[DESTYPIXELPTR_010_I:%.*]] = phi ptr [ null, [[FOR_BODY21_LR_PH_I]] ], [ [[INCDEC_PTR_I:%.*]], [[IF_END_I126:%.*]] ]
31 ; CHECK-NEXT: br i1 undef, label [[IF_END_I126]], label [[IF_ELSE_I124:%.*]]
32 ; CHECK: if.else.i124:
33 ; CHECK-NEXT: store i8 undef, ptr [[DESTYPIXELPTR_010_I]], align 1
34 ; CHECK-NEXT: br label [[IF_END_I126]]
36 ; CHECK-NEXT: [[INCDEC_PTR_I]] = getelementptr inbounds i8, ptr [[DESTYPIXELPTR_010_I]], i32 1
37 ; CHECK-NEXT: br i1 true, label [[FOR_BODY21_I]], label [[FOR_END_I129_LOOPEXIT:%.*]]
38 ; CHECK: for.end.i129.loopexit:
39 ; CHECK-NEXT: br label [[FOR_END_I129]]
40 ; CHECK: for.end.i129:
41 ; CHECK-NEXT: br i1 false, label [[FOR_BODY_I86]], label [[WHILE_COND_LOOPEXIT:%.*]]
43 ; CHECK-NEXT: br label [[BAIL:%.*]]
45 ; CHECK-NEXT: unreachable
47 ; CHECK-NEXT: ret void
53 br i1 undef, label %while.end, label %while.body
55 while.body: ; preds = %while.cond
56 br i1 undef, label %if.then165, label %while.cond
58 if.then165: ; preds = %while.body
59 br i1 undef, label %while.cond, label %for.body.lr.ph.i81
61 for.body.lr.ph.i81: ; preds = %if.then165
62 br label %for.body.i86
64 for.body.i86: ; preds = %for.end.i129, %for.body.lr.ph.i81
65 %cmp196.i = icmp ult i32 0, undef
66 br i1 %cmp196.i, label %for.body21.lr.ph.i, label %for.end.i129
68 for.body21.lr.ph.i: ; preds = %for.body.i86
69 br label %for.body21.i
72 %destYPixelPtr.010.i = phi ptr [ null, %for.body21.lr.ph.i ], [ %incdec.ptr.i, %if.end.i126 ]
73 %x.09.i = phi i32 [ 0, %for.body21.lr.ph.i ], [ %inc.i125, %if.end.i126 ]
74 br i1 undef, label %if.end.i126, label %if.else.i124
76 if.else.i124: ; preds = %for.body21.i
77 store i8 undef, ptr %destYPixelPtr.010.i, align 1
80 if.end.i126: ; preds = %if.else.i124, %for.body21.i
81 %incdec.ptr.i = getelementptr inbounds i8, ptr %destYPixelPtr.010.i, i32 1
82 %inc.i125 = add i32 %x.09.i, 1
83 %cmp19.i = icmp ult i32 %inc.i125, undef
84 br i1 %cmp19.i, label %for.body21.i, label %for.end.i129
86 for.end.i129: ; preds = %if.end.i126, %for.body.i86
87 br i1 undef, label %for.body.i86, label %while.cond
89 while.end: ; preds = %while.cond
92 bail: ; preds = %while.end, %lor.lhs.false44, %lor.lhs.false41, %if.end29, %if.end
95 return: ; preds = %lor.lhs.false20, %lor.lhs.false12, %lor.lhs.false, %entry