diff --git a/compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite2.1.kt b/compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite2.1.kt index c14c2f769b2..301f7b82ed3 100644 --- a/compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite2.1.kt +++ b/compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite2.1.kt @@ -6,7 +6,7 @@ fun box(): String { } -//SMAP +//SXMAP //objectOnInlineCallSite2.1.kt //Kotlin //*S Kotlin @@ -20,7 +20,7 @@ fun box(): String { //8#2,11:33 //*E // -//SMAP +//SXMAP //objectOnInlineCallSite2.2.kt //Kotlin //*S Kotlin diff --git a/compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite2.2.kt b/compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite2.2.kt index 9855a3aa0af..024ed1bc20b 100644 --- a/compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite2.2.kt +++ b/compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite2.2.kt @@ -19,7 +19,7 @@ inline fun test(): String { } //TODO SHOULD BE LESS -//SMAP +//SXMAP //objectOnInlineCallSite2.2.kt //Kotlin //*S Kotlin @@ -30,7 +30,7 @@ inline fun test(): String { //1#1,42:1 //*E // -//SMAP +//SXMAP //objectOnInlineCallSite2.2.kt //Kotlin //*S Kotlin diff --git a/compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSiteWithCapture.1.kt b/compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSiteWithCapture.1.kt new file mode 100644 index 00000000000..fba03d4b85b --- /dev/null +++ b/compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSiteWithCapture.1.kt @@ -0,0 +1,9 @@ +import builders.* +import kotlin.InlineOption.* + +fun box(): String { + return test{"OK"} +} + + +//TODO \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSiteWithCapture.2.kt b/compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSiteWithCapture.2.kt new file mode 100644 index 00000000000..a06ce0c3e24 --- /dev/null +++ b/compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSiteWithCapture.2.kt @@ -0,0 +1,21 @@ +package builders +//TODO there is a bug in asm it's skips linenumber on same line on reading bytecode +inline fun call(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) init: () -> Unit) { + "1"; return init() +} + +inline fun test(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) p: () -> String): String { + var res = "Fail" + + call { + object { + fun run () { + res = p() + } + }.run() + } + + return res +} +//TODO SHOULD BE LESS + diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java index 7f3b7dd3c79..7685c57e168 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java @@ -740,7 +740,9 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo @TestMetadata("compiler/testData/codegen/boxInline/smap") @TestDataPath("$PROJECT_ROOT") - @InnerTestClasses({Smap.Anonymous.class}) + @InnerTestClasses({ + Smap.Anonymous.class, + }) @RunWith(JUnit3RunnerWithInners.class) public static class Smap extends AbstractBlackBoxInlineCodegenTest { public void testAllFilesPresentInSmap() throws Exception { @@ -814,6 +816,12 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite2.1.kt"); doTestMultiFileWithInlineCheck(fileName); } + + @TestMetadata("objectOnInlineCallSiteWithCapture.1.kt") + public void testObjectOnInlineCallSiteWithCapture() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSiteWithCapture.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } } } diff --git a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java index 239d5a8d8ea..976bc3e4363 100644 --- a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java @@ -740,7 +740,9 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi @TestMetadata("compiler/testData/codegen/boxInline/smap") @TestDataPath("$PROJECT_ROOT") - @InnerTestClasses({Smap.Anonymous.class}) + @InnerTestClasses({ + Smap.Anonymous.class, + }) @RunWith(JUnit3RunnerWithInners.class) public static class Smap extends AbstractCompileKotlinAgainstInlineKotlinTest { public void testAllFilesPresentInSmap() throws Exception { @@ -814,6 +816,12 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite2.1.kt"); doBoxTestWithInlineCheck(fileName); } + + @TestMetadata("objectOnInlineCallSiteWithCapture.1.kt") + public void testObjectOnInlineCallSiteWithCapture() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSiteWithCapture.1.kt"); + doBoxTestWithInlineCheck(fileName); + } } }