'break' & 'continue'

This commit is contained in:
Dmitry Petrov
2016-08-24 15:32:02 +03:00
committed by Dmitry Petrov
parent 87c7b4834b
commit 03a666690b
9 changed files with 252 additions and 6 deletions
+39
View File
@@ -0,0 +1,39 @@
fun test1() {
while (true) { break }
do { break } while (true)
while (true) { continue }
do { continue } while (true)
}
fun test2() {
OUTER@while(true) {
INNER@while(true) {
break@INNER
break@OUTER
}
break@OUTER
}
OUTER@while(true) {
INNER@while(true) {
continue@INNER
continue@OUTER
}
continue@OUTER
}
}
fun test3() {
L@while(true) {
L@while(true) {
break@L
}
break@L
}
L@while(true) {
L@while(true) {
continue@L
}
continue@L
}
}
+60
View File
@@ -0,0 +1,60 @@
IrFile /breakContinue.kt
IrFunction public fun test1(): kotlin.Unit
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
WHILE operator=WHILE_LOOP
condition: CONST Boolean type=kotlin.Boolean value='true'
body: BLOCK type=<no-type> hasResult=false operator=null
BREAK loop.operator=WHILE_LOOP depth=0
DO_WHILE operator=DO_WHILE_LOOP
body: BLOCK type=<no-type> hasResult=false operator=null
BREAK loop.operator=DO_WHILE_LOOP depth=0
condition: CONST Boolean type=kotlin.Boolean value='true'
WHILE operator=WHILE_LOOP
condition: CONST Boolean type=kotlin.Boolean value='true'
body: BLOCK type=<no-type> hasResult=false operator=null
CONTINUE loop.operator=WHILE_LOOP depth=0
DO_WHILE operator=DO_WHILE_LOOP
body: BLOCK type=<no-type> hasResult=false operator=null
CONTINUE loop.operator=DO_WHILE_LOOP depth=0
condition: CONST Boolean type=kotlin.Boolean value='true'
IrFunction public fun test2(): kotlin.Unit
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
WHILE operator=WHILE_LOOP
condition: CONST Boolean type=kotlin.Boolean value='true'
body: BLOCK type=<no-type> hasResult=false operator=null
WHILE operator=WHILE_LOOP
condition: CONST Boolean type=kotlin.Boolean value='true'
body: BLOCK type=<no-type> hasResult=false operator=null
BREAK loop.operator=WHILE_LOOP depth=0
BREAK loop.operator=WHILE_LOOP depth=1
BREAK loop.operator=WHILE_LOOP depth=0
WHILE operator=WHILE_LOOP
condition: CONST Boolean type=kotlin.Boolean value='true'
body: BLOCK type=<no-type> hasResult=false operator=null
WHILE operator=WHILE_LOOP
condition: CONST Boolean type=kotlin.Boolean value='true'
body: BLOCK type=<no-type> hasResult=false operator=null
CONTINUE loop.operator=WHILE_LOOP depth=0
CONTINUE loop.operator=WHILE_LOOP depth=1
CONTINUE loop.operator=WHILE_LOOP depth=0
IrFunction public fun test3(): kotlin.Unit
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
WHILE operator=WHILE_LOOP
condition: CONST Boolean type=kotlin.Boolean value='true'
body: BLOCK type=<no-type> hasResult=false operator=null
WHILE operator=WHILE_LOOP
condition: CONST Boolean type=kotlin.Boolean value='true'
body: BLOCK type=<no-type> hasResult=false operator=null
BREAK loop.operator=WHILE_LOOP depth=0
BREAK loop.operator=WHILE_LOOP depth=0
WHILE operator=WHILE_LOOP
condition: CONST Boolean type=kotlin.Boolean value='true'
body: BLOCK type=<no-type> hasResult=false operator=null
WHILE operator=WHILE_LOOP
condition: CONST Boolean type=kotlin.Boolean value='true'
body: BLOCK type=<no-type> hasResult=false operator=null
CONTINUE loop.operator=WHILE_LOOP depth=0
CONTINUE loop.operator=WHILE_LOOP depth=0