From 1c48fb28dbc6243dfcb46a9f00d9e1db508c36e3 Mon Sep 17 00:00:00 2001 From: Ilmir Usmanov Date: Wed, 14 Apr 2021 17:47:50 +0200 Subject: [PATCH] Generate return when generating continuation class for expression body Otherwise, the function will return Unit instead of correct value. #KT-46007 Fixed --- .../FirBlackBoxCodegenTestGenerated.java | 56 +++++++++++++++++-- .../jvm/lower/AddContinuationLowering.kt | 8 ++- .../{jvmDefault.kt => jvmDefault/all.kt} | 0 .../jvmDefault/kt46007/all-compatibility.kt | 30 ++++++++++ .../jvmDefault/kt46007/all.kt | 28 ++++++++++ .../jvmDefault/kt46007/disable.kt | 28 ++++++++++ .../jvmDefault/kt46007/enable.kt | 28 ++++++++++ .../codegen/BlackBoxCodegenTestGenerated.java | 56 +++++++++++++++++-- .../IrBlackBoxCodegenTestGenerated.java | 56 +++++++++++++++++-- .../LightAnalysisModeTestGenerated.java | 56 +++++++++++++++++-- .../IrJsCodegenBoxES6TestGenerated.java | 26 +++++++++ .../IrJsCodegenBoxTestGenerated.java | 26 +++++++++ .../semantics/JsCodegenBoxTestGenerated.java | 26 +++++++++ 13 files changed, 399 insertions(+), 25 deletions(-) rename compiler/testData/codegen/box/coroutines/featureIntersection/{jvmDefault.kt => jvmDefault/all.kt} (100%) create mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/all-compatibility.kt create mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/all.kt create mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/disable.kt create mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/enable.kt diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index fca4677c2fb..2dea67bc169 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -9723,12 +9723,6 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/coroutines/featureIntersection/interfaceMethodWithBodyGeneric.kt"); } - @Test - @TestMetadata("jvmDefault.kt") - public void testJvmDefault() throws Exception { - runTest("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault.kt"); - } - @Test @TestMetadata("overrideInInlineClass.kt") public void testOverrideInInlineClass() throws Exception { @@ -9877,6 +9871,56 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT } } + @Nested + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault") + @TestDataPath("$PROJECT_ROOT") + public class JvmDefault { + @Test + @TestMetadata("all.kt") + public void testAll() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/all.kt"); + } + + @Test + public void testAllFilesPresentInJvmDefault() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Nested + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007") + @TestDataPath("$PROJECT_ROOT") + public class Kt46007 { + @Test + @TestMetadata("all.kt") + public void testAll() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/all.kt"); + } + + @Test + public void testAllFilesPresentInKt46007() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("all-compatibility.kt") + public void testAll_compatibility() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/all-compatibility.kt"); + } + + @Test + @TestMetadata("disable.kt") + public void testDisable() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/disable.kt"); + } + + @Test + @TestMetadata("enable.kt") + public void testEnable() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/enable.kt"); + } + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/AddContinuationLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/AddContinuationLowering.kt index 410e4ed2eb6..efe84944121 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/AddContinuationLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/AddContinuationLowering.kt @@ -316,8 +316,12 @@ private class AddContinuationLowering(context: JvmBackendContext) : SuspendLower function as IrAttributeContainer, flag.capturesCrossinline ) - for (statement in newFunction.body!!.statements) { - +statement + if (newFunction.body is IrExpressionBody) { + +irReturn(newFunction.body!!.statements[0] as IrExpression) + } else { + for (statement in newFunction.body!!.statements) { + +statement + } } } return result diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/all.kt similarity index 100% rename from compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault.kt rename to compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/all.kt diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/all-compatibility.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/all-compatibility.kt new file mode 100644 index 00000000000..3b66526a5a5 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/all-compatibility.kt @@ -0,0 +1,30 @@ +// WITH_RUNTIME +// !JVM_DEFAULT_MODE: all-compatibility +// TARGET_BACKEND: JVM +// IGNORE_LIGHT_ANALYSIS +// IGNORE_BACKEND: JVM +// JVM_TARGET: 1.8 + +import kotlin.coroutines.* + +class A : BlockingDoubleChain + +interface BlockingDoubleChain : BlockingBufferChain + +interface BlockingBufferChain { + suspend fun nextBuffer(): String = "OK" +} + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(Continuation(EmptyCoroutineContext) { + it.getOrThrow() + }) +} + +fun box(): String { + var res = "FAIL" + builder { + res = A().nextBuffer() + } + return res +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/all.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/all.kt new file mode 100644 index 00000000000..2963b2f5644 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/all.kt @@ -0,0 +1,28 @@ +// WITH_RUNTIME +// !JVM_DEFAULT_MODE: all +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 + +import kotlin.coroutines.* + +class A : BlockingDoubleChain + +interface BlockingDoubleChain : BlockingBufferChain + +interface BlockingBufferChain { + suspend fun nextBuffer(): String = "OK" +} + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(Continuation(EmptyCoroutineContext) { + it.getOrThrow() + }) +} + +fun box(): String { + var res = "FAIL" + builder { + res = A().nextBuffer() + } + return res +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/disable.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/disable.kt new file mode 100644 index 00000000000..c7d5e19c211 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/disable.kt @@ -0,0 +1,28 @@ +// WITH_RUNTIME +// !JVM_DEFAULT_MODE: disable +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 + +import kotlin.coroutines.* + +class A : BlockingDoubleChain + +interface BlockingDoubleChain : BlockingBufferChain + +interface BlockingBufferChain { + suspend fun nextBuffer(): String = "OK" +} + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(Continuation(EmptyCoroutineContext) { + it.getOrThrow() + }) +} + +fun box(): String { + var res = "FAIL" + builder { + res = A().nextBuffer() + } + return res +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/enable.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/enable.kt new file mode 100644 index 00000000000..0f83dabf7ba --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/enable.kt @@ -0,0 +1,28 @@ +// WITH_RUNTIME +// !JVM_DEFAULT_MODE: enable +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 + +import kotlin.coroutines.* + +class A : BlockingDoubleChain + +interface BlockingDoubleChain : BlockingBufferChain + +interface BlockingBufferChain { + suspend fun nextBuffer(): String = "OK" +} + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(Continuation(EmptyCoroutineContext) { + it.getOrThrow() + }) +} + +fun box(): String { + var res = "FAIL" + builder { + res = A().nextBuffer() + } + return res +} \ No newline at end of file diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index a17c2a228b4..d36b55ed568 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -9723,12 +9723,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/coroutines/featureIntersection/interfaceMethodWithBodyGeneric.kt"); } - @Test - @TestMetadata("jvmDefault.kt") - public void testJvmDefault() throws Exception { - runTest("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault.kt"); - } - @Test @TestMetadata("overrideInInlineClass.kt") public void testOverrideInInlineClass() throws Exception { @@ -9877,6 +9871,56 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { } } + @Nested + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault") + @TestDataPath("$PROJECT_ROOT") + public class JvmDefault { + @Test + @TestMetadata("all.kt") + public void testAll() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/all.kt"); + } + + @Test + public void testAllFilesPresentInJvmDefault() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @Nested + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007") + @TestDataPath("$PROJECT_ROOT") + public class Kt46007 { + @Test + @TestMetadata("all.kt") + public void testAll() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/all.kt"); + } + + @Test + public void testAllFilesPresentInKt46007() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @Test + @TestMetadata("all-compatibility.kt") + public void testAll_compatibility() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/all-compatibility.kt"); + } + + @Test + @TestMetadata("disable.kt") + public void testDisable() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/disable.kt"); + } + + @Test + @TestMetadata("enable.kt") + public void testEnable() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/enable.kt"); + } + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 90919a1569f..9146f54dc33 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -9723,12 +9723,6 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/coroutines/featureIntersection/interfaceMethodWithBodyGeneric.kt"); } - @Test - @TestMetadata("jvmDefault.kt") - public void testJvmDefault() throws Exception { - runTest("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault.kt"); - } - @Test @TestMetadata("overrideInInlineClass.kt") public void testOverrideInInlineClass() throws Exception { @@ -9877,6 +9871,56 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes } } + @Nested + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault") + @TestDataPath("$PROJECT_ROOT") + public class JvmDefault { + @Test + @TestMetadata("all.kt") + public void testAll() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/all.kt"); + } + + @Test + public void testAllFilesPresentInJvmDefault() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Nested + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007") + @TestDataPath("$PROJECT_ROOT") + public class Kt46007 { + @Test + @TestMetadata("all.kt") + public void testAll() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/all.kt"); + } + + @Test + public void testAllFilesPresentInKt46007() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("all-compatibility.kt") + public void testAll_compatibility() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/all-compatibility.kt"); + } + + @Test + @TestMetadata("disable.kt") + public void testDisable() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/disable.kt"); + } + + @Test + @TestMetadata("enable.kt") + public void testEnable() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/enable.kt"); + } + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 99b823dacd1..3c80c00bfa8 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -7645,11 +7645,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/coroutines/featureIntersection/interfaceMethodWithBodyGeneric.kt"); } - @TestMetadata("jvmDefault.kt") - public void testJvmDefault() throws Exception { - runTest("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault.kt"); - } - @TestMetadata("overrideInInlineClass.kt") public void testOverrideInInlineClass() throws Exception { runTest("compiler/testData/codegen/box/coroutines/featureIntersection/overrideInInlineClass.kt"); @@ -7792,6 +7787,57 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes } } + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class JvmDefault extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + @TestMetadata("all.kt") + public void testAll() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/all.kt"); + } + + public void testAllFilesPresentInJvmDefault() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Kt46007 extends AbstractLightAnalysisModeTest { + @TestMetadata("all-compatibility.kt") + public void ignoreAll_compatibility() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/all-compatibility.kt"); + } + + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + @TestMetadata("all.kt") + public void testAll() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/all.kt"); + } + + public void testAllFilesPresentInKt46007() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @TestMetadata("disable.kt") + public void testDisable() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/disable.kt"); + } + + @TestMetadata("enable.kt") + public void testEnable() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007/enable.kt"); + } + } + } + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java index 52c535d70bb..b890ab99f80 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java @@ -6951,6 +6951,32 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes } } + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class JvmDefault extends AbstractIrJsCodegenBoxES6Test { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath); + } + + public void testAllFilesPresentInJvmDefault() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Kt46007 extends AbstractIrJsCodegenBoxES6Test { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath); + } + + public void testAllFilesPresentInKt46007() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + } + } + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java index 4321fcba1ca..329de76b34c 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java @@ -6372,6 +6372,32 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { } } + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class JvmDefault extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInJvmDefault() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Kt46007 extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInKt46007() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); + } + } + } + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index 8d21c631e65..9285fec587d 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -6372,6 +6372,32 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { } } + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class JvmDefault extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInJvmDefault() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); + } + + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Kt46007 extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInKt46007() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/jvmDefault/kt46007"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); + } + } + } + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class)