Files
kotlin-fork/compiler/testData/codegen/boxInline/suspend/stateMachine/normalInline.kt
T
Mikhael Bogdanov 6c65507f29 Mute inline tests
2018-08-02 13:19:25 +02:00

44 lines
813 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM_IR
// FILE: inlined.kt
// COMMON_COROUTINES_TEST
// WITH_RUNTIME
// WITH_COROUTINES
// NO_CHECK_LAMBDA_INLINING
suspend inline fun crossinlineMe(crossinline c: suspend () -> Unit) {
c()
c()
}
// FILE: inlineSite.kt
// COMMON_COROUTINES_TEST
import COROUTINES_PACKAGE.*
import COROUTINES_PACKAGE.intrinsics.*
import helpers.*
fun builder(c: suspend () -> Unit) {
c.startCoroutine(EmptyContinuation)
}
var i = 0;
suspend fun suspendHere() = suspendCoroutineUninterceptedOrReturn<Unit> {
i++
COROUTINE_SUSPENDED
}
fun box(): String {
builder {
crossinlineMe {
suspendHere()
suspendHere()
suspendHere()
suspendHere()
suspendHere()
}
}
if (i != 1) return "FAIL"
return "OK"
}