Files
kotlin-fork/compiler/testData/cfg-variables/basic/VariablesInitialization.instructions
T
2014-03-07 21:08:16 +04:00

67 lines
2.8 KiB
Plaintext

== foo ==
fun foo() {
val a = 1
val b: Int
b = 2
42
}
---------------------
L0:
1 <START> INIT: in: {} out: {}
2 mark({ val a = 1 val b: Int b = 2 42 })
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}
v(val b: Int) INIT: in: {a=ID} out: {a=ID, b=D}
r(2) INIT: in: {a=ID, b=D} out: {a=ID, b=D} USE: in: {b=ONLY_WRITTEN_NEVER_READ} out: {b=ONLY_WRITTEN_NEVER_READ}
w(b) INIT: in: {a=ID, b=D} out: {a=ID, b=ID} USE: in: {} out: {b=ONLY_WRITTEN_NEVER_READ}
r(42) INIT: in: {a=ID, b=ID} out: {a=ID, b=ID}
L1:
1 <END>
error:
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {a=ID, b=ID} out: {a=ID, b=ID} USE: in: {} out: {}
=====================
== bar ==
fun bar(foo: Foo) {
foo.c
foo.c = 2
42
}
---------------------
L0:
1 <START> INIT: in: {} out: {}
v(foo: Foo) INIT: in: {} out: {foo=D}
w(foo) INIT: in: {foo=D} out: {foo=ID}
2 mark({ foo.c foo.c = 2 42 }) INIT: in: {foo=ID} out: {foo=ID}
mark(foo.c)
r(foo) USE: in: {c=READ, foo=READ} out: {c=READ, foo=READ}
r(c) USE: in: {c=ONLY_WRITTEN_NEVER_READ, foo=READ} out: {c=READ, foo=READ}
r(2) USE: in: {c=ONLY_WRITTEN_NEVER_READ, foo=READ} out: {c=ONLY_WRITTEN_NEVER_READ, foo=READ}
r(foo) USE: in: {c=ONLY_WRITTEN_NEVER_READ} out: {c=ONLY_WRITTEN_NEVER_READ, foo=READ}
w(foo.c) INIT: in: {foo=ID} out: {c=I, foo=ID} USE: in: {} out: {c=ONLY_WRITTEN_NEVER_READ}
r(42) INIT: in: {c=I, foo=ID} out: {c=I, foo=ID}
L1:
1 <END>
error:
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {c=I, foo=ID} out: {c=I, foo=ID} USE: in: {} out: {}
=====================
== Foo ==
trait Foo {
var c: Int
}
---------------------
L0:
1 <START> INIT: in: {} out: {}
v(var c: Int) INIT: in: {} out: {c=D}
L1:
<END> INIT: in: {c=D} out: {c=D}
error:
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {c=D} out: {c=D} USE: in: {} out: {}
=====================