blob: a0a6698fc5f58513c4229c3bd597cc5ac9ad95f7 [file]
// CHECK_LABELS_COUNT: function=test0 count=0
// CHECK_LABELS_COUNT: function=test2 count=0
// FILE: lib.kt
package foo
import kotlin.test.*
class Foo {
inline fun iter(body: ()->Boolean) {
for (i in 0 .. 10) {
if (!body()) break
}
}
}
// FILE: main.kt
package foo
import kotlin.test.*
fun <R> myRun(f: () -> R) = f()
fun test0() {
val a = aa@ 1
assertEquals(1, a)
assertEquals(3, l1@ a + l2@ 2)
val b = bb@ if (true) t@ "then block" else e@ "else block"
assertEquals("then block", b)
}
fun test1() {
run label@ {
return@label false
}
}
fun test2() {
myRun label@ {
return@label false
}
}
// KT-7487
public fun test3() {
val f = Foo()
f.iter label@ {
return@label false
}
}
fun box(): String {
test0()
test1()
test2()
test3()
return "OK"
}