diff --git a/compiler/testData/codegen/bytecodeListing/localFunction.txt b/compiler/testData/codegen/bytecodeListing/localFunction.txt deleted file mode 100644 index a071f7b3a38..00000000000 --- a/compiler/testData/codegen/bytecodeListing/localFunction.txt +++ /dev/null @@ -1,18 +0,0 @@ -@kotlin.Metadata -final class LocalFunctionKt$foo$1 { - // source: 'localFunction.kt' - enclosing method LocalFunctionKt.foo()V - public final static field INSTANCE: LocalFunctionKt$foo$1 - inner (anonymous) class LocalFunctionKt$foo$1 - static method (): void - method (): void - public synthetic bridge method invoke(): java.lang.Object - public final method invoke(): void -} - -@kotlin.Metadata -public final class LocalFunctionKt { - // source: 'localFunction.kt' - inner (anonymous) class LocalFunctionKt$foo$1 - public final static method foo(): void -} diff --git a/compiler/testData/codegen/bytecodeListing/localFunctionInInitBlock.kt b/compiler/testData/codegen/bytecodeListing/localFunctions/inInitBlock.kt similarity index 100% rename from compiler/testData/codegen/bytecodeListing/localFunctionInInitBlock.kt rename to compiler/testData/codegen/bytecodeListing/localFunctions/inInitBlock.kt diff --git a/compiler/testData/codegen/bytecodeListing/localFunctionInInitBlock.txt b/compiler/testData/codegen/bytecodeListing/localFunctions/inInitBlock.txt similarity index 88% rename from compiler/testData/codegen/bytecodeListing/localFunctionInInitBlock.txt rename to compiler/testData/codegen/bytecodeListing/localFunctions/inInitBlock.txt index eaa8cd68fec..29ab5e671b9 100644 --- a/compiler/testData/codegen/bytecodeListing/localFunctionInInitBlock.txt +++ b/compiler/testData/codegen/bytecodeListing/localFunctions/inInitBlock.txt @@ -1,6 +1,6 @@ @kotlin.Metadata final class C$1$1 { - // source: 'localFunctionInInitBlock.kt' + // source: 'inInitBlock.kt' enclosing method C$1.invoke()V public final static field INSTANCE: C$1$1 inner (anonymous) class C$1 @@ -13,7 +13,7 @@ final class C$1$1 { @kotlin.Metadata final class C$1 { - // source: 'localFunctionInInitBlock.kt' + // source: 'inInitBlock.kt' enclosing method C.(I)V public final static field INSTANCE: C$1 inner (anonymous) class C$1 @@ -26,7 +26,7 @@ final class C$1 { @kotlin.Metadata final class C$2$1 { - // source: 'localFunctionInInitBlock.kt' + // source: 'inInitBlock.kt' enclosing method C$2.invoke()V public final static field INSTANCE: C$2$1 inner (anonymous) class C$2 @@ -39,7 +39,7 @@ final class C$2$1 { @kotlin.Metadata final class C$2 { - // source: 'localFunctionInInitBlock.kt' + // source: 'inInitBlock.kt' enclosing method C.(Ljava/lang/String;)V public final static field INSTANCE: C$2 inner (anonymous) class C$2 @@ -52,7 +52,7 @@ final class C$2 { @kotlin.Metadata final class C$3$1 { - // source: 'localFunctionInInitBlock.kt' + // source: 'inInitBlock.kt' enclosing method C$3.invoke()V public final static field INSTANCE: C$3$1 inner (anonymous) class C$3 @@ -65,7 +65,7 @@ final class C$3$1 { @kotlin.Metadata final class C$3 { - // source: 'localFunctionInInitBlock.kt' + // source: 'inInitBlock.kt' enclosing method C.()V public final static field INSTANCE: C$3 inner (anonymous) class C$3 @@ -78,7 +78,7 @@ final class C$3 { @kotlin.Metadata final class C$test$1 { - // source: 'localFunctionInInitBlock.kt' + // source: 'inInitBlock.kt' enclosing method C.test()V public final static field INSTANCE: C$test$1 inner (anonymous) class C$test$1 @@ -90,7 +90,7 @@ final class C$test$1 { @kotlin.Metadata public final class C { - // source: 'localFunctionInInitBlock.kt' + // source: 'inInitBlock.kt' inner (anonymous) class C$1 inner (anonymous) class C$2 inner (anonymous) class C$3 diff --git a/compiler/testData/codegen/bytecodeListing/localFunctionInInitBlock_ir.txt b/compiler/testData/codegen/bytecodeListing/localFunctions/inInitBlock_ir.txt similarity index 93% rename from compiler/testData/codegen/bytecodeListing/localFunctionInInitBlock_ir.txt rename to compiler/testData/codegen/bytecodeListing/localFunctions/inInitBlock_ir.txt index c8c28caff51..4c40d07fc97 100644 --- a/compiler/testData/codegen/bytecodeListing/localFunctionInInitBlock_ir.txt +++ b/compiler/testData/codegen/bytecodeListing/localFunctions/inInitBlock_ir.txt @@ -1,6 +1,6 @@ @kotlin.Metadata public final class C { - // source: 'localFunctionInInitBlock.kt' + // source: 'inInitBlock.kt' public method (): void public method (@org.jetbrains.annotations.NotNull p0: java.lang.String): void public method (p0: int): void diff --git a/compiler/testData/codegen/bytecodeListing/localFunction.kt b/compiler/testData/codegen/bytecodeListing/localFunctions/simple.kt similarity index 100% rename from compiler/testData/codegen/bytecodeListing/localFunction.kt rename to compiler/testData/codegen/bytecodeListing/localFunctions/simple.kt diff --git a/compiler/testData/codegen/bytecodeListing/localFunctions/simple.txt b/compiler/testData/codegen/bytecodeListing/localFunctions/simple.txt new file mode 100644 index 00000000000..3150760b3e1 --- /dev/null +++ b/compiler/testData/codegen/bytecodeListing/localFunctions/simple.txt @@ -0,0 +1,18 @@ +@kotlin.Metadata +final class SimpleKt$foo$1 { + // source: 'simple.kt' + enclosing method SimpleKt.foo()V + public final static field INSTANCE: SimpleKt$foo$1 + inner (anonymous) class SimpleKt$foo$1 + static method (): void + method (): void + public synthetic bridge method invoke(): java.lang.Object + public final method invoke(): void +} + +@kotlin.Metadata +public final class SimpleKt { + // source: 'simple.kt' + inner (anonymous) class SimpleKt$foo$1 + public final static method foo(): void +} diff --git a/compiler/testData/codegen/bytecodeListing/localFunction_ir.txt b/compiler/testData/codegen/bytecodeListing/localFunctions/simple_ir.txt similarity index 60% rename from compiler/testData/codegen/bytecodeListing/localFunction_ir.txt rename to compiler/testData/codegen/bytecodeListing/localFunctions/simple_ir.txt index 0cc950fc7a1..948c0c9e68f 100644 --- a/compiler/testData/codegen/bytecodeListing/localFunction_ir.txt +++ b/compiler/testData/codegen/bytecodeListing/localFunctions/simple_ir.txt @@ -1,6 +1,6 @@ @kotlin.Metadata -public final class LocalFunctionKt { - // source: 'localFunction.kt' +public final class SimpleKt { + // source: 'simple.kt' private final static method foo$bar(): void public final static method foo(): void } diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/BytecodeListingTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/BytecodeListingTestGenerated.java index ee2583a1a7a..2565501b618 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/BytecodeListingTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/BytecodeListingTestGenerated.java @@ -185,16 +185,6 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest { runTest("compiler/testData/codegen/bytecodeListing/kt45934.kt"); } - @TestMetadata("localFunction.kt") - public void testLocalFunction() throws Exception { - runTest("compiler/testData/codegen/bytecodeListing/localFunction.kt"); - } - - @TestMetadata("localFunctionInInitBlock.kt") - public void testLocalFunctionInInitBlock() throws Exception { - runTest("compiler/testData/codegen/bytecodeListing/localFunctionInInitBlock.kt"); - } - @TestMetadata("noCollectionStubMethodsInInterface.kt") public void testNoCollectionStubMethodsInInterface() throws Exception { runTest("compiler/testData/codegen/bytecodeListing/noCollectionStubMethodsInInterface.kt"); @@ -1566,6 +1556,29 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest { } } + @TestMetadata("compiler/testData/codegen/bytecodeListing/localFunctions") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class LocalFunctions extends AbstractBytecodeListingTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInLocalFunctions() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeListing/localFunctions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @TestMetadata("inInitBlock.kt") + public void testInInitBlock() throws Exception { + runTest("compiler/testData/codegen/bytecodeListing/localFunctions/inInitBlock.kt"); + } + + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + runTest("compiler/testData/codegen/bytecodeListing/localFunctions/simple.kt"); + } + } + @TestMetadata("compiler/testData/codegen/bytecodeListing/main") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBytecodeListingTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBytecodeListingTestGenerated.java index 0498a1c1511..917440ea5f4 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBytecodeListingTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBytecodeListingTestGenerated.java @@ -185,16 +185,6 @@ public class IrBytecodeListingTestGenerated extends AbstractIrBytecodeListingTes runTest("compiler/testData/codegen/bytecodeListing/kt45934.kt"); } - @TestMetadata("localFunction.kt") - public void testLocalFunction() throws Exception { - runTest("compiler/testData/codegen/bytecodeListing/localFunction.kt"); - } - - @TestMetadata("localFunctionInInitBlock.kt") - public void testLocalFunctionInInitBlock() throws Exception { - runTest("compiler/testData/codegen/bytecodeListing/localFunctionInInitBlock.kt"); - } - @TestMetadata("noCollectionStubMethodsInInterface.kt") public void testNoCollectionStubMethodsInInterface() throws Exception { runTest("compiler/testData/codegen/bytecodeListing/noCollectionStubMethodsInInterface.kt"); @@ -1566,6 +1556,29 @@ public class IrBytecodeListingTestGenerated extends AbstractIrBytecodeListingTes } } + @TestMetadata("compiler/testData/codegen/bytecodeListing/localFunctions") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class LocalFunctions extends AbstractIrBytecodeListingTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInLocalFunctions() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeListing/localFunctions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("inInitBlock.kt") + public void testInInitBlock() throws Exception { + runTest("compiler/testData/codegen/bytecodeListing/localFunctions/inInitBlock.kt"); + } + + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + runTest("compiler/testData/codegen/bytecodeListing/localFunctions/simple.kt"); + } + } + @TestMetadata("compiler/testData/codegen/bytecodeListing/main") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class)