diff --git a/compiler/testData/compileKotlinAgainstKotlin/coroutines/builder.kt b/compiler/testData/compileKotlinAgainstKotlin/coroutines/builder.kt deleted file mode 100644 index 26ad3aeaeeb..00000000000 --- a/compiler/testData/compileKotlinAgainstKotlin/coroutines/builder.kt +++ /dev/null @@ -1,70 +0,0 @@ -// FILE: A.kt -// !LANGUAGE: -ReleaseCoroutines -// TODO: Unmute when automatic conversion experimental <-> release will be implemented -// IGNORE_BACKEND: JS, NATIVE, JVM_IR, JS_IR - -import kotlin.coroutines.experimental.* - -var callback: (() -> Unit)? = null -fun join() { - while (callback != null) { - val x = callback!! - callback = null - x() - } -} - -fun builder1(c: suspend () -> String): String { - var res = "FAIL" - c.startCoroutine(object : Continuation { - override val context = EmptyCoroutineContext - override fun resume(value: String) { - res = value - } - override fun resumeWithException(exception: Throwable) { - throw exception - } - }) - join() - return res -} - -fun builder2(c: suspend String.() -> String): String { - var res = "FAIL" - c.startCoroutine("O", object : Continuation { - override val context = EmptyCoroutineContext - override fun resume(value: String) { - res = value - } - override fun resumeWithException(exception: Throwable) { - throw exception - } - }) - join() - return res -} - -// FILE: B.kt - -import kotlin.coroutines.* -import kotlin.coroutines.intrinsics.* - -suspend fun ok(): String { - return o() + k() -} - -suspend fun o(): String = suspendCoroutine { continuation -> - callback = { continuation.resume("O") } -} - -suspend fun k(): String = suspendCoroutine { continuation -> - callback = { continuation.resume("K") } -} - -fun box(): String { - if (builder1(::ok) != "OK") return "FAIL 1" - if (builder1 { ok() } != "OK") return "FAIL 2" - - if (builder2 { this + k() } != "OK") return "FAIL 5" - return "OK" -} diff --git a/compiler/testData/compileKotlinAgainstKotlin/coroutines/receiver.kt b/compiler/testData/compileKotlinAgainstKotlin/coroutines/receiver.kt deleted file mode 100644 index c76be5e5be5..00000000000 --- a/compiler/testData/compileKotlinAgainstKotlin/coroutines/receiver.kt +++ /dev/null @@ -1,55 +0,0 @@ -// FILE: A.kt -// !LANGUAGE: -ReleaseCoroutines -// TODO: Unmute when automatic conversion experimental <-> release will be implemented -// IGNORE_BACKEND: JS, NATIVE, JVM_IR, JS_IR - -import kotlin.coroutines.experimental.* - -var callback: (() -> Unit)? = null -fun join() { - while (callback != null) { - val x = callback!! - callback = null - x() - } -} - -fun (suspend () -> String).builder(): String { - var res = "FAIL" - startCoroutine(object : Continuation { - override val context = EmptyCoroutineContext - override fun resume(value: String) { - res = value - } - override fun resumeWithException(exception: Throwable) { - throw exception - } - }) - - join() - - return res -} - -// FILE: B.kt - -import kotlin.coroutines.* -import kotlin.coroutines.intrinsics.* - -suspend fun ok(): String { - return o() + k() -} - -suspend fun o(): String = suspendCoroutine { continuation -> - callback = { continuation.resume("O") } -} - -suspend fun k(): String = suspendCoroutine { continuation -> - callback = { continuation.resume("K") } -} - -fun box(): String { - if ((::ok).builder() != "OK") return "FAIL 1" - if (suspend { ok() }.builder() != "OK") return "FAIL 2" - return "OK" -} diff --git a/compiler/testData/compileKotlinAgainstKotlin/coroutines/simple.kt b/compiler/testData/compileKotlinAgainstKotlin/coroutines/simple.kt deleted file mode 100644 index 63c83219549..00000000000 --- a/compiler/testData/compileKotlinAgainstKotlin/coroutines/simple.kt +++ /dev/null @@ -1,43 +0,0 @@ -// FILE: A.kt -// !LANGUAGE: -ReleaseCoroutines -// TODO: Unmute when automatic conversion experimental <-> release will be implemented -// IGNORE_BACKEND: JS, NATIVE, JVM_IR, JS_IR - -import kotlin.coroutines.experimental.* -import kotlin.coroutines.experimental.intrinsics.* - -var callback: (() -> Unit)? = null -suspend fun dummy(): String = suspendCoroutine { - callback = { it.resume("OK") } -} - -// FILE: B.kt - -import kotlin.coroutines.* -import kotlin.coroutines.intrinsics.* - -fun builder(x: suspend () -> Unit) { - x.startCoroutine(object : Continuation { - override val context: CoroutineContext = EmptyCoroutineContext - - override fun resumeWith(result: Result) { - result.getOrThrow() - } - }) - - while (callback != null) { - val x = callback!! - callback = null - x() - } -} - -fun box(): String { - var res = "fail" - - builder { - res = dummy() - } - - return res -} diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java index 22cda21521b..1b6a8e9c556 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java @@ -338,34 +338,6 @@ public class CompileKotlinAgainstKotlinTestGenerated extends AbstractCompileKotl runTest("compiler/testData/compileKotlinAgainstKotlin/unsignedTypesInAnnotations.kt"); } - @TestMetadata("compiler/testData/compileKotlinAgainstKotlin/coroutines") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Coroutines extends AbstractCompileKotlinAgainstKotlinTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInCoroutines() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileKotlinAgainstKotlin/coroutines"), Pattern.compile("^(.+)\\.kt$"), null, true); - } - - @TestMetadata("builder.kt") - public void testBuilder() throws Exception { - runTest("compiler/testData/compileKotlinAgainstKotlin/coroutines/builder.kt"); - } - - @TestMetadata("receiver.kt") - public void testReceiver() throws Exception { - runTest("compiler/testData/compileKotlinAgainstKotlin/coroutines/receiver.kt"); - } - - @TestMetadata("simple.kt") - public void testSimple() throws Exception { - runTest("compiler/testData/compileKotlinAgainstKotlin/coroutines/simple.kt"); - } - } - @TestMetadata("compiler/testData/compileKotlinAgainstKotlin/jvm8") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java index eb0bbec5b45..2e6a525e8a4 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java @@ -333,34 +333,6 @@ public class IrCompileKotlinAgainstKotlinTestGenerated extends AbstractIrCompile runTest("compiler/testData/compileKotlinAgainstKotlin/unsignedTypesInAnnotations.kt"); } - @TestMetadata("compiler/testData/compileKotlinAgainstKotlin/coroutines") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Coroutines extends AbstractIrCompileKotlinAgainstKotlinTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - - public void testAllFilesPresentInCoroutines() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileKotlinAgainstKotlin/coroutines"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); - } - - @TestMetadata("builder.kt") - public void testBuilder() throws Exception { - runTest("compiler/testData/compileKotlinAgainstKotlin/coroutines/builder.kt"); - } - - @TestMetadata("receiver.kt") - public void testReceiver() throws Exception { - runTest("compiler/testData/compileKotlinAgainstKotlin/coroutines/receiver.kt"); - } - - @TestMetadata("simple.kt") - public void testSimple() throws Exception { - runTest("compiler/testData/compileKotlinAgainstKotlin/coroutines/simple.kt"); - } - } - @TestMetadata("compiler/testData/compileKotlinAgainstKotlin/jvm8") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class)