diff --git a/compiler/testData/codegen/boxInline/smap/resolve/inlineComponent.1.kt b/compiler/testData/codegen/boxInline/smap/resolve/inlineComponent.1.kt new file mode 100644 index 00000000000..0a719ebdc08 --- /dev/null +++ b/compiler/testData/codegen/boxInline/smap/resolve/inlineComponent.1.kt @@ -0,0 +1,21 @@ +import zzz.* + +fun box(): String { + var (p, l) = A(1, 11) + + return if (p == 1 && l == 11) "OK" else "fail: $p" +} + +//SMAP +//inlineComponent.1.kt +//Kotlin +//*S Kotlin +//*F +//+ 1 inlineComponent.1.kt +//_DefaultPackage +//+ 2 inlineComponent.2.kt +//zzz/ZzzPackage +//*L +//1#1,21:1 +//5#2,3:22 +//*E \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/smap/resolve/inlineComponent.2.kt b/compiler/testData/codegen/boxInline/smap/resolve/inlineComponent.2.kt new file mode 100644 index 00000000000..4ee86cf2d8d --- /dev/null +++ b/compiler/testData/codegen/boxInline/smap/resolve/inlineComponent.2.kt @@ -0,0 +1,9 @@ +package zzz + +public class A(val a: Int, val b: Int) + +inline fun A.component1() = a + +inline fun A.component2() = b + +//SMAP ABSENT \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/smap/resolve/inlineIterator.1.kt b/compiler/testData/codegen/boxInline/smap/resolve/inlineIterator.1.kt new file mode 100644 index 00000000000..16cef0cbd3e --- /dev/null +++ b/compiler/testData/codegen/boxInline/smap/resolve/inlineIterator.1.kt @@ -0,0 +1,24 @@ +import zzz.* + +fun box(): String { + var p = 0 + for (i in A(5)) { + p += i + } + + return if (p == 15) "OK" else "fail: $p" +} + +//SMAP +//inlineIterator.1.kt +//Kotlin +//*S Kotlin +//*F +//+ 1 inlineIterator.1.kt +//_DefaultPackage +//+ 2 inlineIterator.2.kt +//zzz/ZzzPackage +//*L +//1#1,24:1 +//5#2:25 +//*E \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/smap/resolve/inlineIterator.2.kt b/compiler/testData/codegen/boxInline/smap/resolve/inlineIterator.2.kt new file mode 100644 index 00000000000..4fd2f073720 --- /dev/null +++ b/compiler/testData/codegen/boxInline/smap/resolve/inlineIterator.2.kt @@ -0,0 +1,7 @@ +package zzz + +public class A(val p: Int) + +inline fun A.iterator() = (1..p).iterator() + +//SMAP ABSENT \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java index 7685c57e168..0af954db084 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java @@ -742,6 +742,7 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo @TestDataPath("$PROJECT_ROOT") @InnerTestClasses({ Smap.Anonymous.class, + Smap.Resolve.class, }) @RunWith(JUnit3RunnerWithInners.class) public static class Smap extends AbstractBlackBoxInlineCodegenTest { @@ -823,6 +824,27 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo doTestMultiFileWithInlineCheck(fileName); } } + + @TestMetadata("compiler/testData/codegen/boxInline/smap/resolve") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Resolve extends AbstractBlackBoxInlineCodegenTest { + public void testAllFilesPresentInResolve() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/smap/resolve"), Pattern.compile("^(.+)\\.1.kt$"), true); + } + + @TestMetadata("inlineComponent.1.kt") + public void testInlineComponent() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/resolve/inlineComponent.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("inlineIterator.1.kt") + public void testInlineIterator() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/resolve/inlineIterator.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + } } @TestMetadata("compiler/testData/codegen/boxInline/special") diff --git a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java index 976bc3e4363..5ad4f285b79 100644 --- a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java @@ -742,6 +742,7 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi @TestDataPath("$PROJECT_ROOT") @InnerTestClasses({ Smap.Anonymous.class, + Smap.Resolve.class, }) @RunWith(JUnit3RunnerWithInners.class) public static class Smap extends AbstractCompileKotlinAgainstInlineKotlinTest { @@ -823,6 +824,27 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi doBoxTestWithInlineCheck(fileName); } } + + @TestMetadata("compiler/testData/codegen/boxInline/smap/resolve") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Resolve extends AbstractCompileKotlinAgainstInlineKotlinTest { + public void testAllFilesPresentInResolve() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/smap/resolve"), Pattern.compile("^(.+)\\.1.kt$"), true); + } + + @TestMetadata("inlineComponent.1.kt") + public void testInlineComponent() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/resolve/inlineComponent.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("inlineIterator.1.kt") + public void testInlineIterator() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/resolve/inlineIterator.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + } } @TestMetadata("compiler/testData/codegen/boxInline/special")