Files
kotlin-fork/compiler/testData/cfg-variables/basic/VariablesUsage.instructions
T
Denis Zharkov edbf360852 Do not render trivial variables in DataFlow tests
The reason is that while there are optimizations for them
definition of their state is both rather simple and may be
confusing in testData
2017-10-02 10:04:16 +03:00

66 lines
2.5 KiB
Plaintext
Vendored

== foo ==
fun foo() {
var a = 1
use(a)
a = 2
use(a)
}
---------------------
L0:
1 <START> INIT: in: {} out: {} USE: in: {} out: {}
2 mark({ var a = 1 use(a) a = 2 use(a) })
v(var a = 1) INIT: in: {} out: {a=D}
r(1) -> <v0> INIT: in: {a=D} out: {a=D}
w(a|<v0>) INIT: in: {a=D} out: {a=ID} USE: in: {a=READ} out: {a=READ}
r(a) -> <v1> INIT: in: {a=ID} out: {a=ID} USE: in: {a=WRITTEN_AFTER_READ} out: {a=READ}
mark(use(a))
call(use(a), use|<v1>) -> <v2>
r(2) -> <v3> USE: in: {a=WRITTEN_AFTER_READ} out: {a=WRITTEN_AFTER_READ}
w(a|<v3>) USE: in: {a=READ} out: {a=WRITTEN_AFTER_READ}
r(a) -> <v4> USE: in: {} out: {a=READ}
mark(use(a))
call(use(a), use|<v4>) -> <v5>
L1:
1 <END> INIT: in: {} out: {}
error:
<ERROR>
sink:
<SINK> USE: in: {} out: {}
=====================
== bar ==
fun bar() {
val b: Int
b = 3
}
---------------------
L0:
1 <START> INIT: in: {} out: {} USE: in: {} out: {}
2 mark({ val b: Int b = 3 })
v(val b: Int) INIT: in: {} out: {b=D}
r(3) -> <v0> INIT: in: {b=D} out: {b=D} USE: in: {b=ONLY_WRITTEN_NEVER_READ} out: {b=ONLY_WRITTEN_NEVER_READ}
w(b|<v0>) INIT: in: {b=D} out: {b=ID} USE: in: {} out: {b=ONLY_WRITTEN_NEVER_READ}
L1:
1 <END> INIT: in: {} out: {}
error:
<ERROR>
sink:
<SINK> USE: in: {} out: {}
=====================
== use ==
fun use(a: Int) = a
---------------------
L0:
1 <START> INIT: in: {} out: {}
v(a: Int) INIT: in: {} out: {}
magic[FAKE_INITIALIZER](a: Int) -> <v0> INIT: in: {} out: {}
w(a|<v0>) INIT: in: {} out: {}
r(a) -> <v1> INIT: in: {} out: {}
ret(*|<v1>) L1
L1:
<END>
error:
<ERROR>
sink:
<SINK> USE: in: {} out: {}
=====================