Port test from K/N

This commit is contained in:
Roman Artemev
2018-09-20 19:59:12 +03:00
committed by romanart
parent a6f2af03e7
commit 24e7bafa7d
6 changed files with 77 additions and 0 deletions
@@ -0,0 +1,32 @@
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
// WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.*
import COROUTINES_PACKAGE.*
import COROUTINES_PACKAGE.intrinsics.*
suspend fun suspendHere(): String {
var z = "fail1"
suspendCoroutineUninterceptedOrReturn<Unit> { x ->
z = "OK"
x.resume(Unit)
COROUTINE_SUSPENDED
}
return z
}
fun builder(c: suspend () -> Unit) {
c.startCoroutine(EmptyContinuation)
}
fun box(): String {
var result = "fail2"
builder {
result = suspendHere()
}
return result
}