Use tail call optimization if ARETURN has multiple sources

#KT-21977: Fixed
This commit is contained in:
Ilmir Usmanov
2018-01-09 19:19:27 +03:00
parent 5dbab2f907
commit 32a94c70e9
4 changed files with 49 additions and 6 deletions
@@ -0,0 +1,18 @@
// WITH_RUNTIME
import kotlin.coroutines.experimental.*
import kotlin.coroutines.experimental.intrinsics.*
var p: Int = 5846814
private suspend fun withoutInline() {
val c = { c: Continuation<Unit> ->
if (p > 52158) Unit else COROUTINE_SUSPENDED
}
return suspendCoroutineOrReturn(c)
}
private suspend fun withInline() {
return suspendCoroutineOrReturn { c ->
if (p > 52158) Unit else COROUTINE_SUSPENDED
}
}