diff --git a/compiler/testData/compileKotlinAgainstKotlin/annotationsOnTypeAliases.kt b/compiler/testData/compileKotlinAgainstKotlin/annotationsOnTypeAliases.kt index f01a7de8fe3..7d3363b3e63 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/annotationsOnTypeAliases.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/annotationsOnTypeAliases.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JVM_IR // TARGET_BACKEND: JVM // FILE: A.kt package a diff --git a/compiler/testData/compileKotlinAgainstKotlin/callDeserializedPropertyOnInlineClassType.kt b/compiler/testData/compileKotlinAgainstKotlin/callDeserializedPropertyOnInlineClassType.kt index b3978712ea0..eb026a38c78 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/callDeserializedPropertyOnInlineClassType.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/callDeserializedPropertyOnInlineClassType.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JVM_IR // FILE: A.kt package a diff --git a/compiler/testData/compileKotlinAgainstKotlin/callsToMultifileClassFromOtherPackage.kt b/compiler/testData/compileKotlinAgainstKotlin/callsToMultifileClassFromOtherPackage.kt index 3c6332d89bb..9beba374e3c 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/callsToMultifileClassFromOtherPackage.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/callsToMultifileClassFromOtherPackage.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JVM_IR // TARGET_BACKEND: JVM // FILE: A.kt diff --git a/compiler/testData/compileKotlinAgainstKotlin/constPropertyReferenceFromMultifileClass.kt b/compiler/testData/compileKotlinAgainstKotlin/constPropertyReferenceFromMultifileClass.kt index e2d7069e457..2af4b05b04e 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/constPropertyReferenceFromMultifileClass.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/constPropertyReferenceFromMultifileClass.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JVM_IR // TARGET_BACKEND: JVM // FILE: A.kt diff --git a/compiler/testData/compileKotlinAgainstKotlin/constructorWithInlineClassParametersInBinaryDependencies.kt b/compiler/testData/compileKotlinAgainstKotlin/constructorWithInlineClassParametersInBinaryDependencies.kt index 164be2e2171..e5e4dac49cc 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/constructorWithInlineClassParametersInBinaryDependencies.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/constructorWithInlineClassParametersInBinaryDependencies.kt @@ -1,4 +1,5 @@ // !LANGUAGE: +InlineClasses +// IGNORE_BACKEND: JVM_IR // FILE: A.kt package lib diff --git a/compiler/testData/compileKotlinAgainstKotlin/copySamOnInline.kt b/compiler/testData/compileKotlinAgainstKotlin/copySamOnInline.kt index a338cfa9635..e9eac54ab75 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/copySamOnInline.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/copySamOnInline.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JVM_IR // FILE: A.kt // FULL_JDK diff --git a/compiler/testData/compileKotlinAgainstKotlin/copySamOnInline2.kt b/compiler/testData/compileKotlinAgainstKotlin/copySamOnInline2.kt index 504949834ce..648ccf33bb1 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/copySamOnInline2.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/copySamOnInline2.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JVM_IR // FILE: A.kt // FULL_JDK diff --git a/compiler/testData/compileKotlinAgainstKotlin/coroutinesBinary.kt b/compiler/testData/compileKotlinAgainstKotlin/coroutinesBinary.kt index 83abd378140..900e825be2c 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/coroutinesBinary.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/coroutinesBinary.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JVM_IR // COMMON_COROUTINES_TEST // FILE: A.kt // WITH_RUNTIME diff --git a/compiler/testData/compileKotlinAgainstKotlin/defaultLambdaRegeneration.kt b/compiler/testData/compileKotlinAgainstKotlin/defaultLambdaRegeneration.kt index ab9c4ceae8e..184fbce65d5 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/defaultLambdaRegeneration.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/defaultLambdaRegeneration.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JVM_IR // TARGET_BACKEND: JVM // FILE: A.kt diff --git a/compiler/testData/compileKotlinAgainstKotlin/defaultLambdaRegeneration2.kt b/compiler/testData/compileKotlinAgainstKotlin/defaultLambdaRegeneration2.kt index c9a7910ab6a..421326450da 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/defaultLambdaRegeneration2.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/defaultLambdaRegeneration2.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JVM_IR // TARGET_BACKEND: JVM // FILE: A.kt diff --git a/compiler/testData/compileKotlinAgainstKotlin/inlineClassFromBinaryDependencies.kt b/compiler/testData/compileKotlinAgainstKotlin/inlineClassFromBinaryDependencies.kt index 89ff9b439b2..59a18e12a7b 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/inlineClassFromBinaryDependencies.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/inlineClassFromBinaryDependencies.kt @@ -1,4 +1,5 @@ // !LANGUAGE: +InlineClasses +// IGNORE_BACKEND: JVM_IR // FILE: A.kt package z diff --git a/compiler/testData/compileKotlinAgainstKotlin/inlinedConstants.kt b/compiler/testData/compileKotlinAgainstKotlin/inlinedConstants.kt index 51cb24fd65a..613da295ebe 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/inlinedConstants.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/inlinedConstants.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JVM_IR // TARGET_BACKEND: JVM // FILE: A.kt diff --git a/compiler/testData/compileKotlinAgainstKotlin/jvm8/defaults/superCall.kt b/compiler/testData/compileKotlinAgainstKotlin/jvm8/defaults/superCall.kt index 18329abfac4..874e7ed3897 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/jvm8/defaults/superCall.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/jvm8/defaults/superCall.kt @@ -1,4 +1,5 @@ // !JVM_DEFAULT_MODE: enable +// IGNORE_BACKEND: JVM_IR // JVM_TARGET: 1.8 // WITH_RUNTIME // FILE: 1.kt diff --git a/compiler/testData/compileKotlinAgainstKotlin/jvm8/defaults/superCallFromInterface.kt b/compiler/testData/compileKotlinAgainstKotlin/jvm8/defaults/superCallFromInterface.kt index 18d9fd5ad8b..c5020e7677f 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/jvm8/defaults/superCallFromInterface.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/jvm8/defaults/superCallFromInterface.kt @@ -1,4 +1,5 @@ // !JVM_DEFAULT_MODE: enable +// IGNORE_BACKEND: JVM_IR // JVM_TARGET: 1.8 // WITH_RUNTIME // FILE: 1.kt diff --git a/compiler/testData/compileKotlinAgainstKotlin/jvm8/defaults/superCallFromInterface2.kt b/compiler/testData/compileKotlinAgainstKotlin/jvm8/defaults/superCallFromInterface2.kt index 694274ca7f0..11f20fc16b6 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/jvm8/defaults/superCallFromInterface2.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/jvm8/defaults/superCallFromInterface2.kt @@ -1,4 +1,5 @@ // !JVM_DEFAULT_MODE: enable +// IGNORE_BACKEND: JVM_IR // JVM_TARGET: 1.8 // WITH_RUNTIME // FILE: 1.kt diff --git a/compiler/testData/compileKotlinAgainstKotlin/jvm8/jvm8against6/delegation/diamond.kt b/compiler/testData/compileKotlinAgainstKotlin/jvm8/jvm8against6/delegation/diamond.kt index 15e6faacc1d..69166c0a131 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/jvm8/jvm8against6/delegation/diamond.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/jvm8/jvm8against6/delegation/diamond.kt @@ -1,4 +1,5 @@ // !JVM_DEFAULT_MODE: enable +// IGNORE_BACKEND: JVM_IR // FILE: 1.kt interface Test { fun test(): String { diff --git a/compiler/testData/compileKotlinAgainstKotlin/jvm8/jvm8against6/delegation/diamond3.kt b/compiler/testData/compileKotlinAgainstKotlin/jvm8/jvm8against6/delegation/diamond3.kt index 0abbf2d98ea..6ffdcff2e57 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/jvm8/jvm8against6/delegation/diamond3.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/jvm8/jvm8against6/delegation/diamond3.kt @@ -1,4 +1,5 @@ // !JVM_DEFAULT_MODE: enable +// IGNORE_BACKEND: JVM_IR // FILE: 1.kt interface Test { fun test(): String { diff --git a/compiler/testData/compileKotlinAgainstKotlin/jvm8/jvm8against6/jdk8Against6.kt b/compiler/testData/compileKotlinAgainstKotlin/jvm8/jvm8against6/jdk8Against6.kt index a2b985bfd01..e9933b6e16c 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/jvm8/jvm8against6/jdk8Against6.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/jvm8/jvm8against6/jdk8Against6.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JVM_IR // SKIP_JDK6 // FILE: A.kt import java.util.* diff --git a/compiler/testData/compileKotlinAgainstKotlin/jvmField.kt b/compiler/testData/compileKotlinAgainstKotlin/jvmField.kt index ef858b2058b..38b82205caa 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/jvmField.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/jvmField.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JVM_IR // TARGET_BACKEND: JVM // FILE: A.kt diff --git a/compiler/testData/compileKotlinAgainstKotlin/jvmFieldInAnnotationCompanion.kt b/compiler/testData/compileKotlinAgainstKotlin/jvmFieldInAnnotationCompanion.kt index 26741f1dda1..f51034e952a 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/jvmFieldInAnnotationCompanion.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/jvmFieldInAnnotationCompanion.kt @@ -1,4 +1,5 @@ // !LANGUAGE: +JvmFieldInInterface +NestedClassesInAnnotations +// IGNORE_BACKEND: JVM_IR // TARGET_BACKEND: JVM // WITH_RUNTIME diff --git a/compiler/testData/compileKotlinAgainstKotlin/jvmFieldInConstructor.kt b/compiler/testData/compileKotlinAgainstKotlin/jvmFieldInConstructor.kt index 620e47f36b0..4bdeb0f093d 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/jvmFieldInConstructor.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/jvmFieldInConstructor.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JVM_IR // TARGET_BACKEND: JVM // FILE: A.kt diff --git a/compiler/testData/compileKotlinAgainstKotlin/jvmFieldInInterfaceCompanion.kt b/compiler/testData/compileKotlinAgainstKotlin/jvmFieldInInterfaceCompanion.kt index f99d3fec96a..28c764c8b52 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/jvmFieldInInterfaceCompanion.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/jvmFieldInInterfaceCompanion.kt @@ -1,4 +1,5 @@ // !LANGUAGE: +JvmFieldInInterface +// IGNORE_BACKEND: JVM_IR // TARGET_BACKEND: JVM // WITH_RUNTIME diff --git a/compiler/testData/compileKotlinAgainstKotlin/jvmPackageName.kt b/compiler/testData/compileKotlinAgainstKotlin/jvmPackageName.kt index 8cc09416ed6..04d3640f8a8 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/jvmPackageName.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/jvmPackageName.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JVM_IR // TARGET_BACKEND: JVM // FILE: A.kt diff --git a/compiler/testData/compileKotlinAgainstKotlin/jvmPackageNameInRootPackage.kt b/compiler/testData/compileKotlinAgainstKotlin/jvmPackageNameInRootPackage.kt index 7cf60d73870..84aed08ff9f 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/jvmPackageNameInRootPackage.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/jvmPackageNameInRootPackage.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JVM_IR // TARGET_BACKEND: JVM // FILE: A.kt diff --git a/compiler/testData/compileKotlinAgainstKotlin/jvmPackageNameWithJvmName.kt b/compiler/testData/compileKotlinAgainstKotlin/jvmPackageNameWithJvmName.kt index 29bcde0e05b..bb3c67541f3 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/jvmPackageNameWithJvmName.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/jvmPackageNameWithJvmName.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JVM_IR // TARGET_BACKEND: JVM // FILE: A.kt diff --git a/compiler/testData/compileKotlinAgainstKotlin/kotlinPropertyAsAnnotationParameter.kt b/compiler/testData/compileKotlinAgainstKotlin/kotlinPropertyAsAnnotationParameter.kt index a43165004f0..429dc5102df 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/kotlinPropertyAsAnnotationParameter.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/kotlinPropertyAsAnnotationParameter.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JVM_IR // TARGET_BACKEND: JVM // FILE: A.kt diff --git a/compiler/testData/compileKotlinAgainstKotlin/multifileClassInlineFunctionAccessingProperty.kt b/compiler/testData/compileKotlinAgainstKotlin/multifileClassInlineFunctionAccessingProperty.kt index 467db537c76..3046446e0ec 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/multifileClassInlineFunctionAccessingProperty.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/multifileClassInlineFunctionAccessingProperty.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JVM_IR // TARGET_BACKEND: JVM // FILE: A.kt diff --git a/compiler/testData/compileKotlinAgainstKotlin/optionalAnnotation.kt b/compiler/testData/compileKotlinAgainstKotlin/optionalAnnotation.kt index 9c8bebf4988..1956de7f788 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/optionalAnnotation.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/optionalAnnotation.kt @@ -1,5 +1,6 @@ // !LANGUAGE: +MultiPlatformProjects // !USE_EXPERIMENTAL: kotlin.ExperimentalMultiplatform +// IGNORE_BACKEND: JVM_IR // TARGET_BACKEND: JVM // FULL_JDK // FILE: A.kt diff --git a/compiler/testData/compileKotlinAgainstKotlin/propertyReference.kt b/compiler/testData/compileKotlinAgainstKotlin/propertyReference.kt index 35bdea51241..8c379778089 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/propertyReference.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/propertyReference.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JVM_IR // FILE: A.kt package a diff --git a/compiler/testData/compileKotlinAgainstKotlin/unsignedTypesInAnnotations.kt b/compiler/testData/compileKotlinAgainstKotlin/unsignedTypesInAnnotations.kt index d82e78d74d8..efc7911536c 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/unsignedTypesInAnnotations.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/unsignedTypesInAnnotations.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JVM_IR // IGNORE_BACKEND: NATIVE // WITH_RUNTIME diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/ir/AbstractIrCompileKotlinAgainstKotlinTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/ir/AbstractIrCompileKotlinAgainstKotlinTest.kt new file mode 100644 index 00000000000..68599f7570f --- /dev/null +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/ir/AbstractIrCompileKotlinAgainstKotlinTest.kt @@ -0,0 +1,17 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. 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.AbstractCompileKotlinAgainstKotlinTest +import org.jetbrains.kotlin.config.CompilerConfiguration +import org.jetbrains.kotlin.config.JVMConfigurationKeys +import org.jetbrains.kotlin.test.ConfigurationKind + +abstract class AbstractIrCompileKotlinAgainstKotlinTest : AbstractCompileKotlinAgainstKotlinTest() { + override fun updateConfiguration(configuration: CompilerConfiguration) = configuration.put(JVMConfigurationKeys.IR, true) + + override fun extractConfigurationKind(files: MutableList): ConfigurationKind = ConfigurationKind.ALL +} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java new file mode 100644 index 00000000000..7425fcd4aba --- /dev/null +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java @@ -0,0 +1,460 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. 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/compileKotlinAgainstKotlin") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class IrCompileKotlinAgainstKotlinTestGenerated extends AbstractIrCompileKotlinAgainstKotlinTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { + KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInCompileKotlinAgainstKotlin() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/compileKotlinAgainstKotlin"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("annotationInInterface.kt") + public void testAnnotationInInterface() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/annotationInInterface.kt"); + } + + @TestMetadata("annotationsOnTypeAliases.kt") + public void testAnnotationsOnTypeAliases() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/annotationsOnTypeAliases.kt"); + } + + @TestMetadata("callDeserializedPropertyOnInlineClassType.kt") + public void testCallDeserializedPropertyOnInlineClassType() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/callDeserializedPropertyOnInlineClassType.kt"); + } + + @TestMetadata("callsToMultifileClassFromOtherPackage.kt") + public void testCallsToMultifileClassFromOtherPackage() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/callsToMultifileClassFromOtherPackage.kt"); + } + + @TestMetadata("classInObject.kt") + public void testClassInObject() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/classInObject.kt"); + } + + @TestMetadata("companionObjectInEnum.kt") + public void testCompanionObjectInEnum() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/companionObjectInEnum.kt"); + } + + @TestMetadata("companionObjectMember.kt") + public void testCompanionObjectMember() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/companionObjectMember.kt"); + } + + @TestMetadata("constPropertyReferenceFromMultifileClass.kt") + public void testConstPropertyReferenceFromMultifileClass() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/constPropertyReferenceFromMultifileClass.kt"); + } + + @TestMetadata("constructorVararg.kt") + public void testConstructorVararg() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/constructorVararg.kt"); + } + + @TestMetadata("constructorWithInlineClassParametersInBinaryDependencies.kt") + public void testConstructorWithInlineClassParametersInBinaryDependencies() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/constructorWithInlineClassParametersInBinaryDependencies.kt"); + } + + @TestMetadata("copySamOnInline.kt") + public void testCopySamOnInline() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/copySamOnInline.kt"); + } + + @TestMetadata("copySamOnInline2.kt") + public void testCopySamOnInline2() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/copySamOnInline2.kt"); + } + + @TestMetadata("coroutinesBinary.kt") + public void testCoroutinesBinary_1_2() throws Exception { + runTestWithPackageReplacement("compiler/testData/compileKotlinAgainstKotlin/coroutinesBinary.kt", "kotlin.coroutines.experimental"); + } + + @TestMetadata("coroutinesBinary.kt") + public void testCoroutinesBinary_1_3() throws Exception { + runTestWithPackageReplacement("compiler/testData/compileKotlinAgainstKotlin/coroutinesBinary.kt", "kotlin.coroutines"); + } + + @TestMetadata("defaultConstructor.kt") + public void testDefaultConstructor() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/defaultConstructor.kt"); + } + + @TestMetadata("defaultLambdaRegeneration.kt") + public void testDefaultLambdaRegeneration() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/defaultLambdaRegeneration.kt"); + } + + @TestMetadata("defaultLambdaRegeneration2.kt") + public void testDefaultLambdaRegeneration2() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/defaultLambdaRegeneration2.kt"); + } + + @TestMetadata("doublyNestedClass.kt") + public void testDoublyNestedClass() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/doublyNestedClass.kt"); + } + + @TestMetadata("enum.kt") + public void testEnum() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/enum.kt"); + } + + @TestMetadata("inlineClassFromBinaryDependencies.kt") + public void testInlineClassFromBinaryDependencies() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassFromBinaryDependencies.kt"); + } + + @TestMetadata("inlinedConstants.kt") + public void testInlinedConstants() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/inlinedConstants.kt"); + } + + @TestMetadata("innerClassConstructor.kt") + public void testInnerClassConstructor() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/innerClassConstructor.kt"); + } + + @TestMetadata("internalSetterOverridden.kt") + public void testInternalSetterOverridden() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/internalSetterOverridden.kt"); + } + + @TestMetadata("internalWithOtherModuleName.kt") + public void testInternalWithOtherModuleName() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/internalWithOtherModuleName.kt"); + } + + @TestMetadata("jvmField.kt") + public void testJvmField() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/jvmField.kt"); + } + + @TestMetadata("jvmFieldInAnnotationCompanion.kt") + public void testJvmFieldInAnnotationCompanion() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/jvmFieldInAnnotationCompanion.kt"); + } + + @TestMetadata("jvmFieldInConstructor.kt") + public void testJvmFieldInConstructor() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/jvmFieldInConstructor.kt"); + } + + @TestMetadata("jvmFieldInInterfaceCompanion.kt") + public void testJvmFieldInInterfaceCompanion() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/jvmFieldInInterfaceCompanion.kt"); + } + + @TestMetadata("jvmNames.kt") + public void testJvmNames() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/jvmNames.kt"); + } + + @TestMetadata("jvmPackageName.kt") + public void testJvmPackageName() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/jvmPackageName.kt"); + } + + @TestMetadata("jvmPackageNameInRootPackage.kt") + public void testJvmPackageNameInRootPackage() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/jvmPackageNameInRootPackage.kt"); + } + + @TestMetadata("jvmPackageNameWithJvmName.kt") + public void testJvmPackageNameWithJvmName() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/jvmPackageNameWithJvmName.kt"); + } + + @TestMetadata("jvmStaticInObject.kt") + public void testJvmStaticInObject() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/jvmStaticInObject.kt"); + } + + @TestMetadata("kotlinPropertyAsAnnotationParameter.kt") + public void testKotlinPropertyAsAnnotationParameter() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/kotlinPropertyAsAnnotationParameter.kt"); + } + + @TestMetadata("kt14012.kt") + public void testKt14012() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/kt14012.kt"); + } + + @TestMetadata("kt14012_multi.kt") + public void testKt14012_multi() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/kt14012_multi.kt"); + } + + @TestMetadata("multifileClassInlineFunctionAccessingProperty.kt") + public void testMultifileClassInlineFunctionAccessingProperty() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/multifileClassInlineFunctionAccessingProperty.kt"); + } + + @TestMetadata("multifileClassWithTypealias.kt") + public void testMultifileClassWithTypealias() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/multifileClassWithTypealias.kt"); + } + + @TestMetadata("nestedClass.kt") + public void testNestedClass() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/nestedClass.kt"); + } + + @TestMetadata("nestedEnum.kt") + public void testNestedEnum() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/nestedEnum.kt"); + } + + @TestMetadata("nestedObject.kt") + public void testNestedObject() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/nestedObject.kt"); + } + + @TestMetadata("optionalAnnotation.kt") + public void testOptionalAnnotation() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/optionalAnnotation.kt"); + } + + @TestMetadata("platformTypes.kt") + public void testPlatformTypes() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/platformTypes.kt"); + } + + @TestMetadata("propertyReference.kt") + public void testPropertyReference() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/propertyReference.kt"); + } + + @TestMetadata("recursiveGeneric.kt") + public void testRecursiveGeneric() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/recursiveGeneric.kt"); + } + + @TestMetadata("reflectTopLevelFunctionOtherFile.kt") + public void testReflectTopLevelFunctionOtherFile() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/reflectTopLevelFunctionOtherFile.kt"); + } + + @TestMetadata("sealedClass.kt") + public void testSealedClass() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/sealedClass.kt"); + } + + @TestMetadata("secondaryConstructors.kt") + public void testSecondaryConstructors() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/secondaryConstructors.kt"); + } + + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/simple.kt"); + } + + @TestMetadata("simpleValAnonymousObject.kt") + public void testSimpleValAnonymousObject() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/simpleValAnonymousObject.kt"); + } + + @TestMetadata("starImportEnum.kt") + public void testStarImportEnum() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/starImportEnum.kt"); + } + + @TestMetadata("targetedJvmName.kt") + public void testTargetedJvmName() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/targetedJvmName.kt"); + } + + @TestMetadata("typeAliasesKt13181.kt") + public void testTypeAliasesKt13181() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/typeAliasesKt13181.kt"); + } + + @TestMetadata("unsignedTypesInAnnotations.kt") + public void testUnsignedTypesInAnnotations() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/unsignedTypesInAnnotations.kt"); + } + + @TestMetadata("compiler/testData/compileKotlinAgainstKotlin/coroutines") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Coroutines extends AbstractIrCompileKotlinAgainstKotlinTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInCoroutines() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/compileKotlinAgainstKotlin/coroutines"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("builder.kt") + public void testBuilder() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/coroutines/builder.kt"); + } + + @TestMetadata("receiver.kt") + public void testReceiver() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/coroutines/receiver.kt"); + } + + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/coroutines/simple.kt"); + } + } + + @TestMetadata("compiler/testData/compileKotlinAgainstKotlin/jvm8") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Jvm8 extends AbstractIrCompileKotlinAgainstKotlinTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInJvm8() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/compileKotlinAgainstKotlin/jvm8"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("compiler/testData/compileKotlinAgainstKotlin/jvm8/defaults") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Defaults extends AbstractIrCompileKotlinAgainstKotlinTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInDefaults() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/compileKotlinAgainstKotlin/jvm8/defaults"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("superCall.kt") + public void testSuperCall() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/jvm8/defaults/superCall.kt"); + } + + @TestMetadata("superCallFromInterface.kt") + public void testSuperCallFromInterface() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/jvm8/defaults/superCallFromInterface.kt"); + } + + @TestMetadata("superCallFromInterface2.kt") + public void testSuperCallFromInterface2() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/jvm8/defaults/superCallFromInterface2.kt"); + } + + @TestMetadata("superPropAccess.kt") + public void testSuperPropAccess() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/jvm8/defaults/superPropAccess.kt"); + } + + @TestMetadata("superPropAccessFromInterface.kt") + public void testSuperPropAccessFromInterface() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/jvm8/defaults/superPropAccessFromInterface.kt"); + } + + @TestMetadata("superPropAccessFromInterface2.kt") + public void testSuperPropAccessFromInterface2() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/jvm8/defaults/superPropAccessFromInterface2.kt"); + } + } + + @TestMetadata("compiler/testData/compileKotlinAgainstKotlin/jvm8/jvm8against6") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Jvm8against6 extends AbstractIrCompileKotlinAgainstKotlinTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInJvm8against6() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/compileKotlinAgainstKotlin/jvm8/jvm8against6"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("jdk8Against6.kt") + public void testJdk8Against6() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/jvm8/jvm8against6/jdk8Against6.kt"); + } + + @TestMetadata("simpleCall.kt") + public void testSimpleCall() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/jvm8/jvm8against6/simpleCall.kt"); + } + + @TestMetadata("simpleCallWithBigHierarchy.kt") + public void testSimpleCallWithBigHierarchy() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/jvm8/jvm8against6/simpleCallWithBigHierarchy.kt"); + } + + @TestMetadata("simpleCallWithHierarchy.kt") + public void testSimpleCallWithHierarchy() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/jvm8/jvm8against6/simpleCallWithHierarchy.kt"); + } + + @TestMetadata("simpleProp.kt") + public void testSimpleProp() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/jvm8/jvm8against6/simpleProp.kt"); + } + + @TestMetadata("simplePropWithHierarchy.kt") + public void testSimplePropWithHierarchy() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/jvm8/jvm8against6/simplePropWithHierarchy.kt"); + } + + @TestMetadata("compiler/testData/compileKotlinAgainstKotlin/jvm8/jvm8against6/delegation") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Delegation extends AbstractIrCompileKotlinAgainstKotlinTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInDelegation() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/compileKotlinAgainstKotlin/jvm8/jvm8against6/delegation"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("diamond.kt") + public void testDiamond() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/jvm8/jvm8against6/delegation/diamond.kt"); + } + + @TestMetadata("diamond2.kt") + public void testDiamond2() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/jvm8/jvm8against6/delegation/diamond2.kt"); + } + + @TestMetadata("diamond3.kt") + public void testDiamond3() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/jvm8/jvm8against6/delegation/diamond3.kt"); + } + } + } + } +} diff --git a/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt b/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt index 4243453a490..3a8d8985578 100644 --- a/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt +++ b/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt @@ -360,6 +360,10 @@ fun main(args: Array) { model("codegen/boxAgainstJava", targetBackend = TargetBackend.JVM_IR) } + testClass { + model("compileKotlinAgainstKotlin", targetBackend = TargetBackend.JVM_IR) + } + testClass { model("checkLocalVariablesTable", targetBackend = TargetBackend.JVM_IR) }