From 2b436b493c59b1beaeb11a375e4b0db6b314c3d0 Mon Sep 17 00:00:00 2001 From: Roman Artemev Date: Tue, 11 Dec 2018 16:10:41 +0300 Subject: [PATCH] Move test from js to common part --- .../coroutines/inlineSuspendLambdaNonLocalReturn.kt | 12 ++++++++---- .../kotlin/codegen/BlackBoxCodegenTestGenerated.java | 10 ++++++++++ .../codegen/LightAnalysisModeTestGenerated.java | 10 ++++++++++ .../codegen/ir/IrBlackBoxCodegenTestGenerated.java | 10 ++++++++++ .../kotlin/js/test/semantics/BoxJsTestGenerated.java | 5 ----- .../js/test/semantics/IrBoxJsTestGenerated.java | 5 ----- .../test/semantics/IrJsCodegenBoxTestGenerated.java | 5 +++++ .../js/test/semantics/JsCodegenBoxTestGenerated.java | 10 ++++++++++ 8 files changed, 53 insertions(+), 14 deletions(-) rename js/js.translator/testData/box/coroutines/inlineLambdaNonLocalReturn.kt => compiler/testData/codegen/box/coroutines/inlineSuspendLambdaNonLocalReturn.kt (60%) diff --git a/js/js.translator/testData/box/coroutines/inlineLambdaNonLocalReturn.kt b/compiler/testData/codegen/box/coroutines/inlineSuspendLambdaNonLocalReturn.kt similarity index 60% rename from js/js.translator/testData/box/coroutines/inlineLambdaNonLocalReturn.kt rename to compiler/testData/codegen/box/coroutines/inlineSuspendLambdaNonLocalReturn.kt index 9371102f2b6..e94504b9b91 100644 --- a/js/js.translator/testData/box/coroutines/inlineLambdaNonLocalReturn.kt +++ b/compiler/testData/codegen/box/coroutines/inlineSuspendLambdaNonLocalReturn.kt @@ -1,7 +1,11 @@ -// EXPECTED_REACHABLE_NODES: 1305 // IGNORE_BACKEND: JS_IR - -import kotlin.coroutines.* +// IGNORE_BACKEND: JVM_IR +// WITH_RUNTIME +// WITH_COROUTINES +// COMMON_COROUTINES_TEST +import helpers.* +import COROUTINES_PACKAGE.* +import COROUTINES_PACKAGE.intrinsics.* suspend inline fun doTwice(block: suspend () -> Unit) { block() @@ -11,7 +15,7 @@ suspend inline fun doTwice(block: suspend () -> Unit) { var testResult: String = "" fun build(c: suspend () -> Unit) { - c.startCoroutine(Continuation(EmptyCoroutineContext) { }) + c.startCoroutine(EmptyContinuation) } fun box(): String { diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index 3ab7fd4ef69..e5d59a8e078 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -5791,6 +5791,16 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineSuspendFunction.kt", "kotlin.coroutines"); } + @TestMetadata("inlineSuspendLambdaNonLocalReturn.kt") + public void testInlineSuspendLambdaNonLocalReturn_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineSuspendLambdaNonLocalReturn.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("inlineSuspendLambdaNonLocalReturn.kt") + public void testInlineSuspendLambdaNonLocalReturn_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineSuspendLambdaNonLocalReturn.kt", "kotlin.coroutines"); + } + @TestMetadata("inlinedTryCatchFinally.kt") public void testInlinedTryCatchFinally_1_2() throws Exception { runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlinedTryCatchFinally.kt", "kotlin.coroutines.experimental"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index eb6e477b4c0..0f9134fee24 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -5791,6 +5791,16 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineSuspendFunction.kt", "kotlin.coroutines"); } + @TestMetadata("inlineSuspendLambdaNonLocalReturn.kt") + public void testInlineSuspendLambdaNonLocalReturn_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineSuspendLambdaNonLocalReturn.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("inlineSuspendLambdaNonLocalReturn.kt") + public void testInlineSuspendLambdaNonLocalReturn_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineSuspendLambdaNonLocalReturn.kt", "kotlin.coroutines"); + } + @TestMetadata("inlinedTryCatchFinally.kt") public void testInlinedTryCatchFinally_1_2() throws Exception { runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlinedTryCatchFinally.kt", "kotlin.coroutines.experimental"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index 63eb43fcb32..0b5b339df28 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -5791,6 +5791,16 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineSuspendFunction.kt", "kotlin.coroutines"); } + @TestMetadata("inlineSuspendLambdaNonLocalReturn.kt") + public void testInlineSuspendLambdaNonLocalReturn_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineSuspendLambdaNonLocalReturn.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("inlineSuspendLambdaNonLocalReturn.kt") + public void testInlineSuspendLambdaNonLocalReturn_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineSuspendLambdaNonLocalReturn.kt", "kotlin.coroutines"); + } + @TestMetadata("inlinedTryCatchFinally.kt") public void testInlinedTryCatchFinally_1_2() throws Exception { runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlinedTryCatchFinally.kt", "kotlin.coroutines.experimental"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/BoxJsTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/BoxJsTestGenerated.java index 30dba06f274..f8ca79c8a40 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/BoxJsTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/BoxJsTestGenerated.java @@ -893,11 +893,6 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest { runTest("js/js.translator/testData/box/coroutines/debugStatement.kt"); } - @TestMetadata("inlineLambdaNonLocalReturn.kt") - public void testInlineLambdaNonLocalReturn() throws Exception { - runTest("js/js.translator/testData/box/coroutines/inlineLambdaNonLocalReturn.kt"); - } - @TestMetadata("localVarOptimization.kt") public void testLocalVarOptimization() throws Exception { runTest("js/js.translator/testData/box/coroutines/localVarOptimization.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrBoxJsTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrBoxJsTestGenerated.java index 183e8f076f6..392a5215c6c 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrBoxJsTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrBoxJsTestGenerated.java @@ -893,11 +893,6 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest { runTest("js/js.translator/testData/box/coroutines/debugStatement.kt"); } - @TestMetadata("inlineLambdaNonLocalReturn.kt") - public void testInlineLambdaNonLocalReturn() throws Exception { - runTest("js/js.translator/testData/box/coroutines/inlineLambdaNonLocalReturn.kt"); - } - @TestMetadata("localVarOptimization.kt") public void testLocalVarOptimization() throws Exception { runTest("js/js.translator/testData/box/coroutines/localVarOptimization.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 6a3a8b7b8cf..08a97929716 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 @@ -5286,6 +5286,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineSuspendFunction.kt", "kotlin.coroutines"); } + @TestMetadata("inlineSuspendLambdaNonLocalReturn.kt") + public void testInlineSuspendLambdaNonLocalReturn_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineSuspendLambdaNonLocalReturn.kt", "kotlin.coroutines"); + } + @TestMetadata("inlinedTryCatchFinally.kt") public void testInlinedTryCatchFinally_1_3() throws Exception { runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlinedTryCatchFinally.kt", "kotlin.coroutines"); 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 d3e3840b59f..a31dc17fe81 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 @@ -5446,6 +5446,16 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineSuspendFunction.kt", "kotlin.coroutines"); } + @TestMetadata("inlineSuspendLambdaNonLocalReturn.kt") + public void testInlineSuspendLambdaNonLocalReturn_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineSuspendLambdaNonLocalReturn.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("inlineSuspendLambdaNonLocalReturn.kt") + public void testInlineSuspendLambdaNonLocalReturn_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlineSuspendLambdaNonLocalReturn.kt", "kotlin.coroutines"); + } + @TestMetadata("inlinedTryCatchFinally.kt") public void testInlinedTryCatchFinally_1_2() throws Exception { runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/inlinedTryCatchFinally.kt", "kotlin.coroutines.experimental");