Files
kotlin-fork/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.kt
T
2023-03-22 15:18:17 +00:00

39 lines
645 B
Kotlin
Vendored

// IGNORE_BACKEND_K1: JS_IR
// IGNORE_BACKEND_K1: JS_IR_ES6
fun test1(c: Boolean?) {
L@ while (true) {
L2@while (c ?: break)
}
}
fun test2(c: Boolean?) {
L@ while (true) {
L2@while (c ?: continue)
}
}
fun test3(ss: List<String>?) {
L@ while (true) {
L2@for (s in ss ?: continue)
}
}
fun test4(ss: List<String>?) {
L@ while (true) {
L2@for (s in ss ?: break)
}
}
fun test5() {
var i = 0
Outer@while (true) {
++i
var j = 0
Inner@do {
++j
} while (if (j >= 3) false else break) // break@Inner
if (i == 3) break
}
}