55 lines · plain
1; RUN: llc -mcpu=cortex-a8 < %s2; rdar://problem/10137436: sqlite3 miscompile3;4; CHECK: subs5; CHECK: cmp6; CHECK: it7 8target 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"9target triple = "thumbv7-apple-ios4.0.0"10 11declare ptr @__memset_chk(ptr, i32, i32, i32) nounwind12 13define hidden fastcc i32 @sqlite3VdbeExec(ptr %p) nounwind {14entry:15 br label %sqlite3VarintLen.exit742416 17sqlite3VarintLen.exit7424: ; preds = %do.body.i742318 br label %do.body.i19 20do.body.i: ; preds = %do.body.i, %sqlite3VarintLen.exit742421 br i1 undef, label %do.body.i, label %sqlite3VarintLen.exit22 23sqlite3VarintLen.exit: ; preds = %do.body.i24 %sub2322 = add i64 undef, undef25 br i1 undef, label %too_big, label %if.end232726 27if.end2327: ; preds = %sqlite3VarintLen.exit28 br i1 undef, label %if.end2341, label %no_mem29 30if.end2341: ; preds = %if.end232731 br label %for.body235532 33for.body2355: ; preds = %for.body2355, %if.end234134 %add2366 = add nsw i32 undef, undef35 br i1 undef, label %for.body2377, label %for.body235536 37for.body2377: ; preds = %for.body235538 %conv23836154 = zext i32 %add2366 to i6439 %sub2384 = sub i64 %sub2322, %conv2383615440 %conv2385 = trunc i64 %sub2384 to i3241 %len.0.i = select i1 undef, i32 %conv2385, i32 undef42 %sub.i7384 = sub nsw i32 %len.0.i, 043 %call.i.i7385 = call ptr @__memset_chk(ptr undef, i32 0, i32 %sub.i7384, i32 undef) nounwind44 unreachable45 46too_big: ; preds = %sqlite3VarintLen.exit47 unreachable48 49no_mem: ; preds = %if.end2327, %for.body, %entry.no_mem_crit_edge50 unreachable51 52sqlite3ErrStr.exit: ; preds = %if.then8253 unreachable54}55