Add tests for element -> pseudo-value mapping

This commit is contained in:
Alexey Sedunov
2014-05-19 18:32:03 +04:00
parent d2c055e9da
commit 4a5d2e6728
78 changed files with 3105 additions and 1 deletions
@@ -0,0 +1,28 @@
== foo ==
fun foo() {
val b: Boolean
if (1 < 2) {
use(b)
}
else {
b = true
}
}
---------------------
1 <v0> NEW()
< <v2> NEW(<v0>, <v1>)
2 <v1> NEW()
1 < 2 <v2> COPY
use <v4> NEW(<v3>)
b <v3> NEW()
use(b) <v4> COPY
{ use(b) } <v4> COPY
true <v5> NEW()
if (1 < 2) { use(b) } else { b = true } <v4> COPY
{ val b: Boolean if (1 < 2) { use(b) } else { b = true } } <v4> COPY
=====================
== use ==
fun use(vararg a: Any?) = a
---------------------
a <v1> NEW()
=====================
@@ -0,0 +1,10 @@
== A ==
class A {
{
x = 1
}
val x: Int
}
---------------------
1 <v0> NEW()
=====================
@@ -0,0 +1,32 @@
== foo ==
fun foo() {
val a = 1
val f = { (x: Int) ->
val y = x + a
use(a)
}
}
---------------------
1 <v0> NEW()
{ (x: Int) -> val y = x + a use(a) } <v1> NEW()
=====================
== anonymous_0 ==
{ (x: Int) ->
val y = x + a
use(a)
}
---------------------
x <v1> NEW()
+ <v3> NEW(<v1>, <v2>)
a <v2> NEW()
x + a <v3> COPY
use <v5> NEW(<v4>)
a <v4> NEW()
use(a) <v5> COPY
val y = x + a use(a) <v5> COPY
=====================
== use ==
fun use(vararg a: Any?) = a
---------------------
a <v1> NEW()
=====================
@@ -0,0 +1,34 @@
== foo ==
fun foo() {
val a = 1
val b: Int
b = 2
42
}
---------------------
1 <v0> NEW()
2 <v1> NEW()
42 <v2> NEW()
{ val a = 1 val b: Int b = 2 42 } <v2> COPY
=====================
== bar ==
fun bar(foo: Foo) {
foo.c
foo.c = 2
42
}
---------------------
foo <v1> NEW()
c <v2> NEW(<v1>)
foo.c <v2> COPY
foo <v4> NEW()
2 <v3> NEW()
42 <v5> NEW()
{ foo.c foo.c = 2 42 } <v5> COPY
=====================
== Foo ==
trait Foo {
var c: Int
}
---------------------
=====================
@@ -0,0 +1,31 @@
== foo ==
fun foo() {
var a = 1
use(a)
a = 2
use(a)
}
---------------------
1 <v0> NEW()
use <v2> NEW(<v1>)
a <v1> NEW()
use(a) <v2> COPY
2 <v3> NEW()
use <v5> NEW(<v4>)
a <v4> NEW()
use(a) <v5> COPY
{ var a = 1 use(a) a = 2 use(a) } <v5> COPY
=====================
== bar ==
fun bar() {
val b: Int
b = 3
}
---------------------
3 <v0> NEW()
=====================
== use ==
fun use(a: Int) = a
---------------------
a <v1> NEW()
=====================