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
@@ -0,0 +1,38 @@
== foo ==
fun foo() {
"before"
do {
var a = 2
} while (a > 0)
"after"
}
---------------------
L0:
1 <START> INIT: in: {} out: {}
2 mark({ "before" do { var a = 2 } while (a > 0) "after" })
mark("before")
r("before")
3 mark(do { var a = 2 } while (a > 0))
L2 [loop entry point]:
L4 [body entry point]:
mark({ var a = 2 }) INIT: in: {a=ID} out: {a=ID}
v(var a = 2)
r(2)
w(a)
L5 [condition entry point]:
mark(a > 0)
r(a)
r(0)
call(>, compareTo)
jt(L2 [loop entry point]) USE: in: {a=READ} out: {a=READ}
L3 [loop exit point]:
read (Unit)
2 mark("after")
r("after")
L1:
1 <END>
error:
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {a=ID} out: {a=ID} USE: in: {} out: {}
=====================
@@ -0,0 +1,7 @@
fun foo() {
"before"
do {
var a = 2
} while (a > 0)
"after"
}
@@ -0,0 +1,41 @@
== foo ==
fun foo() {
"before"
for (i in 1..10) {
val a = i
}
"after"
}
---------------------
L0:
1 <START> INIT: in: {} out: {}
2 mark({ "before" for (i in 1..10) { val a = i } "after" })
mark("before")
r("before")
3 mark(for (i in 1..10) { val a = i })
mark(1..10)
r(1)
r(10)
call(.., rangeTo)
v(i) INIT: in: {} out: {i=D}
w(i) INIT: in: {i=D} out: {i=ID}
L3:
jmp?(L2) INIT: in: {i=ID} out: {i=ID}
L4 [loop entry point]:
L5 [body entry point]:
4 mark({ val a = i }) INIT: in: {a=ID, i=ID} out: {a=ID, i=ID}
v(val a = i)
r(i)
w(a)
3 jmp?(L4 [loop entry point]) USE: in: {i=READ} out: {i=READ}
L2:
read (Unit)
2 mark("after")
r("after")
L1:
1 <END>
error:
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {a=ID, i=ID} out: {a=ID, i=ID} USE: in: {} out: {}
=====================
@@ -0,0 +1,7 @@
fun foo() {
"before"
for (i in 1..10) {
val a = i
}
"after"
}
@@ -0,0 +1,57 @@
== foo ==
fun foo() {
"before"
val b = 1
val f = { (x: Int) ->
val a = x + b
}
"after"
}
---------------------
L0:
1 <START> INIT: in: {} out: {}
2 mark({ "before" val b = 1 val f = { (x: Int) -> val a = x + b } "after" })
mark("before")
r("before")
v(val b = 1) INIT: in: {} out: {b=D}
r(1) INIT: in: {b=D} out: {b=D}
w(b) INIT: in: {b=D} out: {b=ID}
v(val f = { (x: Int) -> val a = x + b }) INIT: in: {b=ID} out: {b=ID, f=D}
mark({ (x: Int) -> val a = x + b }) INIT: in: {b=ID, f=D} out: {b=ID, f=D}
jmp?(L2)
d({ (x: Int) -> val a = x + b }) INIT: in: {a=ID, b=ID, f=D, x=ID} out: {a=ID, b=ID, f=D, x=ID} USE: in: {b=READ, x=READ} out: {b=READ, x=READ}
L2:
r({ (x: Int) -> val a = x + b }) INIT: in: {b=ID, f=D} out: {b=ID, f=D}
w(f) INIT: in: {b=ID, f=D} out: {b=ID, f=ID}
mark("after") INIT: in: {b=ID, f=ID} out: {b=ID, f=ID}
r("after")
L1:
1 <END>
error:
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {a=ID, b=ID, f=D, x=ID} out: {a=ID, b=ID, f=D, x=ID} USE: in: {} out: {}
=====================
== anonymous_0 ==
{ (x: Int) ->
val a = x + b
}
---------------------
L3:
3 <START> INIT: in: {b=ID, f=D} out: {b=ID, f=D}
v(x: Int) INIT: in: {b=ID, f=D} out: {b=ID, f=D, x=D}
w(x) INIT: in: {b=ID, f=D, x=D} out: {b=ID, f=D, x=ID}
4 mark(val a = x + b) INIT: in: {b=ID, f=D, x=ID} out: {b=ID, f=D, x=ID}
v(val a = x + b) INIT: in: {b=ID, f=D, x=ID} out: {a=D, b=ID, f=D, x=ID}
mark(x + b) INIT: in: {a=D, b=ID, f=D, x=ID} out: {a=D, b=ID, f=D, x=ID} USE: in: {b=READ, x=READ} out: {b=READ, x=READ}
r(x) USE: in: {b=READ} out: {b=READ, x=READ}
r(b) USE: in: {} out: {b=READ}
call(+, plus)
w(a) INIT: in: {a=D, b=ID, f=D, x=ID} out: {a=ID, b=ID, f=D, x=ID}
L4:
3 <END> INIT: in: {a=ID, b=ID, f=D, x=ID} out: {a=ID, b=ID, f=D, x=ID}
error:
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {a=ID, b=ID, f=D, x=ID} out: {a=ID, b=ID, f=D, x=ID} USE: in: {} out: {}
=====================
@@ -0,0 +1,8 @@
fun foo() {
"before"
val b = 1
val f = { (x: Int) ->
val a = x + b
}
"after"
}
@@ -0,0 +1,40 @@
== foo ==
fun foo() {
"before"
if (true) {
val a = 1
}
else {
val b = 2
}
"after"
}
---------------------
L0:
1 <START> INIT: in: {} out: {}
2 mark({ "before" if (true) { val a = 1 } else { val b = 2 } "after" })
mark("before")
r("before")
mark(if (true) { val a = 1 } else { val b = 2 })
r(true)
jf(L2)
3 mark({ val a = 1 })
v(val a = 1) INIT: in: {} out: {a=D}
r(1) INIT: in: {a=D} out: {a=D}
w(a) INIT: in: {a=D} out: {a=ID}
2 jmp(L3) INIT: in: {a=ID} out: {a=ID}
L2:
3 mark({ val b = 2 }) INIT: in: {} out: {}
v(val b = 2) INIT: in: {} out: {b=D}
r(2) INIT: in: {b=D} out: {b=D}
w(b) INIT: in: {b=D} out: {b=ID}
L3:
2 mark("after") INIT: in: {a=ID, b=ID} out: {a=ID, b=ID}
r("after")
L1:
1 <END>
error:
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {a=ID, b=ID} out: {a=ID, b=ID} USE: in: {} out: {}
=====================
@@ -0,0 +1,10 @@
fun foo() {
"before"
if (true) {
val a = 1
}
else {
val b = 2
}
"after"
}
@@ -0,0 +1,55 @@
== foo ==
fun foo() {
"before"
class A(val x: Int) {
{
val a = x
}
fun foo() {
val b = x
}
}
"after"
}
---------------------
L0:
1 <START> INIT: in: {} out: {}
2 mark({ "before" class A(val x: Int) { { val a = x } fun foo() { val b = x } } "after" })
mark("before")
r("before")
v(val x: Int) INIT: in: {} out: {x=D}
w(x) INIT: in: {x=D} out: {x=ID}
3 mark({ val a = x }) INIT: in: {x=ID} out: {x=ID}
v(val a = x) INIT: in: {x=ID} out: {a=D, x=ID}
r(x) INIT: in: {a=D, x=ID} out: {a=D, x=ID}
w(a) INIT: in: {a=D, x=ID} out: {a=ID, x=ID}
2 jmp?(L2) INIT: in: {a=ID, x=ID} out: {a=ID, x=ID}
d(fun foo() { val b = x }) INIT: in: {a=ID, b=ID, x=ID} out: {a=ID, b=ID, x=ID} USE: in: {x=READ} out: {x=READ}
L2:
mark("after") INIT: in: {a=ID, x=ID} out: {a=ID, x=ID}
r("after")
L1:
1 <END>
error:
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {a=ID, b=ID, x=ID} out: {a=ID, b=ID, x=ID} USE: in: {} out: {}
=====================
== foo ==
fun foo() {
val b = x
}
---------------------
L3:
3 <START> INIT: in: {a=ID, x=ID} out: {a=ID, x=ID}
4 mark({ val b = x })
v(val b = x) INIT: in: {a=ID, x=ID} out: {a=ID, b=D, x=ID} USE: in: {x=READ} out: {x=READ}
r(x) INIT: in: {a=ID, b=D, x=ID} out: {a=ID, b=D, x=ID} USE: in: {} out: {x=READ}
w(b) INIT: in: {a=ID, b=D, x=ID} out: {a=ID, b=ID, x=ID}
L4:
3 <END> INIT: in: {a=ID, b=ID, x=ID} out: {a=ID, b=ID, x=ID}
error:
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {a=ID, b=ID, x=ID} out: {a=ID, b=ID, x=ID} USE: in: {} out: {}
=====================
@@ -0,0 +1,12 @@
fun foo() {
"before"
class A(val x: Int) {
{
val a = x
}
fun foo() {
val b = x
}
}
"after"
}
@@ -0,0 +1,53 @@
== foo ==
fun foo() {
"before"
val b = 1
fun local(x: Int) {
val a = x + b
}
"after"
}
---------------------
L0:
1 <START> INIT: in: {} out: {}
2 mark({ "before" val b = 1 fun local(x: Int) { val a = x + b } "after" })
mark("before")
r("before")
v(val b = 1) INIT: in: {} out: {b=D}
r(1) INIT: in: {b=D} out: {b=D}
w(b) INIT: in: {b=D} out: {b=ID}
jmp?(L2) INIT: in: {b=ID} out: {b=ID}
d(fun local(x: Int) { val a = x + b }) INIT: in: {a=ID, b=ID, x=ID} out: {a=ID, b=ID, x=ID} USE: in: {b=READ, x=READ} out: {b=READ, x=READ}
L2:
mark("after") INIT: in: {b=ID} out: {b=ID}
r("after")
L1:
1 <END>
error:
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {a=ID, b=ID, x=ID} out: {a=ID, b=ID, x=ID} USE: in: {} out: {}
=====================
== local ==
fun local(x: Int) {
val a = x + b
}
---------------------
L3:
3 <START> INIT: in: {b=ID} out: {b=ID}
v(x: Int) INIT: in: {b=ID} out: {b=ID, x=D}
w(x) INIT: in: {b=ID, x=D} out: {b=ID, x=ID}
4 mark({ val a = x + b }) INIT: in: {b=ID, x=ID} out: {b=ID, x=ID}
v(val a = x + b) INIT: in: {b=ID, x=ID} out: {a=D, b=ID, x=ID}
mark(x + b) INIT: in: {a=D, b=ID, x=ID} out: {a=D, b=ID, x=ID} USE: in: {b=READ, x=READ} out: {b=READ, x=READ}
r(x) USE: in: {b=READ} out: {b=READ, x=READ}
r(b) USE: in: {} out: {b=READ}
call(+, plus)
w(a) INIT: in: {a=D, b=ID, x=ID} out: {a=ID, b=ID, x=ID}
L4:
3 <END> INIT: in: {a=ID, b=ID, x=ID} out: {a=ID, b=ID, x=ID}
error:
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {a=ID, b=ID, x=ID} out: {a=ID, b=ID, x=ID} USE: in: {} out: {}
=====================
@@ -0,0 +1,8 @@
fun foo() {
"before"
val b = 1
fun local(x: Int) {
val a = x + b
}
"after"
}
@@ -0,0 +1,46 @@
== foo ==
fun foo() {
"before"
val b = 1
fun local(x: Int) = x + b
"after"
}
---------------------
L0:
1 <START> INIT: in: {} out: {} USE: in: {} out: {}
2 mark({ "before" val b = 1 fun local(x: Int) = x + b "after" })
mark("before")
r("before")
v(val b = 1) INIT: in: {} out: {b=D}
r(1) INIT: in: {b=D} out: {b=D}
w(b) INIT: in: {b=D} out: {b=ID}
jmp?(L2) INIT: in: {b=ID} out: {b=ID}
d(fun local(x: Int) = x + b) USE: in: {b=READ} out: {b=READ}
L2:
mark("after")
r("after")
L1:
1 <END> INIT: in: {} out: {}
error:
<ERROR>
sink:
<SINK> USE: in: {} out: {}
=====================
== local ==
fun local(x: Int) = x + b
---------------------
L3:
3 <START> INIT: in: {} out: {}
v(x: Int) INIT: in: {} out: {x=D}
w(x) INIT: in: {x=D} out: {x=ID}
mark(x + b) INIT: in: {x=ID} out: {x=ID} USE: in: {b=READ, x=READ} out: {b=READ, x=READ}
r(x) USE: in: {b=READ} out: {b=READ, x=READ}
r(b) USE: in: {} out: {b=READ}
call(+, plus)
L4:
<END>
error:
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {x=ID} out: {x=ID} USE: in: {} out: {}
=====================
@@ -0,0 +1,6 @@
fun foo() {
"before"
val b = 1
fun local(x: Int) = x + b
"after"
}
@@ -0,0 +1,53 @@
== foo ==
fun foo() {
"before"
object A {
{
val a = 1
}
fun foo() {
val b = 2
}
}
"after"
}
---------------------
L0:
1 <START> INIT: in: {} out: {}
2 mark({ "before" object A { { val a = 1 } fun foo() { val b = 2 } } "after" })
mark("before")
r("before")
3 mark({ val a = 1 })
v(val a = 1) INIT: in: {} out: {a=D}
r(1) INIT: in: {a=D} out: {a=D}
w(a) INIT: in: {a=D} out: {a=ID}
2 jmp?(L2) INIT: in: {a=ID} out: {a=ID}
d(fun foo() { val b = 2 }) INIT: in: {a=ID, b=ID} out: {a=ID, b=ID}
L2:
mark("after") INIT: in: {a=ID} out: {a=ID}
r("after")
L1:
1 <END>
error:
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {a=ID, b=ID} out: {a=ID, b=ID} USE: in: {} out: {}
=====================
== foo ==
fun foo() {
val b = 2
}
---------------------
L3:
3 <START> INIT: in: {a=ID} out: {a=ID}
4 mark({ val b = 2 })
v(val b = 2) INIT: in: {a=ID} out: {a=ID, b=D}
r(2) INIT: in: {a=ID, b=D} out: {a=ID, b=D}
w(b) INIT: in: {a=ID, b=D} out: {a=ID, b=ID}
L4:
3 <END> INIT: in: {a=ID, b=ID} out: {a=ID, b=ID}
error:
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {a=ID, b=ID} out: {a=ID, b=ID} USE: in: {} out: {}
=====================
@@ -0,0 +1,12 @@
fun foo() {
"before"
object A {
{
val a = 1
}
fun foo() {
val b = 2
}
}
"after"
}
@@ -0,0 +1,57 @@
== foo ==
fun foo() {
"before"
val bar = object {
{
val x = 1
}
fun foo() {
val a = 2
}
}
"after"
}
---------------------
L0:
1 <START> INIT: in: {} out: {}
2 mark({ "before" val bar = object { { val x = 1 } fun foo() { val a = 2 } } "after" })
mark("before")
r("before")
v(val bar = object { { val x = 1 } fun foo() { val a = 2 } }) INIT: in: {} out: {bar=D}
mark(object { { val x = 1 } fun foo() { val a = 2 } }) INIT: in: {bar=D} out: {bar=D}
3 mark({ val x = 1 })
v(val x = 1) INIT: in: {bar=D} out: {bar=D, x=D}
r(1) INIT: in: {bar=D, x=D} out: {bar=D, x=D}
w(x) INIT: in: {bar=D, x=D} out: {bar=D, x=ID}
2 jmp?(L2) INIT: in: {bar=D, x=ID} out: {bar=D, x=ID}
d(fun foo() { val a = 2 }) INIT: in: {a=ID, bar=D, x=ID} out: {a=ID, bar=D, x=ID}
L2:
r(object { { val x = 1 } fun foo() { val a = 2 } }) INIT: in: {bar=D, x=ID} out: {bar=D, x=ID}
w(bar) INIT: in: {bar=D, x=ID} out: {bar=ID, x=ID}
mark("after") INIT: in: {bar=ID, x=ID} out: {bar=ID, x=ID}
r("after")
L1:
1 <END>
error:
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {a=ID, bar=D, x=ID} out: {a=ID, bar=D, x=ID} USE: in: {} out: {}
=====================
== foo ==
fun foo() {
val a = 2
}
---------------------
L3:
3 <START> INIT: in: {bar=D, x=ID} out: {bar=D, x=ID}
4 mark({ val a = 2 })
v(val a = 2) INIT: in: {bar=D, x=ID} out: {a=D, bar=D, x=ID}
r(2) INIT: in: {a=D, bar=D, x=ID} out: {a=D, bar=D, x=ID}
w(a) INIT: in: {a=D, bar=D, x=ID} out: {a=ID, bar=D, x=ID}
L4:
3 <END> INIT: in: {a=ID, bar=D, x=ID} out: {a=ID, bar=D, x=ID}
error:
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {a=ID, bar=D, x=ID} out: {a=ID, bar=D, x=ID} USE: in: {} out: {}
=====================
@@ -0,0 +1,12 @@
fun foo() {
"before"
val bar = object {
{
val x = 1
}
fun foo() {
val a = 2
}
}
"after"
}
@@ -0,0 +1,66 @@
== foo ==
fun foo() {
class A {
var a : Int
get() {
return $a
}
set(v: Int) {
$a = v
}
}
}
---------------------
L0:
1 <START> INIT: in: {} out: {} USE: in: {} out: {}
2 mark({ class A { var a : Int get() { return $a } set(v: Int) { $a = v } } })
v(var a : Int get() { return $a } set(v: Int) { $a = v }) INIT: in: {} out: {a=D}
jmp?(L2) INIT: in: {a=D} out: {a=D}
d(get() { return $a }) USE: in: {a=READ} out: {a=READ}
L2:
jmp?(L5)
d(set(v: Int) { $a = v }) USE: in: {a=ONLY_WRITTEN_NEVER_READ} out: {a=ONLY_WRITTEN_NEVER_READ}
L1:
L5:
1 <END> INIT: in: {} out: {}
error:
<ERROR>
sink:
<SINK> USE: in: {} out: {}
=====================
== get_a ==
get() {
return $a
}
---------------------
L3:
3 <START> INIT: in: {} out: {}
4 mark({ return $a }) USE: in: {a=READ} out: {a=READ}
r($a) USE: in: {} out: {a=READ}
ret(*) L4
L4:
3 <END>
error:
<ERROR>
sink:
<SINK> USE: in: {} out: {}
=====================
== set_a ==
set(v: Int) {
$a = v
}
---------------------
L6:
3 <START> INIT: in: {} out: {}
v(v: Int) INIT: in: {} out: {v=D}
w(v) INIT: in: {v=D} out: {v=ID}
4 mark({ $a = v }) INIT: in: {v=ID} out: {v=ID} USE: in: {a=ONLY_WRITTEN_NEVER_READ, v=READ} out: {a=ONLY_WRITTEN_NEVER_READ, v=READ}
r(v) USE: in: {a=ONLY_WRITTEN_NEVER_READ} out: {a=ONLY_WRITTEN_NEVER_READ, v=READ}
w($a) INIT: in: {v=ID} out: {a=I, v=ID} USE: in: {} out: {a=ONLY_WRITTEN_NEVER_READ}
L7:
3 <END> INIT: in: {a=I, v=ID} out: {a=I, v=ID}
error:
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {a=I, v=ID} out: {a=I, v=ID} USE: in: {} out: {}
=====================
@@ -0,0 +1,11 @@
fun foo() {
class A {
var a : Int
get() {
return $a
}
set(v: Int) {
$a = v
}
}
}
@@ -0,0 +1,59 @@
== foo ==
fun foo() {
"before"
try {
foo()
}
catch (e: Exception) {
val a = e
}
finally {
val a = 1
}
"after"
}
---------------------
L0:
1 <START> INIT: in: {} out: {}
2 mark({ "before" try { foo() } catch (e: Exception) { val a = e } finally { val a = 1 } "after" })
mark("before")
r("before")
mark(try { foo() } catch (e: Exception) { val a = e } finally { val a = 1 })
jmp?(L2 [onException]) USE: in: {e=READ} out: {e=READ}
jmp?(L3 [onExceptionToFinallyBlock])
3 mark({ foo() })
mark(foo())
call(foo, foo)
2 jmp(L4 [afterCatches]) USE: in: {} out: {}
L2 [onException]:
3 v(e: Exception) INIT: in: {} out: {e=D}
w(e) INIT: in: {e=D} out: {e=ID}
4 mark({ val a = e }) INIT: in: {e=ID} out: {e=ID}
v(val a = e) INIT: in: {e=ID} out: {a=D, e=ID} USE: in: {e=READ} out: {e=READ}
r(e) INIT: in: {a=D, e=ID} out: {a=D, e=ID} USE: in: {} out: {e=READ}
w(a) INIT: in: {a=D, e=ID} out: {a=ID, e=ID}
3 jmp(L4 [afterCatches]) INIT: in: {a=ID, e=ID} out: {a=ID, e=ID}
L4 [afterCatches]:
2 jmp(L5 [skipFinallyToErrorBlock])
L3 [onExceptionToFinallyBlock]:
L6 [start finally]:
3 mark({ val a = 1 }) INIT: in: {} out: {}
v(val a = 1) INIT: in: {} out: {a=D}
r(1) INIT: in: {a=D} out: {a=D}
w(a) INIT: in: {a=D} out: {a=ID}
L7 [finish finally]:
2 jmp(error) INIT: in: {a=ID} out: {a=ID}
L5 [skipFinallyToErrorBlock]:
3 mark({ val a = 1 }) INIT: in: {a=ID, e=ID} out: {a=ID, e=ID}
v(val a = 1) INIT: in: {a=ID, e=ID} out: {a=D, a=ID, e=ID}
r(1) INIT: in: {a=D, a=ID, e=ID} out: {a=D, a=ID, e=ID}
w(a) INIT: in: {a=D, a=ID, e=ID} out: {a=ID, a=ID, e=ID}
2 mark("after") INIT: in: {a=ID, a=ID, e=ID} out: {a=ID, a=ID, e=ID}
r("after")
L1:
1 <END>
error:
<ERROR> INIT: in: {a=ID} out: {a=ID}
sink:
<SINK> INIT: in: {a=ID, a=ID, e=ID} out: {a=ID, a=ID, e=ID} USE: in: {} out: {}
=====================
@@ -0,0 +1,13 @@
fun foo() {
"before"
try {
foo()
}
catch (e: Exception) {
val a = e
}
finally {
val a = 1
}
"after"
}
@@ -0,0 +1,33 @@
== foo ==
fun foo() {
"before"
while (true) {
val a: Int
}
"after"
}
---------------------
L0:
1 <START> INIT: in: {} out: {}
2 mark({ "before" while (true) { val a: Int } "after" })
mark("before")
r("before")
mark(while (true) { val a: Int })
L2 [loop entry point]:
L5 [condition entry point]:
r(true) INIT: in: {a=D} out: {a=D}
L4 [body entry point]:
3 mark({ val a: Int })
v(val a: Int)
2 jmp(L2 [loop entry point]) USE: in: {} out: {}
L3 [loop exit point]:
- read (Unit)
- mark("after")
- r("after")
L1:
1 <END> INIT: in: {} out: {}
error:
<ERROR>
sink:
<SINK> USE: in: {} out: {}
=====================
@@ -0,0 +1,7 @@
fun foo() {
"before"
while (true) {
val a: Int
}
"after"
}