diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt index e5e8f2465e6..b6b0a9188ed 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt @@ -1600,7 +1600,7 @@ internal class CodeGeneratorVisitor(val context: Context, val lifetimes: Map input.toString() +@Test fun runTest1() { + withWorker { + val future = execute(TransferMode.SAFE, { 42 }) { input -> + input.toString() + } + future.consume { result -> + println("Got $result") + } } - future.consume { - result -> println("Got $result") - } - worker.requestTermination().result println("OK") +} + +var int1 = 1 +val int2 = 77 + +@Test fun runTest2() { + int1++ + withWorker { + executeAfter(0, { + assertFailsWith { + int1++ + } + assertEquals(2, int1) + assertEquals(77, int2) + }.freeze()) + } } \ No newline at end of file