From 2bfd17d8fb265a8b173ba3a1b384b271c6adeffc Mon Sep 17 00:00:00 2001 From: Ilmir Usmanov Date: Wed, 18 Sep 2019 22:17:40 +0300 Subject: [PATCH] JVM_IR: Minor. Unmute test. --- .../bridges/lambdaWithLongReceiver_ir.kt | 27 ++++++++++++ .../bridges/lambdaWithLongReceiver_ir.txt | 43 +++++++++++++++++++ .../codegen/BlackBoxCodegenTestGenerated.java | 5 +++ .../LightAnalysisModeTestGenerated.java | 5 +++ .../ir/IrBlackBoxCodegenTestGenerated.java | 5 +++ .../IrJsCodegenBoxTestGenerated.java | 5 --- .../semantics/JsCodegenBoxTestGenerated.java | 5 --- 7 files changed, 85 insertions(+), 10 deletions(-) create mode 100644 compiler/testData/codegen/box/coroutines/bridges/lambdaWithLongReceiver_ir.kt create mode 100644 compiler/testData/codegen/box/coroutines/bridges/lambdaWithLongReceiver_ir.txt diff --git a/compiler/testData/codegen/box/coroutines/bridges/lambdaWithLongReceiver_ir.kt b/compiler/testData/codegen/box/coroutines/bridges/lambdaWithLongReceiver_ir.kt new file mode 100644 index 00000000000..6c277ff0e16 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/bridges/lambdaWithLongReceiver_ir.kt @@ -0,0 +1,27 @@ +// WITH_RUNTIME +// WITH_COROUTINES +// CHECK_BYTECODE_LISTING +// TARGET_BACKEND: JVM +// IGNORE_BACKEND: JVM + +import helpers.* +import kotlin.coroutines.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +suspend fun call(c: suspend Long.() -> String): String { + return 1000L.c() +} + +fun box(): String { + var res = "" + builder { + res = call { -> + "OK$this" + } + } + if (res != "OK1000") return res + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/coroutines/bridges/lambdaWithLongReceiver_ir.txt b/compiler/testData/codegen/box/coroutines/bridges/lambdaWithLongReceiver_ir.txt new file mode 100644 index 00000000000..5f2803dad39 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/bridges/lambdaWithLongReceiver_ir.txt @@ -0,0 +1,43 @@ +@kotlin.Metadata +final class LambdaWithLongReceiver_irKt$$call$Continuation { + field label: int + @org.jetbrains.annotations.NotNull field result: java.lang.Object + public method (@org.jetbrains.annotations.Nullable p0: kotlin.coroutines.Continuation): void + public final @org.jetbrains.annotations.Nullable method invokeSuspend(@org.jetbrains.annotations.NotNull p0: java.lang.Object): java.lang.Object +} + +@kotlin.coroutines.jvm.internal.DebugMetadata +@kotlin.Metadata +final class LambdaWithLongReceiver_irKt$box$1$1 { + private field $p: long + private field label: int + inner class LambdaWithLongReceiver_irKt$box$1$1 + public method (): void + public method (@org.jetbrains.annotations.Nullable p0: kotlin.coroutines.Continuation): void + public final @org.jetbrains.annotations.NotNull method create(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): kotlin.coroutines.Continuation + public final method invoke(p0: java.lang.Object, p1: java.lang.Object): java.lang.Object + public final @org.jetbrains.annotations.Nullable method invokeSuspend(@org.jetbrains.annotations.NotNull p0: java.lang.Object): java.lang.Object +} + +@kotlin.coroutines.jvm.internal.DebugMetadata +@kotlin.Metadata +final class LambdaWithLongReceiver_irKt$box$1 { + private field $res: kotlin.jvm.internal.Ref$ObjectRef + field L$0: java.lang.Object + private field label: int + inner class LambdaWithLongReceiver_irKt$box$1 + public method (@org.jetbrains.annotations.NotNull p0: kotlin.jvm.internal.Ref$ObjectRef): void + public method (@org.jetbrains.annotations.NotNull p0: kotlin.jvm.internal.Ref$ObjectRef, @org.jetbrains.annotations.Nullable p1: kotlin.coroutines.Continuation): void + public final @org.jetbrains.annotations.NotNull method create(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): kotlin.coroutines.Continuation + public final method invoke(p0: java.lang.Object): java.lang.Object + public final @org.jetbrains.annotations.Nullable method invokeSuspend(@org.jetbrains.annotations.NotNull p0: java.lang.Object): java.lang.Object +} + +@kotlin.Metadata +public final class LambdaWithLongReceiver_irKt { + inner class LambdaWithLongReceiver_irKt$box$1 + inner class LambdaWithLongReceiver_irKt$box$1$1 + public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String + public final static method builder(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1): void + public final static @org.jetbrains.annotations.Nullable method call(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function2, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object +} diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index ce565c9f98c..abab992e723 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -6630,6 +6630,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/bridges/lambdaWithLongReceiver.kt", "kotlin.coroutines"); } + @TestMetadata("lambdaWithLongReceiver_ir.kt") + public void testLambdaWithLongReceiver_ir() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/bridges/lambdaWithLongReceiver_ir.kt"); + } + @TestMetadata("lambdaWithMultipleParameters.kt") public void testLambdaWithMultipleParameters_1_2() throws Exception { runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/bridges/lambdaWithMultipleParameters.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 ae389773767..665219d5cc9 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -6608,6 +6608,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class Bridges extends AbstractLightAnalysisModeTest { + @TestMetadata("lambdaWithLongReceiver_ir.kt") + public void ignoreLambdaWithLongReceiver_ir() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/bridges/lambdaWithLongReceiver_ir.kt"); + } + private void runTest(String testDataFilePath) throws Exception { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index 7ee37cf1eba..34dd73c2f44 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -6180,6 +6180,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/bridges/lambdaWithLongReceiver.kt", "kotlin.coroutines"); } + @TestMetadata("lambdaWithLongReceiver_ir.kt") + public void testLambdaWithLongReceiver_ir() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/bridges/lambdaWithLongReceiver_ir.kt"); + } + @TestMetadata("lambdaWithMultipleParameters.kt") public void testLambdaWithMultipleParameters_1_3() throws Exception { runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/bridges/lambdaWithMultipleParameters.kt", "kotlin.coroutines"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java index 79839c7bbf1..6965559efe7 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java @@ -6219,11 +6219,6 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithoutStateMachine.kt", "kotlin.coroutines"); } - @TestMetadata("inlineWithoutStateMachine_ir.kt") - public void testInlineWithoutStateMachine_ir() throws Exception { - runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithoutStateMachine_ir.kt"); - } - @TestMetadata("innerObjectRetransformation.kt") public void testInnerObjectRetransformation_1_3() throws Exception { runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/innerObjectRetransformation.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 7cc64d34b1c..c243f192d2d 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 @@ -7239,11 +7239,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithoutStateMachine.kt", "kotlin.coroutines"); } - @TestMetadata("inlineWithoutStateMachine_ir.kt") - public void testInlineWithoutStateMachine_ir() throws Exception { - runTest("compiler/testData/codegen/box/coroutines/tailCallOptimizations/inlineWithoutStateMachine_ir.kt"); - } - @TestMetadata("innerObjectRetransformation.kt") public void testInnerObjectRetransformation_1_2() throws Exception { runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/tailCallOptimizations/innerObjectRetransformation.kt", "kotlin.coroutines.experimental");