blob: 9edaa13b0bc58fe924aed43f48e9eb968363d329 [file]
// IGNORE_BACKEND: JVM_IR, JVM_IR_SERIALIZE
// Local inline functions are not yet supported
// FILE: lib.kt
package foo
// CHECK_LABELS_COUNT: function=test name=loop count=1
// CHECK_LABELS_COUNT: function=test name=loop_0 count=1
// CHECK_LABELS_COUNT: function=test name=loop_1 count=1
class State() {
public var value: Int = 0
}
// FILE: main.kt
package foo
import kotlin.test.*
// CHECK_LABELS_COUNT: function=test name=loop count=1
// CHECK_LABELS_COUNT: function=test name=loop_0 count=1
// CHECK_LABELS_COUNT: function=test name=loop_1 count=1
internal fun test(state: State) {
inline fun test3() {
inline fun test2() {
inline fun test1() {
loop@ for (i in 1..10) {
state.value++
if (i == 2) break@loop
}
}
loop@ for (i in 1..10) {
test1()
if (i == 2) break@loop
}
}
loop@ for (i in 1..10) {
test2()
if (i == 2) break@loop
}
}
test3()
}
fun box(): String {
val state = State()
test(state)
assertEquals(8, state.value)
return "OK"
}