Added/updated tests for LexicalScope.

This commit is contained in:
Svetlana Isakova
2014-03-05 19:32:10 +04:00
parent 2cfcd1783b
commit 006f3ccbe9
81 changed files with 1404 additions and 604 deletions
@@ -10,8 +10,8 @@ fun foo() {
}
---------------------
L0:
<START> INIT: in: {} out: {}
mark({ val b: Boolean if (1 < 2) { use(b) } else { b = true } })
1 <START> INIT: in: {} out: {}
2 mark({ val b: Boolean if (1 < 2) { use(b) } else { b = true } })
v(val b: Boolean) INIT: in: {} out: {b=D}
mark(if (1 < 2) { use(b) } else { b = true }) INIT: in: {b=D} out: {b=D}
mark(1 < 2)
@@ -19,18 +19,18 @@ L0:
r(2)
call(<, compareTo)
jf(L2)
mark({ use(b) })
3 mark({ use(b) })
mark(use(b)) USE: in: {b=READ} out: {b=READ}
r(b) USE: in: {} out: {b=READ}
call(use, use)
jmp(L3) USE: in: {} out: {}
2 jmp(L3) USE: in: {} out: {}
L2:
mark({ b = true })
3 mark({ b = true })
r(true) USE: in: {b=ONLY_WRITTEN_NEVER_READ} out: {b=ONLY_WRITTEN_NEVER_READ}
w(b) INIT: in: {b=D} out: {b=ID} USE: in: {} out: {b=ONLY_WRITTEN_NEVER_READ}
L1:
L3:
<END> INIT: in: {b=D} out: {b=D}
1 <END> INIT: in: {b=D} out: {b=D}
error:
<ERROR> INIT: in: {} out: {}
sink:
@@ -40,7 +40,7 @@ sink:
fun use(vararg a: Any?) = a
---------------------
L0:
<START> INIT: in: {} out: {}
1 <START> INIT: in: {} out: {}
v(vararg a: Any?) INIT: in: {} out: {a=D}
w(a) INIT: in: {a=D} out: {a=ID} USE: in: {a=READ} out: {a=READ}
r(a) INIT: in: {a=ID} out: {a=ID} USE: in: {} out: {a=READ}