Files
kotlin-fork/compiler/testData/cfg/OnlyWhileInFunctionBody.instructions
T
2012-12-18 16:00:27 +04:00

60 lines
2.7 KiB
Plaintext

== main ==
fun main() {
while(1 > 0) {
2
}
}
---------------------
L0:
<START> NEXT:[r(while(1 > 0) { 2 }) ] PREV:[]
r(while(1 > 0) {
2
}) NEXT:[r(1)] PREV:[<START>]
L2 [loop entry point]:
L5 [condition entry point]:
r(1) NEXT:[r(0)] PREV:[r(while(1 > 0) { 2 }) , jmp(L2 [loop entry point])]
r(0) NEXT:[r(>)] PREV:[r(1)]
r(>) NEXT:[r(1 > 0)] PREV:[r(0)]
r(1 > 0) NEXT:[jf(L3 [loop exit point])] PREV:[r(>)]
jf(L3 [loop exit point]) NEXT:[read (Unit), r(2)] PREV:[r(1 > 0)]
L4 [body entry point]:
r(2) NEXT:[jmp(L2 [loop entry point])] PREV:[jf(L3 [loop exit point])]
jmp(L2 [loop entry point]) NEXT:[r(1)] PREV:[r(2)]
L3 [loop exit point]:
read (Unit) NEXT:[<END>] PREV:[jf(L3 [loop exit point])]
L1:
<END> NEXT:[<SINK>] PREV:[read (Unit)]
error:
<ERROR> NEXT:[<SINK>] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<ERROR>, <END>]
=====================
== dowhile ==
fun dowhile() {
do {return}
while(1 > 0)
}
---------------------
L0:
<START> NEXT:[r(do {return} while(1 > 0)) ] PREV:[]
r(do {return}
while(1 > 0)) NEXT:[ret L1] PREV:[<START>]
L2 [loop entry point]:
L4 [body entry point]:
ret L1 NEXT:[<END>] PREV:[r(do {return} while(1 > 0)) ]
L5 [condition entry point]:
- r(1) NEXT:[r(0)] PREV:[]
- r(0) NEXT:[r(>)] PREV:[]
- r(>) NEXT:[r(1 > 0)] PREV:[]
- r(1 > 0) NEXT:[jt(L2 [loop entry point])] PREV:[]
- jt(L2 [loop entry point]) NEXT:[read (Unit), ret L1] PREV:[]
L3 [loop exit point]:
- read (Unit) NEXT:[<END>] PREV:[]
L1:
<END> NEXT:[<SINK>] PREV:[ret L1]
error:
<ERROR> NEXT:[<SINK>] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<ERROR>, <END>]
=====================