restructured control flow tests

This commit is contained in:
Svetlana Isakova
2014-03-04 19:00:18 +04:00
parent fe349da4d5
commit ec47821567
85 changed files with 317 additions and 203 deletions
@@ -0,0 +1,49 @@
== foo ==
fun foo() {
val a = Array<Int>
3
a[10] = 4
2
a[10]
100
a[10] += 1
}
---------------------
L0:
<START>
mark({ val a = Array<Int> 3 a[10] = 4 2 a[10] 100 a[10] += 1 })
v(val a = Array<Int>)
mark(Array<Int>)
call(Array, <init>)
w(a)
r(3)
mark(a[10])
r(a)
r(10)
r(4)
call(a[10], set)
r(2)
mark(a[10])
r(a)
r(10)
call(a[10], get)
r(100)
mark(a[10] += 1)
mark(a[10])
r(a)
r(10)
call(a[10], get)
r(1)
call(+=, plus)
mark(a[10])
r(a)
r(10)
r(1)
call(a[10], set)
L1:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
@@ -0,0 +1,9 @@
fun foo() {
val a = Array<Int>
3
a[10] = 4
2
a[10]
100
a[10] += 1
}
@@ -0,0 +1,24 @@
== test ==
fun test(array: Array<(Int)->Unit>) {
array[11](3)
}
---------------------
L0:
<START>
v(array: Array<(Int)->Unit>)
w(array)
mark({ array[11](3) })
mark(array[11](3))
mark(array[11])
r(array)
r(11)
call(array[11], get)
r(3)
call(array[11], <for expression array[11]>)
L1:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
@@ -0,0 +1,3 @@
fun test(array: Array<(Int)->Unit>) {
array[11](3)
}
@@ -0,0 +1,50 @@
== Ab ==
abstract class Ab {
abstract fun getArray() : Array<Int>
}
---------------------
L0:
<START>
L1:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== getArray ==
abstract fun getArray() : Array<Int>
---------------------
L0:
<START>
L1:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
== test ==
fun test(ab: Ab) {
ab.getArray()[1]
}
---------------------
L0:
<START>
v(ab: Ab)
w(ab)
mark({ ab.getArray()[1] })
mark(ab.getArray()[1])
mark(ab.getArray())
mark(getArray())
r(ab)
call(getArray, getArray)
r(1)
call(ab.getArray()[1], get)
L1:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
@@ -0,0 +1,8 @@
abstract class Ab {
abstract fun getArray() : Array<Int>
}
fun test(ab: Ab) {
ab.getArray()[1]
}
@@ -0,0 +1,22 @@
== foo ==
fun foo(a: Array<Int>) {
a[1] = 2
}
---------------------
L0:
<START>
v(a: Array<Int>)
w(a)
mark({ a[1] = 2 })
mark(a[1])
r(a)
r(1)
r(2)
call(a[1], set)
L1:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
+3
View File
@@ -0,0 +1,3 @@
fun foo(a: Array<Int>) {
a[1] = 2
}
@@ -0,0 +1,29 @@
== foo ==
fun foo(a: Array<Int>) {
a[0] += 1
}
---------------------
L0:
<START>
v(a: Array<Int>)
w(a)
mark({ a[0] += 1 })
mark(a[0] += 1)
mark(a[0])
r(a)
r(0)
call(a[0], get)
r(1)
call(+=, plus)
mark(a[0])
r(a)
r(0)
r(1)
call(a[0], set)
L1:
<END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
@@ -0,0 +1,3 @@
fun foo(a: Array<Int>) {
a[0] += 1
}