From 6a860dd04240b7511f48fea7bd7b15a317c702fa Mon Sep 17 00:00:00 2001 From: Mikhail Zarechenskiy Date: Mon, 24 Sep 2018 07:55:05 +0300 Subject: [PATCH] Fix blackbox codegen tests that use coroutine inference Note that previously we implicitly ignored JS_IR backend when directive COMMON_COROUTINES_TEST was enabled, see kotlin/generators/util/coroutines.kt#L57 --- ...Merge.kt => asyncIteratorNullMerge_1_2.kt} | 9 +- .../coroutines/asyncIteratorNullMerge_1_3.kt | 141 ++++++++++++++++++ ...orToList.kt => asyncIteratorToList_1_2.kt} | 9 +- .../box/coroutines/asyncIteratorToList_1_3.kt | 136 +++++++++++++++++ ...{asyncIterator.kt => asyncIterator_1_2.kt} | 9 +- .../box/coroutines/asyncIterator_1_3.kt | 130 ++++++++++++++++ .../codegen/BlackBoxCodegenTestGenerated.java | 24 +-- .../LightAnalysisModeTestGenerated.java | 24 +-- .../ir/IrBlackBoxCodegenTestGenerated.java | 24 +-- .../IrJsCodegenBoxTestGenerated.java | 27 +++- .../semantics/JsCodegenBoxTestGenerated.java | 24 +-- 11 files changed, 491 insertions(+), 66 deletions(-) rename compiler/testData/codegen/box/coroutines/{asyncIteratorNullMerge.kt => asyncIteratorNullMerge_1_2.kt} (95%) create mode 100644 compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge_1_3.kt rename compiler/testData/codegen/box/coroutines/{asyncIteratorToList.kt => asyncIteratorToList_1_2.kt} (94%) create mode 100644 compiler/testData/codegen/box/coroutines/asyncIteratorToList_1_3.kt rename compiler/testData/codegen/box/coroutines/{asyncIterator.kt => asyncIterator_1_2.kt} (94%) create mode 100644 compiler/testData/codegen/box/coroutines/asyncIterator_1_3.kt diff --git a/compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt b/compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge_1_2.kt similarity index 95% rename from compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt rename to compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge_1_2.kt index 59251a2cf05..5d0c9ba4c34 100644 --- a/compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt +++ b/compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge_1_2.kt @@ -1,10 +1,11 @@ -// IGNORE_BACKEND: JVM_IR +// !LANGUAGE: -ReleaseCoroutines -ExperimentalBuilderInference +// IGNORE_BACKEND: JVM_IR, JS_IR // WITH_RUNTIME // WITH_COROUTINES -// COMMON_COROUTINES_TEST + import helpers.* -import COROUTINES_PACKAGE.* -import COROUTINES_PACKAGE.intrinsics.* +import kotlin.coroutines.experimental.* +import kotlin.coroutines.experimental.intrinsics.* interface AsyncGenerator { suspend fun yield(value: T) diff --git a/compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge_1_3.kt b/compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge_1_3.kt new file mode 100644 index 00000000000..8d28e36856d --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge_1_3.kt @@ -0,0 +1,141 @@ +// !LANGUAGE: +ReleaseCoroutines +ExperimentalBuilderInference +// IGNORE_BACKEND: JVM_IR +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import kotlin.coroutines.* +import kotlin.coroutines.intrinsics.* +import kotlin.experimental.ExperimentalTypeInference + +interface AsyncGenerator { + suspend fun yield(value: T) +} + +interface AsyncSequence { + operator fun iterator(): AsyncIterator +} + +interface AsyncIterator { + operator suspend fun hasNext(): Boolean + operator suspend fun next(): T +} + +@UseExperimental(ExperimentalTypeInference::class) +fun asyncGenerate(@BuilderInference block: suspend AsyncGenerator.() -> Unit): AsyncSequence = object : AsyncSequence { + override fun iterator(): AsyncIterator { + val iterator = AsyncGeneratorIterator() + iterator.nextStep = block.createCoroutine(receiver = iterator, completion = iterator) + return iterator + } +} + +class AsyncGeneratorIterator: AsyncIterator, AsyncGenerator, ContinuationAdapter() { + var computedNext = false + var nextValue: T? = null + var nextStep: Continuation? = null + + // if (computesNext) computeContinuation is Continuation + // if (!computesNext) computeContinuation is Continuation + var computesNext = false + var computeContinuation: Continuation<*>? = null + + override val context = EmptyCoroutineContext + + suspend fun computeHasNext(): Boolean = suspendCoroutineUninterceptedOrReturn { c -> + computesNext = false + computeContinuation = c + nextStep!!.resume(Unit) + COROUTINE_SUSPENDED + } + + suspend fun computeNext(): T = suspendCoroutineUninterceptedOrReturn { c -> + computesNext = true + computeContinuation = c + nextStep!!.resume(Unit) + COROUTINE_SUSPENDED + } + + @Suppress("UNCHECKED_CAST") + fun resumeIterator(exception: Throwable?) { + if (exception != null) { + done() + computeContinuation!!.resumeWithException(exception) + return + } + if (computesNext) { + computedNext = false + (computeContinuation as Continuation).resume(nextValue as T) + } else { + (computeContinuation as Continuation).resume(nextStep != null) + } + } + + override suspend fun hasNext(): Boolean { + if (!computedNext) return computeHasNext() + return nextStep != null + } + + override suspend fun next(): T { + if (!computedNext) return computeNext() + computedNext = false + return nextValue as T + } + + private fun done() { + computedNext = true + nextStep = null + } + + // Completion continuation implementation + override fun resume(value: Unit) { + done() + resumeIterator(null) + } + + override fun resumeWithException(exception: Throwable) { + done() + resumeIterator(exception) + } + + // Generator implementation + override suspend fun yield(value: T): Unit = suspendCoroutineUninterceptedOrReturn { c -> + computedNext = true + nextValue = value + nextStep = c + resumeIterator(null) + COROUTINE_SUSPENDED + } +} + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +fun cst(a: Any?): String? = a as String? +fun any(a: Any?): Any? = a + +fun box(): String { + val seq = asyncGenerate { + yield("O") + yield("K") + } + + var res = "" + + builder { + // type of `prev` should be j/l/Object everywhere (even in a expected type position) + var prev: Any? = null + for (i in seq) { + res += i + prev = any(res) + // merge of NULL_VALUE and j/l/Object should result in common j/l/Object value + // but it was NULL_VALUE and we do not spill null values, we just put + // ACONST_NULL after suspension point instead + } + + res = cst(prev) ?: "fail 1" + } + + return res +} diff --git a/compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt b/compiler/testData/codegen/box/coroutines/asyncIteratorToList_1_2.kt similarity index 94% rename from compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt rename to compiler/testData/codegen/box/coroutines/asyncIteratorToList_1_2.kt index 0f1f1af6f80..9e3e774a5bb 100644 --- a/compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt +++ b/compiler/testData/codegen/box/coroutines/asyncIteratorToList_1_2.kt @@ -1,10 +1,11 @@ -// IGNORE_BACKEND: JVM_IR +// !LANGUAGE: -ReleaseCoroutines -ExperimentalBuilderInference +// IGNORE_BACKEND: JVM_IR, JS_IR // WITH_RUNTIME // WITH_COROUTINES -// COMMON_COROUTINES_TEST + import helpers.* -import COROUTINES_PACKAGE.* -import COROUTINES_PACKAGE.intrinsics.* +import kotlin.coroutines.experimental.* +import kotlin.coroutines.experimental.intrinsics.* interface AsyncGenerator { suspend fun yield(value: T) diff --git a/compiler/testData/codegen/box/coroutines/asyncIteratorToList_1_3.kt b/compiler/testData/codegen/box/coroutines/asyncIteratorToList_1_3.kt new file mode 100644 index 00000000000..d79cb482811 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/asyncIteratorToList_1_3.kt @@ -0,0 +1,136 @@ +// !LANGUAGE: +ReleaseCoroutines +ExperimentalBuilderInference +// IGNORE_BACKEND: JVM_IR +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import kotlin.coroutines.* +import kotlin.coroutines.intrinsics.* +import kotlin.experimental.ExperimentalTypeInference + +interface AsyncGenerator { + suspend fun yield(value: T) +} + +interface AsyncSequence { + operator fun iterator(): AsyncIterator +} + +interface AsyncIterator { + operator suspend fun hasNext(): Boolean + operator suspend fun next(): T +} + +@UseExperimental(ExperimentalTypeInference::class) +fun asyncGenerate(@BuilderInference block: suspend AsyncGenerator.() -> Unit): AsyncSequence = object : AsyncSequence { + override fun iterator(): AsyncIterator { + val iterator = AsyncGeneratorIterator() + iterator.nextStep = block.createCoroutine(receiver = iterator, completion = iterator) + return iterator + } +} + +class AsyncGeneratorIterator: AsyncIterator, AsyncGenerator, ContinuationAdapter() { + var computedNext = false + var nextValue: T? = null + var nextStep: Continuation? = null + + // if (computesNext) computeContinuation is Continuation + // if (!computesNext) computeContinuation is Continuation + var computesNext = false + var computeContinuation: Continuation<*>? = null + + override val context = EmptyCoroutineContext + + suspend fun computeHasNext(): Boolean = suspendCoroutineUninterceptedOrReturn { c -> + computesNext = false + computeContinuation = c + nextStep!!.resume(Unit) + COROUTINE_SUSPENDED + } + + suspend fun computeNext(): T = suspendCoroutineUninterceptedOrReturn { c -> + computesNext = true + computeContinuation = c + nextStep!!.resume(Unit) + COROUTINE_SUSPENDED + } + + @Suppress("UNCHECKED_CAST") + fun resumeIterator(exception: Throwable?) { + if (exception != null) { + done() + computeContinuation!!.resumeWithException(exception) + return + } + if (computesNext) { + computedNext = false + (computeContinuation as Continuation).resume(nextValue as T) + } else { + (computeContinuation as Continuation).resume(nextStep != null) + } + } + + override suspend fun hasNext(): Boolean { + if (!computedNext) return computeHasNext() + return nextStep != null + } + + override suspend fun next(): T { + if (!computedNext) return computeNext() + computedNext = false + return nextValue as T + } + + private fun done() { + computedNext = true + nextStep = null + } + + // Completion continuation implementation + override fun resume(value: Unit) { + done() + resumeIterator(null) + } + + override fun resumeWithException(exception: Throwable) { + done() + resumeIterator(exception) + } + + // Generator implementation + override suspend fun yield(value: T): Unit = suspendCoroutineUninterceptedOrReturn { c -> + computedNext = true + nextValue = value + nextStep = c + resumeIterator(null) + COROUTINE_SUSPENDED + } +} + +suspend fun AsyncSequence.toList(): List { + val out = arrayListOf() + for (e in this@toList) out += e // fails at this line + return out +} + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +fun box(): String { + val seq = asyncGenerate { + yield("O") + yield("K") + } + + var res = listOf() + + builder { + res = seq.toList() + } + + if (res.size > 2) return "fail 1: ${res.size}" + + return res[0] + res[1] +} diff --git a/compiler/testData/codegen/box/coroutines/asyncIterator.kt b/compiler/testData/codegen/box/coroutines/asyncIterator_1_2.kt similarity index 94% rename from compiler/testData/codegen/box/coroutines/asyncIterator.kt rename to compiler/testData/codegen/box/coroutines/asyncIterator_1_2.kt index 25e4ac9672e..64a0cc68858 100644 --- a/compiler/testData/codegen/box/coroutines/asyncIterator.kt +++ b/compiler/testData/codegen/box/coroutines/asyncIterator_1_2.kt @@ -1,10 +1,11 @@ -// IGNORE_BACKEND: JVM_IR +// !LANGUAGE: -ReleaseCoroutines -ExperimentalBuilderInference +// IGNORE_BACKEND: JVM_IR, JS_IR // WITH_RUNTIME // WITH_COROUTINES -// COMMON_COROUTINES_TEST + import helpers.* -import COROUTINES_PACKAGE.* -import COROUTINES_PACKAGE.intrinsics.* +import kotlin.coroutines.experimental.* +import kotlin.coroutines.experimental.intrinsics.* interface AsyncGenerator { suspend fun yield(value: T) diff --git a/compiler/testData/codegen/box/coroutines/asyncIterator_1_3.kt b/compiler/testData/codegen/box/coroutines/asyncIterator_1_3.kt new file mode 100644 index 00000000000..104fd298122 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/asyncIterator_1_3.kt @@ -0,0 +1,130 @@ +// !LANGUAGE: +ReleaseCoroutines +ExperimentalBuilderInference +// IGNORE_BACKEND: JVM_IR +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import kotlin.coroutines.* +import kotlin.coroutines.intrinsics.* +import kotlin.experimental.ExperimentalTypeInference + +interface AsyncGenerator { + suspend fun yield(value: T) +} + +interface AsyncSequence { + operator fun iterator(): AsyncIterator +} + +interface AsyncIterator { + operator suspend fun hasNext(): Boolean + operator suspend fun next(): T +} + +@UseExperimental(ExperimentalTypeInference::class) +fun asyncGenerate(@BuilderInference block: suspend AsyncGenerator.() -> Unit): AsyncSequence = object : AsyncSequence { + override fun iterator(): AsyncIterator { + val iterator = AsyncGeneratorIterator() + iterator.nextStep = block.createCoroutine(receiver = iterator, completion = iterator) + return iterator + } +} + +class AsyncGeneratorIterator: AsyncIterator, AsyncGenerator, ContinuationAdapter() { + var computedNext = false + var nextValue: T? = null + var nextStep: Continuation? = null + + // if (computesNext) computeContinuation is Continuation + // if (!computesNext) computeContinuation is Continuation + var computesNext = false + var computeContinuation: Continuation<*>? = null + + override val context = EmptyCoroutineContext + + suspend fun computeHasNext(): Boolean = suspendCoroutineUninterceptedOrReturn { c -> + computesNext = false + computeContinuation = c + nextStep!!.resume(Unit) + COROUTINE_SUSPENDED + } + + suspend fun computeNext(): T = suspendCoroutineUninterceptedOrReturn { c -> + computesNext = true + computeContinuation = c + nextStep!!.resume(Unit) + COROUTINE_SUSPENDED + } + + @Suppress("UNCHECKED_CAST") + fun resumeIterator(exception: Throwable?) { + if (exception != null) { + done() + computeContinuation!!.resumeWithException(exception) + return + } + if (computesNext) { + computedNext = false + (computeContinuation as Continuation).resume(nextValue as T) + } else { + (computeContinuation as Continuation).resume(nextStep != null) + } + } + + override suspend fun hasNext(): Boolean { + if (!computedNext) return computeHasNext() + return nextStep != null + } + + override suspend fun next(): T { + if (!computedNext) return computeNext() + computedNext = false + return nextValue as T + } + + private fun done() { + computedNext = true + nextStep = null + } + + // Completion continuation implementation + override fun resume(value: Unit) { + done() + resumeIterator(null) + } + + override fun resumeWithException(exception: Throwable) { + done() + resumeIterator(exception) + } + + // Generator implementation + override suspend fun yield(value: T): Unit = suspendCoroutineUninterceptedOrReturn { c -> + computedNext = true + nextValue = value + nextStep = c + resumeIterator(null) + COROUTINE_SUSPENDED + } +} + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +fun box(): String { + val seq = asyncGenerate { + yield("O") + yield("K") + } + + var res = "" + + builder { + for (i in seq) { + res += i + } + } + + return res +} diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index 8a4d1d032aa..b2311427bdc 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -5375,34 +5375,34 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } - @TestMetadata("asyncIteratorNullMerge.kt") + @TestMetadata("asyncIteratorNullMerge_1_2.kt") public void testAsyncIteratorNullMerge_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt", "kotlin.coroutines.experimental"); + runTest("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge_1_2.kt"); } - @TestMetadata("asyncIteratorNullMerge.kt") + @TestMetadata("asyncIteratorNullMerge_1_3.kt") public void testAsyncIteratorNullMerge_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt", "kotlin.coroutines"); + runTest("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge_1_3.kt"); } - @TestMetadata("asyncIteratorToList.kt") + @TestMetadata("asyncIteratorToList_1_2.kt") public void testAsyncIteratorToList_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt", "kotlin.coroutines.experimental"); + runTest("compiler/testData/codegen/box/coroutines/asyncIteratorToList_1_2.kt"); } - @TestMetadata("asyncIteratorToList.kt") + @TestMetadata("asyncIteratorToList_1_3.kt") public void testAsyncIteratorToList_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt", "kotlin.coroutines"); + runTest("compiler/testData/codegen/box/coroutines/asyncIteratorToList_1_3.kt"); } - @TestMetadata("asyncIterator.kt") + @TestMetadata("asyncIterator_1_2.kt") public void testAsyncIterator_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIterator.kt", "kotlin.coroutines.experimental"); + runTest("compiler/testData/codegen/box/coroutines/asyncIterator_1_2.kt"); } - @TestMetadata("asyncIterator.kt") + @TestMetadata("asyncIterator_1_3.kt") public void testAsyncIterator_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIterator.kt", "kotlin.coroutines"); + runTest("compiler/testData/codegen/box/coroutines/asyncIterator_1_3.kt"); } @TestMetadata("await.kt") diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 99d4d22a4ae..484e801bf89 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -5375,34 +5375,34 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } - @TestMetadata("asyncIteratorNullMerge.kt") + @TestMetadata("asyncIteratorNullMerge_1_2.kt") public void testAsyncIteratorNullMerge_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt", "kotlin.coroutines.experimental"); + runTest("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge_1_2.kt"); } - @TestMetadata("asyncIteratorNullMerge.kt") + @TestMetadata("asyncIteratorNullMerge_1_3.kt") public void testAsyncIteratorNullMerge_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt", "kotlin.coroutines"); + runTest("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge_1_3.kt"); } - @TestMetadata("asyncIteratorToList.kt") + @TestMetadata("asyncIteratorToList_1_2.kt") public void testAsyncIteratorToList_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt", "kotlin.coroutines.experimental"); + runTest("compiler/testData/codegen/box/coroutines/asyncIteratorToList_1_2.kt"); } - @TestMetadata("asyncIteratorToList.kt") + @TestMetadata("asyncIteratorToList_1_3.kt") public void testAsyncIteratorToList_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt", "kotlin.coroutines"); + runTest("compiler/testData/codegen/box/coroutines/asyncIteratorToList_1_3.kt"); } - @TestMetadata("asyncIterator.kt") + @TestMetadata("asyncIterator_1_2.kt") public void testAsyncIterator_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIterator.kt", "kotlin.coroutines.experimental"); + runTest("compiler/testData/codegen/box/coroutines/asyncIterator_1_2.kt"); } - @TestMetadata("asyncIterator.kt") + @TestMetadata("asyncIterator_1_3.kt") public void testAsyncIterator_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIterator.kt", "kotlin.coroutines"); + runTest("compiler/testData/codegen/box/coroutines/asyncIterator_1_3.kt"); } @TestMetadata("await.kt") diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index ba5a8521fc0..ade0e97aa5c 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -5375,34 +5375,34 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } - @TestMetadata("asyncIteratorNullMerge.kt") + @TestMetadata("asyncIteratorNullMerge_1_2.kt") public void testAsyncIteratorNullMerge_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt", "kotlin.coroutines.experimental"); + runTest("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge_1_2.kt"); } - @TestMetadata("asyncIteratorNullMerge.kt") + @TestMetadata("asyncIteratorNullMerge_1_3.kt") public void testAsyncIteratorNullMerge_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt", "kotlin.coroutines"); + runTest("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge_1_3.kt"); } - @TestMetadata("asyncIteratorToList.kt") + @TestMetadata("asyncIteratorToList_1_2.kt") public void testAsyncIteratorToList_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt", "kotlin.coroutines.experimental"); + runTest("compiler/testData/codegen/box/coroutines/asyncIteratorToList_1_2.kt"); } - @TestMetadata("asyncIteratorToList.kt") + @TestMetadata("asyncIteratorToList_1_3.kt") public void testAsyncIteratorToList_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt", "kotlin.coroutines"); + runTest("compiler/testData/codegen/box/coroutines/asyncIteratorToList_1_3.kt"); } - @TestMetadata("asyncIterator.kt") + @TestMetadata("asyncIterator_1_2.kt") public void testAsyncIterator_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIterator.kt", "kotlin.coroutines.experimental"); + runTest("compiler/testData/codegen/box/coroutines/asyncIterator_1_2.kt"); } - @TestMetadata("asyncIterator.kt") + @TestMetadata("asyncIterator_1_3.kt") public void testAsyncIterator_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIterator.kt", "kotlin.coroutines"); + runTest("compiler/testData/codegen/box/coroutines/asyncIterator_1_3.kt"); } @TestMetadata("await.kt") diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java index a81115323a2..f207c03f345 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java @@ -5085,19 +5085,34 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); } - @TestMetadata("asyncIteratorNullMerge.kt") + @TestMetadata("asyncIteratorNullMerge_1_2.kt") + public void testAsyncIteratorNullMerge_1_2() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge_1_2.kt"); + } + + @TestMetadata("asyncIteratorNullMerge_1_3.kt") public void testAsyncIteratorNullMerge_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt", "kotlin.coroutines"); + runTest("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge_1_3.kt"); } - @TestMetadata("asyncIteratorToList.kt") + @TestMetadata("asyncIteratorToList_1_2.kt") + public void testAsyncIteratorToList_1_2() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/asyncIteratorToList_1_2.kt"); + } + + @TestMetadata("asyncIteratorToList_1_3.kt") public void testAsyncIteratorToList_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt", "kotlin.coroutines"); + runTest("compiler/testData/codegen/box/coroutines/asyncIteratorToList_1_3.kt"); } - @TestMetadata("asyncIterator.kt") + @TestMetadata("asyncIterator_1_2.kt") + public void testAsyncIterator_1_2() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/asyncIterator_1_2.kt"); + } + + @TestMetadata("asyncIterator_1_3.kt") public void testAsyncIterator_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIterator.kt", "kotlin.coroutines"); + runTest("compiler/testData/codegen/box/coroutines/asyncIterator_1_3.kt"); } @TestMetadata("await.kt") diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index eec6d56d513..8b57d2308d0 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -5125,34 +5125,34 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } - @TestMetadata("asyncIteratorNullMerge.kt") + @TestMetadata("asyncIteratorNullMerge_1_2.kt") public void testAsyncIteratorNullMerge_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt", "kotlin.coroutines.experimental"); + runTest("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge_1_2.kt"); } - @TestMetadata("asyncIteratorNullMerge.kt") + @TestMetadata("asyncIteratorNullMerge_1_3.kt") public void testAsyncIteratorNullMerge_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge.kt", "kotlin.coroutines"); + runTest("compiler/testData/codegen/box/coroutines/asyncIteratorNullMerge_1_3.kt"); } - @TestMetadata("asyncIteratorToList.kt") + @TestMetadata("asyncIteratorToList_1_2.kt") public void testAsyncIteratorToList_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt", "kotlin.coroutines.experimental"); + runTest("compiler/testData/codegen/box/coroutines/asyncIteratorToList_1_2.kt"); } - @TestMetadata("asyncIteratorToList.kt") + @TestMetadata("asyncIteratorToList_1_3.kt") public void testAsyncIteratorToList_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIteratorToList.kt", "kotlin.coroutines"); + runTest("compiler/testData/codegen/box/coroutines/asyncIteratorToList_1_3.kt"); } - @TestMetadata("asyncIterator.kt") + @TestMetadata("asyncIterator_1_2.kt") public void testAsyncIterator_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIterator.kt", "kotlin.coroutines.experimental"); + runTest("compiler/testData/codegen/box/coroutines/asyncIterator_1_2.kt"); } - @TestMetadata("asyncIterator.kt") + @TestMetadata("asyncIterator_1_3.kt") public void testAsyncIterator_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/asyncIterator.kt", "kotlin.coroutines"); + runTest("compiler/testData/codegen/box/coroutines/asyncIterator_1_3.kt"); } @TestMetadata("await.kt")