From 16b4342d92c024f2499093e54d2cbdbef30c9ce9 Mon Sep 17 00:00:00 2001 From: Mikhail Bogdanov Date: Tue, 19 May 2020 18:34:24 +0200 Subject: [PATCH] Add minor test for SMAP Relates to PR 3248 --- .../inlineCallInsideInlineLambda.kt | 78 +++++++++++++++++++ .../BlackBoxInlineCodegenTestGenerated.java | 5 ++ ...otlinAgainstInlineKotlinTestGenerated.java | 5 ++ .../IrBlackBoxInlineCodegenTestGenerated.java | 5 ++ ...otlinAgainstInlineKotlinTestGenerated.java | 5 ++ .../IrJsCodegenInlineTestGenerated.java | 5 ++ .../JsCodegenInlineTestGenerated.java | 5 ++ 7 files changed, 108 insertions(+) create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt diff --git a/compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt b/compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt new file mode 100644 index 00000000000..52d6d1efcd2 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt @@ -0,0 +1,78 @@ +// FILE: 1.kt + +package test + +object A { + inline fun test(s: () -> Unit) { + s() + } +} + +object B { + inline fun test2(s: () -> Unit) { + s() + } +} + +// FILE: 2.kt +// NO_CHECK_LAMBDA_INLINING +import test.* + + +fun box(): String { + var z = "fail" + + B.test2 { + { // regenerated object in inline lambda + A.test { + z = "OK" + } + }() + } + return z; +} + +// FILE: 1.smap + +// FILE: 2.smap +SMAP +2.kt +Kotlin +*S Kotlin +*F ++ 1 2.kt +_2Kt ++ 2 1.kt +test/B +*L +1#1,19:1 +13#2,2:20 +*E +*S KotlinDebug +*F ++ 1 2.kt +_2Kt +*L +9#1,2:20 +*E + +SMAP +2.kt +Kotlin +*S Kotlin +*F ++ 1 2.kt +_2Kt$box$1$1 ++ 2 1.kt +test/A +*L +1#1,19:1 +7#2,2:20 +*E +*S KotlinDebug +*F ++ 1 2.kt +_2Kt$box$1$1 +*L +11#1,2:20 +*E \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java index 005e5454e51..6729abad028 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java @@ -121,6 +121,11 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo runTest("compiler/testData/codegen/boxInline/anonymousObject/defineClass.kt"); } + @TestMetadata("inlineCallInsideInlineLambda.kt") + public void testInlineCallInsideInlineLambda() throws Exception { + runTest("compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt"); + } + @TestMetadata("kt13133.kt") public void testKt13133() throws Exception { runTest("compiler/testData/codegen/boxInline/anonymousObject/kt13133.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java index 0e0f981f0f7..6ddac88bc66 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java @@ -121,6 +121,11 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi runTest("compiler/testData/codegen/boxInline/anonymousObject/defineClass.kt"); } + @TestMetadata("inlineCallInsideInlineLambda.kt") + public void testInlineCallInsideInlineLambda() throws Exception { + runTest("compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt"); + } + @TestMetadata("kt13133.kt") public void testKt13133() throws Exception { runTest("compiler/testData/codegen/boxInline/anonymousObject/kt13133.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java index 318900de2f5..91a32638601 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java @@ -121,6 +121,11 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli runTest("compiler/testData/codegen/boxInline/anonymousObject/defineClass.kt"); } + @TestMetadata("inlineCallInsideInlineLambda.kt") + public void testInlineCallInsideInlineLambda() throws Exception { + runTest("compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt"); + } + @TestMetadata("kt13133.kt") public void testKt13133() throws Exception { runTest("compiler/testData/codegen/boxInline/anonymousObject/kt13133.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java index 82b79ca62f2..aebc49ae521 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java @@ -121,6 +121,11 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC runTest("compiler/testData/codegen/boxInline/anonymousObject/defineClass.kt"); } + @TestMetadata("inlineCallInsideInlineLambda.kt") + public void testInlineCallInsideInlineLambda() throws Exception { + runTest("compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt"); + } + @TestMetadata("kt13133.kt") public void testKt13133() throws Exception { runTest("compiler/testData/codegen/boxInline/anonymousObject/kt13133.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenInlineTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenInlineTestGenerated.java index cf724eb4638..50be5b8a4b0 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenInlineTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenInlineTestGenerated.java @@ -121,6 +121,11 @@ public class IrJsCodegenInlineTestGenerated extends AbstractIrJsCodegenInlineTes runTest("compiler/testData/codegen/boxInline/anonymousObject/defineClass.kt"); } + @TestMetadata("inlineCallInsideInlineLambda.kt") + public void testInlineCallInsideInlineLambda() throws Exception { + runTest("compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt"); + } + @TestMetadata("kt13182.kt") public void testKt13182() throws Exception { runTest("compiler/testData/codegen/boxInline/anonymousObject/kt13182.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenInlineTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenInlineTestGenerated.java index d961bbb7cac..d810b6b2278 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenInlineTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenInlineTestGenerated.java @@ -121,6 +121,11 @@ public class JsCodegenInlineTestGenerated extends AbstractJsCodegenInlineTest { runTest("compiler/testData/codegen/boxInline/anonymousObject/defineClass.kt"); } + @TestMetadata("inlineCallInsideInlineLambda.kt") + public void testInlineCallInsideInlineLambda() throws Exception { + runTest("compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt"); + } + @TestMetadata("kt13182.kt") public void testKt13182() throws Exception { runTest("compiler/testData/codegen/boxInline/anonymousObject/kt13182.kt");