diff --git a/compiler/testData/codegen/asmLike/receiverMangling/deepInline.kt b/compiler/testData/codegen/asmLike/receiverMangling/deepInline.kt index 8edfb8b505d..4e072d18ea1 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/deepInline.kt +++ b/compiler/testData/codegen/asmLike/receiverMangling/deepInline.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JVM_IR // LOCAL_VARIABLE_TABLE fun String.foo(count: Int) { diff --git a/compiler/testData/codegen/asmLike/receiverMangling/deepInlineWithLabels.kt b/compiler/testData/codegen/asmLike/receiverMangling/deepInlineWithLabels.kt index 8bc72c0aa44..72f418cfbca 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/deepInlineWithLabels.kt +++ b/compiler/testData/codegen/asmLike/receiverMangling/deepInlineWithLabels.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JVM_IR // LOCAL_VARIABLE_TABLE fun String.foo(count: Int) { diff --git a/compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_after.kt b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_after.kt index 222312d4950..81b4cc68628 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_after.kt +++ b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_after.kt @@ -1,4 +1,5 @@ // !LANGUAGE: +NewCapturedReceiverFieldNamingConvention +// IGNORE_BACKEND: JVM_IR // LOCAL_VARIABLE_TABLE fun String.foo(count: Int) { diff --git a/compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_before.kt b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_before.kt index 24a7a835f53..9c2ba05a3b3 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_before.kt +++ b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_before.kt @@ -1,4 +1,5 @@ // !LANGUAGE: -NewCapturedReceiverFieldNamingConvention +// IGNORE_BACKEND: JVM_IR // LOCAL_VARIABLE_TABLE fun String.foo(count: Int) { diff --git a/compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_after.kt b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_after.kt index 1b56d8531e3..8103f4c44d8 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_after.kt +++ b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_after.kt @@ -1,4 +1,5 @@ // !LANGUAGE: +NewCapturedReceiverFieldNamingConvention +// IGNORE_BACKEND: JVM_IR // LOCAL_VARIABLE_TABLE fun String.foo(count: Int) { diff --git a/compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_before.kt b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_before.kt index 8e5ceb6b72f..58b94db4b60 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_before.kt +++ b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_before.kt @@ -1,4 +1,5 @@ // !LANGUAGE: -NewCapturedReceiverFieldNamingConvention +// IGNORE_BACKEND: JVM_IR // LOCAL_VARIABLE_TABLE fun String.foo(count: Int) { diff --git a/compiler/testData/codegen/asmLike/receiverMangling/inlineClassCapture.kt b/compiler/testData/codegen/asmLike/receiverMangling/inlineClassCapture.kt index 1c2a657859a..b599f6f28c3 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/inlineClassCapture.kt +++ b/compiler/testData/codegen/asmLike/receiverMangling/inlineClassCapture.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JVM_IR // LOCAL_VARIABLE_TABLE class Foo { diff --git a/compiler/testData/codegen/asmLike/receiverMangling/inlineReceivers.kt b/compiler/testData/codegen/asmLike/receiverMangling/inlineReceivers.kt index df6057e85bb..7050ea35d87 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/inlineReceivers.kt +++ b/compiler/testData/codegen/asmLike/receiverMangling/inlineReceivers.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JVM_IR // LOCAL_VARIABLE_TABLE fun String.foo(count: Int) { diff --git a/compiler/testData/codegen/asmLike/receiverMangling/localFunctions.kt b/compiler/testData/codegen/asmLike/receiverMangling/localFunctions.kt index 4417cd6e4b5..bd7b6e903d5 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/localFunctions.kt +++ b/compiler/testData/codegen/asmLike/receiverMangling/localFunctions.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JVM_IR // LOCAL_VARIABLE_TABLE fun foo() { diff --git a/compiler/testData/codegen/asmLike/receiverMangling/mangledNames.kt b/compiler/testData/codegen/asmLike/receiverMangling/mangledNames.kt index 208727c3e67..2a85e32ae65 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/mangledNames.kt +++ b/compiler/testData/codegen/asmLike/receiverMangling/mangledNames.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JVM_IR // LOCAL_VARIABLE_TABLE fun foo() { diff --git a/compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_after.kt b/compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_after.kt index b69aebef1f7..1becbf4ea5d 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_after.kt +++ b/compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_after.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JVM_IR // LOCAL_VARIABLE_TABLE fun String.foo(count: Int) { diff --git a/compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_before.kt b/compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_before.kt index 8c98613f31c..dac931ab290 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_before.kt +++ b/compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_before.kt @@ -1,4 +1,5 @@ // !LANGUAGE: -NewCapturedReceiverFieldNamingConvention +// IGNORE_BACKEND: JVM_IR // LOCAL_VARIABLE_TABLE fun String.foo(count: Int) { diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor.kt b/compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor.kt index f8dbedf4f99..ead5c6f97ed 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor.kt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JVM_IR // KOTLIN_CONFIGURATION_FLAGS: +JVM.EMIT_JVM_TYPE_ANNOTATIONS // TYPE_ANNOTATIONS // IGNORE_BACKEND_FIR: JVM_IR diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/implicit.kt b/compiler/testData/codegen/asmLike/typeAnnotations/implicit.kt index 2f93862676a..148e0eaa958 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/implicit.kt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/implicit.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JVM_IR // KOTLIN_CONFIGURATION_FLAGS: +JVM.EMIT_JVM_TYPE_ANNOTATIONS // TYPE_ANNOTATIONS // IGNORE_BACKEND_FIR: JVM_IR diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/property.kt b/compiler/testData/codegen/asmLike/typeAnnotations/property.kt index d13f62aca03..c300ba01475 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/property.kt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/property.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JVM_IR // KOTLIN_CONFIGURATION_FLAGS: +JVM.EMIT_JVM_TYPE_ANNOTATIONS // TYPE_ANNOTATIONS // IGNORE_BACKEND_FIR: JVM_IR diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/ir/AbstractIrAsmLikeInstructionListingTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/ir/AbstractIrAsmLikeInstructionListingTest.kt new file mode 100644 index 00000000000..737197ddc44 --- /dev/null +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/ir/AbstractIrAsmLikeInstructionListingTest.kt @@ -0,0 +1,13 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.codegen.ir + +import org.jetbrains.kotlin.codegen.AbstractAsmLikeInstructionListingTest +import org.jetbrains.kotlin.test.TargetBackend + +abstract class AbstractIrAsmLikeInstructionListingTest : AbstractAsmLikeInstructionListingTest() { + override fun getBackend() = TargetBackend.JVM_IR +} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrAsmLikeInstructionListingTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrAsmLikeInstructionListingTestGenerated.java new file mode 100644 index 00000000000..10e79362e40 --- /dev/null +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrAsmLikeInstructionListingTestGenerated.java @@ -0,0 +1,202 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.codegen.ir; + +import com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; +import org.jetbrains.kotlin.test.KotlinTestUtils; +import org.jetbrains.kotlin.test.TargetBackend; +import org.jetbrains.kotlin.test.TestMetadata; +import org.junit.runner.RunWith; + +import java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("compiler/testData/codegen/asmLike") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class IrAsmLikeInstructionListingTestGenerated extends AbstractIrAsmLikeInstructionListingTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInAsmLike() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/asmLike"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("compiler/testData/codegen/asmLike/receiverMangling") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ReceiverMangling extends AbstractIrAsmLikeInstructionListingTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInReceiverMangling() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/asmLike/receiverMangling"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("deepInline.kt") + public void testDeepInline() throws Exception { + runTest("compiler/testData/codegen/asmLike/receiverMangling/deepInline.kt"); + } + + @TestMetadata("deepInlineWithLabels.kt") + public void testDeepInlineWithLabels() throws Exception { + runTest("compiler/testData/codegen/asmLike/receiverMangling/deepInlineWithLabels.kt"); + } + + @TestMetadata("deepNoinlineWithLabels_after.kt") + public void testDeepNoinlineWithLabels_after() throws Exception { + runTest("compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_after.kt"); + } + + @TestMetadata("deepNoinlineWithLabels_before.kt") + public void testDeepNoinlineWithLabels_before() throws Exception { + runTest("compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_before.kt"); + } + + @TestMetadata("deepNoinline_after.kt") + public void testDeepNoinline_after() throws Exception { + runTest("compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_after.kt"); + } + + @TestMetadata("deepNoinline_before.kt") + public void testDeepNoinline_before() throws Exception { + runTest("compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_before.kt"); + } + + @TestMetadata("inlineClassCapture.kt") + public void testInlineClassCapture() throws Exception { + runTest("compiler/testData/codegen/asmLike/receiverMangling/inlineClassCapture.kt"); + } + + @TestMetadata("inlineReceivers.kt") + public void testInlineReceivers() throws Exception { + runTest("compiler/testData/codegen/asmLike/receiverMangling/inlineReceivers.kt"); + } + + @TestMetadata("innerClass.kt") + public void testInnerClass() throws Exception { + runTest("compiler/testData/codegen/asmLike/receiverMangling/innerClass.kt"); + } + + @TestMetadata("localFunctions.kt") + public void testLocalFunctions() throws Exception { + runTest("compiler/testData/codegen/asmLike/receiverMangling/localFunctions.kt"); + } + + @TestMetadata("mangledNames.kt") + public void testMangledNames() throws Exception { + runTest("compiler/testData/codegen/asmLike/receiverMangling/mangledNames.kt"); + } + + @TestMetadata("nonInlineReceivers_after.kt") + public void testNonInlineReceivers_after() throws Exception { + runTest("compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_after.kt"); + } + + @TestMetadata("nonInlineReceivers_before.kt") + public void testNonInlineReceivers_before() throws Exception { + runTest("compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_before.kt"); + } + + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + runTest("compiler/testData/codegen/asmLike/receiverMangling/simple.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/asmLike/typeAnnotations") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class TypeAnnotations extends AbstractIrAsmLikeInstructionListingTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInTypeAnnotations() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/asmLike/typeAnnotations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("complex.kt") + public void testComplex() throws Exception { + runTest("compiler/testData/codegen/asmLike/typeAnnotations/complex.kt"); + } + + @TestMetadata("constructor.kt") + public void testConstructor() throws Exception { + runTest("compiler/testData/codegen/asmLike/typeAnnotations/constructor.kt"); + } + + @TestMetadata("defaultArgs.kt") + public void testDefaultArgs() throws Exception { + runTest("compiler/testData/codegen/asmLike/typeAnnotations/defaultArgs.kt"); + } + + @TestMetadata("enumClassConstructor.kt") + public void testEnumClassConstructor() throws Exception { + runTest("compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor.kt"); + } + + @TestMetadata("extension.kt") + public void testExtension() throws Exception { + runTest("compiler/testData/codegen/asmLike/typeAnnotations/extension.kt"); + } + + @TestMetadata("implicit.kt") + public void testImplicit() throws Exception { + runTest("compiler/testData/codegen/asmLike/typeAnnotations/implicit.kt"); + } + + @TestMetadata("innerClassConstructor.kt") + public void testInnerClassConstructor() throws Exception { + runTest("compiler/testData/codegen/asmLike/typeAnnotations/innerClassConstructor.kt"); + } + + @TestMetadata("jvmOverload.kt") + public void testJvmOverload() throws Exception { + runTest("compiler/testData/codegen/asmLike/typeAnnotations/jvmOverload.kt"); + } + + @TestMetadata("jvmStatic.kt") + public void testJvmStatic() throws Exception { + runTest("compiler/testData/codegen/asmLike/typeAnnotations/jvmStatic.kt"); + } + + @TestMetadata("notYetSupported.kt") + public void testNotYetSupported() throws Exception { + runTest("compiler/testData/codegen/asmLike/typeAnnotations/notYetSupported.kt"); + } + + @TestMetadata("property.kt") + public void testProperty() throws Exception { + runTest("compiler/testData/codegen/asmLike/typeAnnotations/property.kt"); + } + + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + runTest("compiler/testData/codegen/asmLike/typeAnnotations/simple.kt"); + } + + @TestMetadata("simple2Params.kt") + public void testSimple2Params() throws Exception { + runTest("compiler/testData/codegen/asmLike/typeAnnotations/simple2Params.kt"); + } + + @TestMetadata("staticNested.kt") + public void testStaticNested() throws Exception { + runTest("compiler/testData/codegen/asmLike/typeAnnotations/staticNested.kt"); + } + + @TestMetadata("syntheticAccessors.kt") + public void testSyntheticAccessors() throws Exception { + runTest("compiler/testData/codegen/asmLike/typeAnnotations/syntheticAccessors.kt"); + } + } +} diff --git a/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt b/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt index ed8a9bb04c9..17d3723f720 100644 --- a/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt +++ b/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt @@ -488,6 +488,10 @@ fun main(args: Array) { testClass { model("codegen/bytecodeText", targetBackend = TargetBackend.JVM_IR, excludeDirs = listOf("oldLanguageVersions")) } + + testClass { + model("codegen/asmLike", targetBackend = TargetBackend.JVM_IR) + } } testGroup(