[K/N] Move special backend checks test sources to diagnostic tests folder
^KT-61564
This commit is contained in:
committed by
Space Team
parent
3d0a91bf3c
commit
8f12bf6cc8
+30
@@ -0,0 +1,30 @@
|
||||
import kotlinx.cinterop.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
open class EmptyContinuation(override val context: CoroutineContext = EmptyCoroutineContext) : Continuation<Any?> {
|
||||
companion object : EmptyContinuation()
|
||||
override fun resumeWith(result: Result<Any?>) { result.getOrThrow() }
|
||||
}
|
||||
|
||||
lateinit var continuation: Continuation<Unit>
|
||||
|
||||
suspend fun suspendHere(): Unit = suspendCoroutine { cont ->
|
||||
continuation = cont
|
||||
}
|
||||
|
||||
|
||||
fun startCoroutine(block: suspend () -> Unit) {
|
||||
block.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
fun main() {
|
||||
autoreleasepool {
|
||||
startCoroutine {
|
||||
autoreleasepool {
|
||||
suspendHere()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
continuation.resume(Unit)
|
||||
}
|
||||
Reference in New Issue
Block a user