Files
kotlin-fork/compiler/testData/ir/irText/expressions/badBreakContinue.kt
T
Vladimir Sukharev 3aa6c9e74d [K/N] Run irText tests for K1/Native
^KT-58240
2023-09-05 11:42:45 +00:00

35 lines
667 B
Kotlin
Vendored

// IGNORE_BACKEND_K2: JVM_IR
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// !IGNORE_ERRORS
// DIAGNOSTICS: -BREAK_OR_CONTINUE_OUTSIDE_A_LOOP -NOT_A_LOOP_LABEL -UNRESOLVED_REFERENCE -BREAK_OR_CONTINUE_JUMPS_ACROSS_FUNCTION_BOUNDARY
// KT-61141: java.lang.RuntimeException: Loop not found for break expression: break
// IGNORE_BACKEND: NATIVE
fun test1() {
break
continue
}
fun test2() {
L1@ while (true) {
break@ERROR
continue@ERROR
}
}
fun test3() {
L1@ while (true) {
val lambda = {
break@L1
continue@L1
}
}
}
fun test4() {
while (break) {}
while (continue) {}
}