blob: f3fd811180579e65e9b28b22aae99518caf55362 [file]
// Check that local variables for inline functions and inline default lambdas start
// after they are initialized.
// NO_CHECK_LAMBDA_INLINING
// FILE: lib.kt
inline fun spray() {
val a = Any()
val b = Any()
val c = Any()
val d = Any()
val e = Any()
}
inline fun f(block: () -> String = { "OK" }): String = block()
// FILE: main.kt
fun box(): String {
// On the JVM, this call adds some locals with reference types to the LVT
// which end after the call returns.
spray()
// When inlining `f` we'll reuse the same slots that previously contained
// locals with reference types for the $i$f$f and $i$a$-f-... variables.
// Since these locals have integer types D8 would produce a warning if they
// started before being initialized, which would cause the test to fail.
return f()
}