Files
kotlin-fork/compiler/testData/ir/irText/expressions/breakContinue.txt
T
Dmitry Petrov d096f1d381 'while' and 'do-while' loop generator fixes.
Generate 'do-while' loop body as IrComposite, because variables declared
in loop body should be visible in loop condition.
Wrap 'do-while' loop in IrBlock so that variables declared in loop body
are not visible outside of the loop.

Generate 'while' and 'do-while' loops as expressions of type Unit.
2017-03-07 11:56:52 +03:00

60 lines
2.8 KiB
Plaintext
Vendored

FILE /breakContinue.kt
FUN public fun test1(): kotlin.Unit
BLOCK_BODY
WHILE label=null origin=WHILE_LOOP
condition: CONST Boolean type=kotlin.Boolean value='true'
body: BLOCK type=kotlin.Unit origin=null
BREAK label=null loop.label=null
BLOCK type=kotlin.Unit origin=null
DO_WHILE label=null origin=DO_WHILE_LOOP
body: COMPOSITE type=kotlin.Unit origin=null
BREAK label=null loop.label=null
condition: CONST Boolean type=kotlin.Boolean value='true'
WHILE label=null origin=WHILE_LOOP
condition: CONST Boolean type=kotlin.Boolean value='true'
body: BLOCK type=kotlin.Unit origin=null
CONTINUE label=null loop.label=null
BLOCK type=kotlin.Unit origin=null
DO_WHILE label=null origin=DO_WHILE_LOOP
body: COMPOSITE type=kotlin.Unit origin=null
CONTINUE label=null loop.label=null
condition: CONST Boolean type=kotlin.Boolean value='true'
FUN public fun test2(): kotlin.Unit
BLOCK_BODY
WHILE label=OUTER origin=WHILE_LOOP
condition: CONST Boolean type=kotlin.Boolean value='true'
body: BLOCK type=kotlin.Unit origin=null
WHILE label=INNER origin=WHILE_LOOP
condition: CONST Boolean type=kotlin.Boolean value='true'
body: BLOCK type=kotlin.Unit origin=null
BREAK label=INNER loop.label=INNER
BREAK label=OUTER loop.label=OUTER
BREAK label=OUTER loop.label=OUTER
WHILE label=OUTER origin=WHILE_LOOP
condition: CONST Boolean type=kotlin.Boolean value='true'
body: BLOCK type=kotlin.Unit origin=null
WHILE label=INNER origin=WHILE_LOOP
condition: CONST Boolean type=kotlin.Boolean value='true'
body: BLOCK type=kotlin.Unit origin=null
CONTINUE label=INNER loop.label=INNER
CONTINUE label=OUTER loop.label=OUTER
CONTINUE label=OUTER loop.label=OUTER
FUN public fun test3(): kotlin.Unit
BLOCK_BODY
WHILE label=L origin=WHILE_LOOP
condition: CONST Boolean type=kotlin.Boolean value='true'
body: BLOCK type=kotlin.Unit origin=null
WHILE label=L origin=WHILE_LOOP
condition: CONST Boolean type=kotlin.Boolean value='true'
body: BLOCK type=kotlin.Unit origin=null
BREAK label=L loop.label=L
BREAK label=L loop.label=L
WHILE label=L origin=WHILE_LOOP
condition: CONST Boolean type=kotlin.Boolean value='true'
body: BLOCK type=kotlin.Unit origin=null
WHILE label=L origin=WHILE_LOOP
condition: CONST Boolean type=kotlin.Boolean value='true'
body: BLOCK type=kotlin.Unit origin=null
CONTINUE label=L loop.label=L
CONTINUE label=L loop.label=L