Updated tests for control flow: call instruction stores call element
instead of callee expression
This commit is contained in:
@@ -53,13 +53,13 @@ L0:
|
||||
mark(Bar().f())
|
||||
r(f) -> <v1>
|
||||
mark(Bar())
|
||||
call(Bar, <init>) -> <v2>
|
||||
call(Bar(), <init>) -> <v2>
|
||||
mark(f())
|
||||
call(f, invoke|<v1>, <v2>) -> <v3>
|
||||
call(f(), invoke|<v1>, <v2>) -> <v3>
|
||||
L1:
|
||||
1 <END> NEXT:[<SINK>]
|
||||
1 <END> NEXT:[<SINK>]
|
||||
error:
|
||||
<ERROR> PREV:[]
|
||||
<ERROR> PREV:[]
|
||||
sink:
|
||||
<SINK> PREV:[<ERROR>, <END>]
|
||||
<SINK> PREV:[<ERROR>, <END>]
|
||||
=====================
|
||||
|
||||
@@ -19,9 +19,9 @@ fun foobar(f: Foo) {
|
||||
}
|
||||
---------------------
|
||||
<v0>: Foo NEW: magic(f: Foo) -> <v0>
|
||||
Bar() <v2>: Bar NEW: call(Bar, <init>) -> <v2>
|
||||
Bar() <v2>: Bar NEW: call(Bar(), <init>) -> <v2>
|
||||
f <v1>: Foo NEW: r(f) -> <v1>
|
||||
f() <v3>: * NEW: call(f, invoke|<v1>, <v2>) -> <v3>
|
||||
f() <v3>: * NEW: call(f(), invoke|<v1>, <v2>) -> <v3>
|
||||
Bar().f() <v3>: * COPY
|
||||
{ Bar().f() } <v3>: * COPY
|
||||
=====================
|
||||
|
||||
@@ -17,18 +17,18 @@ L0:
|
||||
r(a) -> <v2>
|
||||
r(b) -> <v3>
|
||||
mark(a == b)
|
||||
call(==, equals|<v2>, <v3>) -> <v4>
|
||||
jf(L2|<v4>) NEXT:[read (Unit), mark({ })]
|
||||
call(a == b, equals|<v2>, <v3>) -> <v4>
|
||||
jf(L2|<v4>) NEXT:[read (Unit), mark({ })]
|
||||
3 mark({ })
|
||||
read (Unit)
|
||||
2 jmp(L3) NEXT:[<END>]
|
||||
2 jmp(L3) NEXT:[<END>]
|
||||
L2:
|
||||
read (Unit) PREV:[jf(L2|<v4>)]
|
||||
read (Unit) PREV:[jf(L2|<v4>)]
|
||||
L1:
|
||||
L3:
|
||||
1 <END> NEXT:[<SINK>] PREV:[jmp(L3), read (Unit)]
|
||||
1 <END> NEXT:[<SINK>] PREV:[jmp(L3), read (Unit)]
|
||||
error:
|
||||
<ERROR> PREV:[]
|
||||
<ERROR> PREV:[]
|
||||
sink:
|
||||
<SINK> PREV:[<ERROR>, <END>]
|
||||
<SINK> PREV:[<ERROR>, <END>]
|
||||
=====================
|
||||
|
||||
@@ -8,5 +8,5 @@ fun foo(a: Int, b: Int) {
|
||||
<v1>: Int NEW: magic(b: Int) -> <v1>
|
||||
a <v2>: OR{{<: Any}, {<: Any}} NEW: r(a) -> <v2>
|
||||
b <v3>: {<: Any?} NEW: r(b) -> <v3>
|
||||
a == b <v4>: Boolean NEW: call(==, equals|<v2>, <v3>) -> <v4>
|
||||
a == b <v4>: Boolean NEW: call(a == b, equals|<v2>, <v3>) -> <v4>
|
||||
=====================
|
||||
|
||||
@@ -12,12 +12,12 @@ L0:
|
||||
w(i|<v0>)
|
||||
r(i) -> <v1>
|
||||
mark(i++)
|
||||
call(++, inc|<v1>) -> <v2>
|
||||
call(i++, inc|<v1>) -> <v2>
|
||||
w(i|<v2>)
|
||||
L1:
|
||||
1 <END> NEXT:[<SINK>]
|
||||
1 <END> NEXT:[<SINK>]
|
||||
error:
|
||||
<ERROR> PREV:[]
|
||||
<ERROR> PREV:[]
|
||||
sink:
|
||||
<SINK> PREV:[<ERROR>, <END>]
|
||||
<SINK> PREV:[<ERROR>, <END>]
|
||||
=====================
|
||||
|
||||
@@ -11,11 +11,11 @@ L0:
|
||||
2 mark({ f() })
|
||||
r(f) -> <v1>
|
||||
mark(f())
|
||||
call(f, invoke|<v1>) -> <v2>
|
||||
call(f(), invoke|<v1>) -> <v2>
|
||||
L1:
|
||||
1 <END> NEXT:[<SINK>]
|
||||
1 <END> NEXT:[<SINK>]
|
||||
error:
|
||||
<ERROR> PREV:[]
|
||||
<ERROR> PREV:[]
|
||||
sink:
|
||||
<SINK> PREV:[<ERROR>, <END>]
|
||||
<SINK> PREV:[<ERROR>, <END>]
|
||||
=====================
|
||||
|
||||
@@ -5,6 +5,6 @@ fun foo(f: () -> Unit) {
|
||||
---------------------
|
||||
<v0>: {<: () -> Unit} NEW: magic(f: () -> Unit) -> <v0>
|
||||
f <v1>: {<: () -> Unit} NEW: r(f) -> <v1>
|
||||
f() <v2>: * NEW: call(f, invoke|<v1>) -> <v2>
|
||||
f() <v2>: * NEW: call(f(), invoke|<v1>) -> <v2>
|
||||
{ f() } <v2>: * COPY
|
||||
=====================
|
||||
|
||||
@@ -16,18 +16,18 @@ L0:
|
||||
r(a) -> <v2>
|
||||
r(b) -> <v3>
|
||||
mark(a != b)
|
||||
call(!=, equals|<v2>, <v3>) -> <v4>
|
||||
jf(L2|<v4>) NEXT:[read (Unit), mark({})]
|
||||
call(a != b, equals|<v2>, <v3>) -> <v4>
|
||||
jf(L2|<v4>) NEXT:[read (Unit), mark({})]
|
||||
3 mark({})
|
||||
read (Unit)
|
||||
2 jmp(L3) NEXT:[<END>]
|
||||
2 jmp(L3) NEXT:[<END>]
|
||||
L2:
|
||||
read (Unit) PREV:[jf(L2|<v4>)]
|
||||
read (Unit) PREV:[jf(L2|<v4>)]
|
||||
L1:
|
||||
L3:
|
||||
1 <END> NEXT:[<SINK>] PREV:[jmp(L3), read (Unit)]
|
||||
1 <END> NEXT:[<SINK>] PREV:[jmp(L3), read (Unit)]
|
||||
error:
|
||||
<ERROR> PREV:[]
|
||||
<ERROR> PREV:[]
|
||||
sink:
|
||||
<SINK> PREV:[<ERROR>, <END>]
|
||||
<SINK> PREV:[<ERROR>, <END>]
|
||||
=====================
|
||||
|
||||
@@ -7,5 +7,5 @@ fun neq(a: Int, b: Int) {
|
||||
<v1>: Int NEW: magic(b: Int) -> <v1>
|
||||
a <v2>: OR{{<: Any}, {<: Any}} NEW: r(a) -> <v2>
|
||||
b <v3>: {<: Any?} NEW: r(b) -> <v3>
|
||||
a != b <v4>: Boolean NEW: call(!=, equals|<v2>, <v3>) -> <v4>
|
||||
a != b <v4>: Boolean NEW: call(a != b, equals|<v2>, <v3>) -> <v4>
|
||||
=====================
|
||||
|
||||
Reference in New Issue
Block a user