restructured control flow tests
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
== foo ==
|
||||
fun foo(a: Int, b: Int) {
|
||||
if (a == b) {
|
||||
}
|
||||
}
|
||||
---------------------
|
||||
L0:
|
||||
<START>
|
||||
v(a: Int)
|
||||
w(a)
|
||||
v(b: Int)
|
||||
w(b)
|
||||
mark({ if (a == b) { } })
|
||||
mark(if (a == b) { })
|
||||
mark(a == b)
|
||||
r(a)
|
||||
r(b)
|
||||
call(==, equals)
|
||||
jf(L2) NEXT:[read (Unit), mark({ })]
|
||||
mark({ })
|
||||
read (Unit)
|
||||
jmp(L3) NEXT:[<END>]
|
||||
L2:
|
||||
read (Unit) PREV:[jf(L2)]
|
||||
L1:
|
||||
L3:
|
||||
<END> NEXT:[<SINK>] PREV:[jmp(L3), read (Unit)]
|
||||
error:
|
||||
<ERROR> PREV:[]
|
||||
sink:
|
||||
<SINK> PREV:[<ERROR>, <END>]
|
||||
=====================
|
||||
@@ -0,0 +1,4 @@
|
||||
fun foo(a: Int, b: Int) {
|
||||
if (a == b) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
== foo ==
|
||||
fun foo() {
|
||||
var i = 1
|
||||
i++
|
||||
}
|
||||
---------------------
|
||||
L0:
|
||||
<START>
|
||||
mark({ var i = 1 i++ })
|
||||
v(var i = 1)
|
||||
r(1)
|
||||
w(i)
|
||||
mark(i++)
|
||||
r(i)
|
||||
call(++, inc)
|
||||
w(i)
|
||||
L1:
|
||||
<END> NEXT:[<SINK>]
|
||||
error:
|
||||
<ERROR> PREV:[]
|
||||
sink:
|
||||
<SINK> PREV:[<ERROR>, <END>]
|
||||
=====================
|
||||
@@ -0,0 +1,4 @@
|
||||
fun foo() {
|
||||
var i = 1
|
||||
i++
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
== foo ==
|
||||
fun foo(f: () -> Unit) {
|
||||
f()
|
||||
}
|
||||
---------------------
|
||||
L0:
|
||||
<START>
|
||||
v(f: () -> Unit)
|
||||
w(f)
|
||||
mark({ f() })
|
||||
mark(f())
|
||||
r(f)
|
||||
call(f, invoke)
|
||||
L1:
|
||||
<END> NEXT:[<SINK>]
|
||||
error:
|
||||
<ERROR> PREV:[]
|
||||
sink:
|
||||
<SINK> PREV:[<ERROR>, <END>]
|
||||
=====================
|
||||
@@ -0,0 +1,3 @@
|
||||
fun foo(f: () -> Unit) {
|
||||
f()
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
== neq ==
|
||||
fun neq(a: Int, b: Int) {
|
||||
if (a != b) {}
|
||||
}
|
||||
---------------------
|
||||
L0:
|
||||
<START>
|
||||
v(a: Int)
|
||||
w(a)
|
||||
v(b: Int)
|
||||
w(b)
|
||||
mark({ if (a != b) {} })
|
||||
mark(if (a != b) {})
|
||||
mark(a != b)
|
||||
r(a)
|
||||
r(b)
|
||||
call(!=, equals)
|
||||
jf(L2) NEXT:[read (Unit), mark({})]
|
||||
mark({})
|
||||
read (Unit)
|
||||
jmp(L3) NEXT:[<END>]
|
||||
L2:
|
||||
read (Unit) PREV:[jf(L2)]
|
||||
L1:
|
||||
L3:
|
||||
<END> NEXT:[<SINK>] PREV:[jmp(L3), read (Unit)]
|
||||
error:
|
||||
<ERROR> PREV:[]
|
||||
sink:
|
||||
<SINK> PREV:[<ERROR>, <END>]
|
||||
=====================
|
||||
@@ -0,0 +1,3 @@
|
||||
fun neq(a: Int, b: Int) {
|
||||
if (a != b) {}
|
||||
}
|
||||
Reference in New Issue
Block a user