loops: add a few more tests
ADD
tests/alive-tv/loops/nested-fail.srctgt.ll
+; TEST-ARGS: -src-unroll=2 -tgt-unroll=2
+; ERROR: Value mismatch
+
+define i32 @src() {
+entry:
+ %r = alloca i32, align 4
+ store i32 0, i32* %r, align 4
+ br label %for.cond
+
+for.cond:
+ %0 = phi i32 [ 0, %entry ], [ %inc6, %for.inc5 ]
+ %cmp = icmp slt i32 %0, 2
+ br i1 %cmp, label %for.body, label %for.end7
+
+for.body:
+ br label %for.cond1
+
+for.cond1:
+ %1 = phi i32 [ 0, %for.body ], [ %inc4, %for.inc ]
+ %cmp2 = icmp slt i32 %1, 2
+ br i1 %cmp2, label %for.body3, label %for.inc5
+
+for.body3:
+ %2 = load i32, i32* %r, align 4
+ %inc = add i32 %2, 1
+ store i32 %inc, i32* %r, align 4
+ br label %for.inc
+
+for.inc:
+ %inc4 = add i32 %1, 1
+ br label %for.cond1
+
+for.inc5:
+ %inc6 = add i32 %0, 1
+ br label %for.cond
+
+for.end7:
+ %3 = load i32, i32* %r, align 4
+ ret i32 %3
+}
+
+define i32 @tgt() {
+ ret i32 0
+}

ADD
tests/alive-tv/loops/nested.srctgt.ll
+; TEST-ARGS: -src-unroll=2 -tgt-unroll=2
+
+define i32 @src() {
+entry:
+ %r = alloca i32, align 4
+ store i32 0, i32* %r, align 4
+ br label %for.cond
+
+for.cond:
+ %0 = phi i32 [ 0, %entry ], [ %inc6, %for.inc5 ]
+ %cmp = icmp slt i32 %0, 2
+ br i1 %cmp, label %for.body, label %for.end7
+
+for.body:
+ br label %for.cond1
+
+for.cond1:
+ %1 = phi i32 [ 0, %for.body ], [ %inc4, %for.inc ]
+ %cmp2 = icmp slt i32 %1, 2
+ br i1 %cmp2, label %for.body3, label %for.inc5
+
+for.body3:
+ %2 = load i32, i32* %r, align 4
+ %inc = add i32 %2, 1
+ store i32 %inc, i32* %r, align 4
+ br label %for.inc
+
+for.inc:
+ %inc4 = add i32 %1, 1
+ br label %for.cond1
+
+for.inc5:
+ %inc6 = add i32 %0, 1
+ br label %for.cond
+
+for.end7:
+ %3 = load i32, i32* %r, align 4
+ ret i32 %3
+}
+
+define i32 @tgt() {
+ ret i32 4
+}

ADD
tests/alive-tv/loops/simple-fail.srctgt.ll
+; TEST-ARGS: -src-unroll=2 -tgt-unroll=2
+; ERROR: Value mismatch
+
+define i32 @src() {
+entry:
+ %r = alloca i32, align 4
+ store i32 0, i32* %r, align 4
+ br label %for.cond
+
+for.cond:
+ %i = phi i32 [ 0, %entry ], [ %inc1, %for.body ]
+ %cmp = icmp slt i32 %i, 2
+ br i1 %cmp, label %for.body, label %for.end
+
+for.body:
+ %0 = load i32, i32* %r, align 4
+ %inc = add i32 %0, 1
+ store i32 %inc, i32* %r, align 4
+ %inc1 = add i32 %i, 1
+ br label %for.cond
+
+for.end:
+ %1 = load i32, i32* %r, align 4
+ ret i32 %1
+}
+
+define i32 @tgt() {
+ ret i32 0
+}

MODIFY
tests/alive-tv/loops/simple.srctgt.ll
tests/alive-tv/loops/simple.srctgt.ll
; TEST-ARGS: -src-unroll=2 -tgt-unroll=2
-; ERROR: Value mismatch
define i32 @src() {
entry:
@@ -25,5 +24,5 @@ for.end:
}
define i32 @tgt() {
- ret i32 0
+ ret i32 2
}

loops: add a few more tests