From a4c7619c894a0412641d12be60bfc78638c82388 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Fri, 20 Mar 2020 13:10:21 +0300 Subject: [PATCH] [FIR2IR] Introduce & use FirBuiltInsPackageFragment Without this commit, JVM name mapping logic in BE does not work for FIR, because FIR cannot use old BuiltInsPackageFragmentImpl descriptor. In this commit we add our own implementation thus fixing a pack of FIR black box tests. --- .../fir/backend/Fir2IrDeclarationStorage.kt | 26 +++++++++++++++---- .../descriptors/FirBuiltInsPackageFragment.kt | 18 +++++++++++++ .../FirPackageFragmentDescriptor.kt | 2 +- .../annotations/nestedClassesInAnnotations.kt | 1 - .../property/enumNameOrdinal.kt | 1 - .../testData/codegen/box/classes/kt343.kt | 1 - .../box/classes/overloadBinaryOperator.kt | 1 - .../codegen/box/classes/overloadPlusAssign.kt | 1 - .../box/classes/overloadPlusAssignReturn.kt | 1 - .../box/classes/overloadPlusToPlusAssign.kt | 1 - .../tryCatchAfterWhileTrue.kt | 1 - .../codegen/box/enum/enumCompanionInit.kt | 1 - compiler/testData/codegen/box/enum/ordinal.kt | 1 - .../testData/codegen/box/enum/whenInObject.kt | 1 - .../codegen/box/extensionFunctions/kt865.kt | 1 - .../codegen/box/extensionFunctions/simple.kt | 1 - .../box/extensionFunctions/whenFail.kt | 1 - .../codegen/box/fullJdk/charBuffer.kt | 1 - compiler/testData/codegen/box/ir/enumClass.kt | 1 - .../testData/codegen/box/jdk/arrayList.kt | 1 - .../testData/codegen/box/objects/kt1186.kt | 1 - .../testData/codegen/box/objects/kt694.kt | 1 - .../ranges/expression/inexactSteppedDownTo.kt | 1 - .../ranges/expression/inexactSteppedRange.kt | 1 - .../box/ranges/expression/oneElementDownTo.kt | 1 - .../box/ranges/expression/oneElementRange.kt | 1 - .../box/ranges/expression/openRange.kt | 1 - .../ranges/expression/reversedBackSequence.kt | 1 - .../reversedInexactSteppedDownTo.kt | 1 - .../box/ranges/expression/reversedRange.kt | 1 - .../expression/reversedSimpleSteppedRange.kt | 1 - .../box/ranges/expression/simpleDownTo.kt | 1 - .../box/ranges/expression/simpleRange.kt | 1 - .../simpleRangeWithNonConstantEnds.kt | 1 - .../ranges/expression/simpleSteppedDownTo.kt | 1 - .../ranges/expression/simpleSteppedRange.kt | 1 - .../box/ranges/literal/oneElementDownTo.kt | 1 - .../box/ranges/literal/oneElementRange.kt | 1 - .../codegen/box/ranges/literal/openRange.kt | 1 - .../ranges/literal/reversedBackSequence.kt | 1 - .../box/ranges/literal/reversedRange.kt | 1 - .../box/ranges/literal/simpleDownTo.kt | 1 - .../codegen/box/ranges/literal/simpleRange.kt | 1 - .../literal/simpleRangeWithNonConstantEnds.kt | 1 - .../box/reflection/builtins/collections.kt | 1 - .../codegen/box/regressions/generic.kt | 1 - .../codegen/box/regressions/kt6434.kt | 1 - .../testData/codegen/box/regressions/kt789.kt | 1 - .../specialBuiltins/commonBridgesTarget.kt | 1 + .../box/specialBuiltins/explicitSuperCall.kt | 1 - .../box/specialBuiltins/valuesInsideEnum.kt | 1 - .../box/strings/kt5389_stringBuilderGet.kt | 1 - .../box/typealias/enumEntryQualifier.kt | 1 - .../box/when/enumOptimization/bigEnum.kt | 1 - .../enumOptimization/differentEnumClasses.kt | 1 - .../enumOptimization/differentEnumClasses2.kt | 1 - .../when/enumOptimization/duplicatingItems.kt | 1 - .../enumOptimization/enumInsideClassObject.kt | 1 - .../box/when/enumOptimization/expression.kt | 1 - .../functionLiteralInTopLevel.kt | 1 - .../box/when/enumOptimization/kt14597.kt | 1 - .../box/when/enumOptimization/kt14597_full.kt | 1 - .../box/when/enumOptimization/kt15806.kt | 1 - .../enumOptimization/manyWhensWithinClass.kt | 1 - .../enumOptimization/nullIsTheFirstEntry.kt | 1 - .../box/when/enumOptimization/nullability.kt | 1 - .../box/when/enumOptimization/withoutElse.kt | 1 - .../box/when/exhaustiveBreakContinue.kt | 1 - .../box/when/exhaustiveWhenInitialization.kt | 1 - .../codegen/box/when/exhaustiveWhenReturn.kt | 1 - .../codegen/box/when/noElseExhaustive.kt | 1 - .../box/when/noElseExhaustiveStatement.kt | 1 - .../box/when/noElseExhaustiveUnitExpected.kt | 1 - .../box/when/whenSubjectVariable/kt27161.kt | 1 - .../whenSubjectVariable/kt27161_nested.kt | 1 - .../whenSubjectVariable/kt27161_nested2.kt | 1 - .../when/whenSubjectVariable/whenByEnum.kt | 1 - .../whenSubjectVariable/whenByNullableEnum.kt | 1 - .../tests/GenerateRangesCodegenTestData.java | 19 ++++++++++---- 79 files changed, 55 insertions(+), 85 deletions(-) create mode 100644 compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/descriptors/FirBuiltInsPackageFragment.kt diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt index 3053d975191..66729a2cee3 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt @@ -6,6 +6,7 @@ package org.jetbrains.kotlin.fir.backend import org.jetbrains.kotlin.KtNodeTypes +import org.jetbrains.kotlin.builtins.KotlinBuiltIns.* import org.jetbrains.kotlin.descriptors.DeclarationDescriptor import org.jetbrains.kotlin.descriptors.Modality import org.jetbrains.kotlin.descriptors.SourceElement @@ -14,6 +15,7 @@ import org.jetbrains.kotlin.descriptors.annotations.Annotations import org.jetbrains.kotlin.fir.declarations.* import org.jetbrains.kotlin.fir.declarations.impl.FirDefaultPropertyGetter import org.jetbrains.kotlin.fir.declarations.impl.FirDefaultPropertySetter +import org.jetbrains.kotlin.fir.descriptors.FirBuiltInsPackageFragment import org.jetbrains.kotlin.fir.descriptors.FirModuleDescriptor import org.jetbrains.kotlin.fir.descriptors.FirPackageFragmentDescriptor import org.jetbrains.kotlin.fir.expressions.impl.FirExpressionStub @@ -54,6 +56,8 @@ class Fir2IrDeclarationStorage( private val fragmentCache = mutableMapOf() + private val builtInsFragmentCache = mutableMapOf() + private val fileCache = mutableMapOf() private val functionCache = mutableMapOf, IrSimpleFunction>() @@ -110,9 +114,19 @@ class Fir2IrDeclarationStorage( private fun ConeKotlinType.toIrType(typeContext: ConversionTypeContext = ConversionTypeContext.DEFAULT): IrType = with(typeConverter) { toIrType(typeContext) } + private fun getIrExternalOrBuiltInsPackageFragment(fqName: FqName): IrExternalPackageFragment { + val isBuiltIn = fqName in BUILT_INS_PACKAGE_FQ_NAMES + return if (isBuiltIn) getIrBuiltInsPackageFragment(fqName) else getIrExternalPackageFragment(fqName) + } + + private fun getIrBuiltInsPackageFragment(fqName: FqName): IrExternalPackageFragment { + return builtInsFragmentCache.getOrPut(fqName) { + return symbolTable.declareExternalPackageFragment(FirBuiltInsPackageFragment(fqName, moduleDescriptor)) + } + } + private fun getIrExternalPackageFragment(fqName: FqName): IrExternalPackageFragment { return fragmentCache.getOrPut(fqName) { - // TODO: module descriptor is wrong here return symbolTable.declareExternalPackageFragment(FirPackageFragmentDescriptor(fqName, moduleDescriptor)) } } @@ -187,10 +201,12 @@ class Fir2IrDeclarationStorage( else -> throw AssertionError("Unexpected: $firBasedSymbol") } - if (containerFile != null) { - fileCache[containerFile] - } else { - getIrExternalPackageFragment(packageFqName) + when { + containerFile != null -> fileCache[containerFile] + firBasedSymbol is FirCallableSymbol -> getIrExternalPackageFragment(packageFqName) + // TODO: All classes from BUILT_INS_PACKAGE_FQ_NAMES are considered built-ins now, + // which is not exact and can lead to some problems + else -> getIrExternalOrBuiltInsPackageFragment(packageFqName) } } } diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/descriptors/FirBuiltInsPackageFragment.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/descriptors/FirBuiltInsPackageFragment.kt new file mode 100644 index 00000000000..d652311bcb2 --- /dev/null +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/descriptors/FirBuiltInsPackageFragment.kt @@ -0,0 +1,18 @@ +/* + * 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.fir.descriptors + +import org.jetbrains.kotlin.builtins.BuiltInsPackageFragment +import org.jetbrains.kotlin.descriptors.ModuleDescriptor +import org.jetbrains.kotlin.name.FqName + +class FirBuiltInsPackageFragment( + fqName: FqName, + moduleDescriptor: ModuleDescriptor +) : FirPackageFragmentDescriptor(fqName, moduleDescriptor), BuiltInsPackageFragment { + override val isFallback: Boolean + get() = false +} \ No newline at end of file diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/descriptors/FirPackageFragmentDescriptor.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/descriptors/FirPackageFragmentDescriptor.kt index 67deaf1266c..c2a3e840ee6 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/descriptors/FirPackageFragmentDescriptor.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/descriptors/FirPackageFragmentDescriptor.kt @@ -11,7 +11,7 @@ import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.resolve.scopes.MemberScope -class FirPackageFragmentDescriptor(override val fqName: FqName, val moduleDescriptor: ModuleDescriptor) : PackageFragmentDescriptor { +open class FirPackageFragmentDescriptor(override val fqName: FqName, val moduleDescriptor: ModuleDescriptor) : PackageFragmentDescriptor { override fun getContainingDeclaration(): ModuleDescriptor { return moduleDescriptor } diff --git a/compiler/testData/codegen/box/annotations/nestedClassesInAnnotations.kt b/compiler/testData/codegen/box/annotations/nestedClassesInAnnotations.kt index 0f7b8ec89ea..81cc76869d7 100644 --- a/compiler/testData/codegen/box/annotations/nestedClassesInAnnotations.kt +++ b/compiler/testData/codegen/box/annotations/nestedClassesInAnnotations.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +NestedClassesInAnnotations -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: NATIVE annotation class Foo(val kind: Kind) { diff --git a/compiler/testData/codegen/box/callableReference/property/enumNameOrdinal.kt b/compiler/testData/codegen/box/callableReference/property/enumNameOrdinal.kt index 7e855cf7631..10ccfbdee1e 100644 --- a/compiler/testData/codegen/box/callableReference/property/enumNameOrdinal.kt +++ b/compiler/testData/codegen/box/callableReference/property/enumNameOrdinal.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class E { I } diff --git a/compiler/testData/codegen/box/classes/kt343.kt b/compiler/testData/codegen/box/classes/kt343.kt index 356ddd0960f..9bf3a3f0957 100644 --- a/compiler/testData/codegen/box/classes/kt343.kt +++ b/compiler/testData/codegen/box/classes/kt343.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME fun launch(f : () -> Unit) { f() diff --git a/compiler/testData/codegen/box/classes/overloadBinaryOperator.kt b/compiler/testData/codegen/box/classes/overloadBinaryOperator.kt index d1b1d9be768..91ec4e1c307 100644 --- a/compiler/testData/codegen/box/classes/overloadBinaryOperator.kt +++ b/compiler/testData/codegen/box/classes/overloadBinaryOperator.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME class ArrayWrapper() { val contents = ArrayList() diff --git a/compiler/testData/codegen/box/classes/overloadPlusAssign.kt b/compiler/testData/codegen/box/classes/overloadPlusAssign.kt index abc09b9de6a..7ed86497c80 100644 --- a/compiler/testData/codegen/box/classes/overloadPlusAssign.kt +++ b/compiler/testData/codegen/box/classes/overloadPlusAssign.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME class ArrayWrapper() { val contents = ArrayList() diff --git a/compiler/testData/codegen/box/classes/overloadPlusAssignReturn.kt b/compiler/testData/codegen/box/classes/overloadPlusAssignReturn.kt index b96864098eb..6d0747891b8 100644 --- a/compiler/testData/codegen/box/classes/overloadPlusAssignReturn.kt +++ b/compiler/testData/codegen/box/classes/overloadPlusAssignReturn.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME class ArrayWrapper() { val contents = ArrayList() diff --git a/compiler/testData/codegen/box/classes/overloadPlusToPlusAssign.kt b/compiler/testData/codegen/box/classes/overloadPlusToPlusAssign.kt index b96864098eb..6d0747891b8 100644 --- a/compiler/testData/codegen/box/classes/overloadPlusToPlusAssign.kt +++ b/compiler/testData/codegen/box/classes/overloadPlusToPlusAssign.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME class ArrayWrapper() { val contents = ArrayList() diff --git a/compiler/testData/codegen/box/controlStructures/tryCatchInExpressions/tryCatchAfterWhileTrue.kt b/compiler/testData/codegen/box/controlStructures/tryCatchInExpressions/tryCatchAfterWhileTrue.kt index 0ea4d979f4b..885b67601f8 100644 --- a/compiler/testData/codegen/box/controlStructures/tryCatchInExpressions/tryCatchAfterWhileTrue.kt +++ b/compiler/testData/codegen/box/controlStructures/tryCatchInExpressions/tryCatchAfterWhileTrue.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME fun box(): String { diff --git a/compiler/testData/codegen/box/enum/enumCompanionInit.kt b/compiler/testData/codegen/box/enum/enumCompanionInit.kt index efc36a4504b..625a83de162 100644 --- a/compiler/testData/codegen/box/enum/enumCompanionInit.kt +++ b/compiler/testData/codegen/box/enum/enumCompanionInit.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: NATIVE var result = "" diff --git a/compiler/testData/codegen/box/enum/ordinal.kt b/compiler/testData/codegen/box/enum/ordinal.kt index f0c2fe58aa6..d66c3e0ae4e 100644 --- a/compiler/testData/codegen/box/enum/ordinal.kt +++ b/compiler/testData/codegen/box/enum/ordinal.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class State { _0, _1, diff --git a/compiler/testData/codegen/box/enum/whenInObject.kt b/compiler/testData/codegen/box/enum/whenInObject.kt index 01ead272a5f..39234df7d84 100644 --- a/compiler/testData/codegen/box/enum/whenInObject.kt +++ b/compiler/testData/codegen/box/enum/whenInObject.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class E { OK, NOT_OK } diff --git a/compiler/testData/codegen/box/extensionFunctions/kt865.kt b/compiler/testData/codegen/box/extensionFunctions/kt865.kt index 8cfaa81bc8b..dd741dcef83 100644 --- a/compiler/testData/codegen/box/extensionFunctions/kt865.kt +++ b/compiler/testData/codegen/box/extensionFunctions/kt865.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME class Template() { val collected = ArrayList() diff --git a/compiler/testData/codegen/box/extensionFunctions/simple.kt b/compiler/testData/codegen/box/extensionFunctions/simple.kt index d2705a7c697..b8274e66693 100644 --- a/compiler/testData/codegen/box/extensionFunctions/simple.kt +++ b/compiler/testData/codegen/box/extensionFunctions/simple.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME fun StringBuilder.first() = this.get(0) diff --git a/compiler/testData/codegen/box/extensionFunctions/whenFail.kt b/compiler/testData/codegen/box/extensionFunctions/whenFail.kt index 1f1b535ac0c..b940bda99bf 100644 --- a/compiler/testData/codegen/box/extensionFunctions/whenFail.kt +++ b/compiler/testData/codegen/box/extensionFunctions/whenFail.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS diff --git a/compiler/testData/codegen/box/fullJdk/charBuffer.kt b/compiler/testData/codegen/box/fullJdk/charBuffer.kt index 932871ff9f4..7d7f2702e91 100644 --- a/compiler/testData/codegen/box/fullJdk/charBuffer.kt +++ b/compiler/testData/codegen/box/fullJdk/charBuffer.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // FULL_JDK diff --git a/compiler/testData/codegen/box/ir/enumClass.kt b/compiler/testData/codegen/box/ir/enumClass.kt index 64a08f9c03f..c5e8b6550ce 100644 --- a/compiler/testData/codegen/box/ir/enumClass.kt +++ b/compiler/testData/codegen/box/ir/enumClass.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR //WITH_RUNTIME import kotlin.test.assertEquals diff --git a/compiler/testData/codegen/box/jdk/arrayList.kt b/compiler/testData/codegen/box/jdk/arrayList.kt index e23fbce8fe4..d0ceaccac7f 100644 --- a/compiler/testData/codegen/box/jdk/arrayList.kt +++ b/compiler/testData/codegen/box/jdk/arrayList.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME fun box(): String { diff --git a/compiler/testData/codegen/box/objects/kt1186.kt b/compiler/testData/codegen/box/objects/kt1186.kt index 021b6b050f3..6100f7092fa 100644 --- a/compiler/testData/codegen/box/objects/kt1186.kt +++ b/compiler/testData/codegen/box/objects/kt1186.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class Color(val rgb : Int) { RED(0xFF0000), GREEN(0x00FF00), diff --git a/compiler/testData/codegen/box/objects/kt694.kt b/compiler/testData/codegen/box/objects/kt694.kt index a951df065ef..945e1298489 100644 --- a/compiler/testData/codegen/box/objects/kt694.kt +++ b/compiler/testData/codegen/box/objects/kt694.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class Test { A, B, diff --git a/compiler/testData/codegen/box/ranges/expression/inexactSteppedDownTo.kt b/compiler/testData/codegen/box/ranges/expression/inexactSteppedDownTo.kt index f9f0ed90072..4f20935fbe9 100644 --- a/compiler/testData/codegen/box/ranges/expression/inexactSteppedDownTo.kt +++ b/compiler/testData/codegen/box/ranges/expression/inexactSteppedDownTo.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/expression/inexactSteppedRange.kt b/compiler/testData/codegen/box/ranges/expression/inexactSteppedRange.kt index aee939bc908..3b58dfb0323 100644 --- a/compiler/testData/codegen/box/ranges/expression/inexactSteppedRange.kt +++ b/compiler/testData/codegen/box/ranges/expression/inexactSteppedRange.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/expression/oneElementDownTo.kt b/compiler/testData/codegen/box/ranges/expression/oneElementDownTo.kt index 8cf7d2ef4db..e1e501bd110 100644 --- a/compiler/testData/codegen/box/ranges/expression/oneElementDownTo.kt +++ b/compiler/testData/codegen/box/ranges/expression/oneElementDownTo.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/expression/oneElementRange.kt b/compiler/testData/codegen/box/ranges/expression/oneElementRange.kt index 5b4108bc1d7..ec086574042 100644 --- a/compiler/testData/codegen/box/ranges/expression/oneElementRange.kt +++ b/compiler/testData/codegen/box/ranges/expression/oneElementRange.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/expression/openRange.kt b/compiler/testData/codegen/box/ranges/expression/openRange.kt index 4c671e07c87..965ed9d8e8d 100644 --- a/compiler/testData/codegen/box/ranges/expression/openRange.kt +++ b/compiler/testData/codegen/box/ranges/expression/openRange.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/expression/reversedBackSequence.kt b/compiler/testData/codegen/box/ranges/expression/reversedBackSequence.kt index d9cda654ea9..cfa33912e6a 100644 --- a/compiler/testData/codegen/box/ranges/expression/reversedBackSequence.kt +++ b/compiler/testData/codegen/box/ranges/expression/reversedBackSequence.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/expression/reversedInexactSteppedDownTo.kt b/compiler/testData/codegen/box/ranges/expression/reversedInexactSteppedDownTo.kt index f980d8d7245..81940e97584 100644 --- a/compiler/testData/codegen/box/ranges/expression/reversedInexactSteppedDownTo.kt +++ b/compiler/testData/codegen/box/ranges/expression/reversedInexactSteppedDownTo.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/expression/reversedRange.kt b/compiler/testData/codegen/box/ranges/expression/reversedRange.kt index f3b274a8891..51da1df8774 100644 --- a/compiler/testData/codegen/box/ranges/expression/reversedRange.kt +++ b/compiler/testData/codegen/box/ranges/expression/reversedRange.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/expression/reversedSimpleSteppedRange.kt b/compiler/testData/codegen/box/ranges/expression/reversedSimpleSteppedRange.kt index 84eb55d21a5..9e22b65f8c0 100644 --- a/compiler/testData/codegen/box/ranges/expression/reversedSimpleSteppedRange.kt +++ b/compiler/testData/codegen/box/ranges/expression/reversedSimpleSteppedRange.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/expression/simpleDownTo.kt b/compiler/testData/codegen/box/ranges/expression/simpleDownTo.kt index 1d415b0c2f5..015ec164730 100644 --- a/compiler/testData/codegen/box/ranges/expression/simpleDownTo.kt +++ b/compiler/testData/codegen/box/ranges/expression/simpleDownTo.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/expression/simpleRange.kt b/compiler/testData/codegen/box/ranges/expression/simpleRange.kt index 173dd5e9149..634155eea17 100644 --- a/compiler/testData/codegen/box/ranges/expression/simpleRange.kt +++ b/compiler/testData/codegen/box/ranges/expression/simpleRange.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/expression/simpleRangeWithNonConstantEnds.kt b/compiler/testData/codegen/box/ranges/expression/simpleRangeWithNonConstantEnds.kt index 145ee540320..2d56b9890c2 100644 --- a/compiler/testData/codegen/box/ranges/expression/simpleRangeWithNonConstantEnds.kt +++ b/compiler/testData/codegen/box/ranges/expression/simpleRangeWithNonConstantEnds.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/expression/simpleSteppedDownTo.kt b/compiler/testData/codegen/box/ranges/expression/simpleSteppedDownTo.kt index 34d912edfaa..14997ebbf2e 100644 --- a/compiler/testData/codegen/box/ranges/expression/simpleSteppedDownTo.kt +++ b/compiler/testData/codegen/box/ranges/expression/simpleSteppedDownTo.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/expression/simpleSteppedRange.kt b/compiler/testData/codegen/box/ranges/expression/simpleSteppedRange.kt index ea45804db4d..128176fe584 100644 --- a/compiler/testData/codegen/box/ranges/expression/simpleSteppedRange.kt +++ b/compiler/testData/codegen/box/ranges/expression/simpleSteppedRange.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/literal/oneElementDownTo.kt b/compiler/testData/codegen/box/ranges/literal/oneElementDownTo.kt index 93a3d27a9a5..4d7b46d6ae0 100644 --- a/compiler/testData/codegen/box/ranges/literal/oneElementDownTo.kt +++ b/compiler/testData/codegen/box/ranges/literal/oneElementDownTo.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/literal/oneElementRange.kt b/compiler/testData/codegen/box/ranges/literal/oneElementRange.kt index 20b7fa5b422..ff2067aeb18 100644 --- a/compiler/testData/codegen/box/ranges/literal/oneElementRange.kt +++ b/compiler/testData/codegen/box/ranges/literal/oneElementRange.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/literal/openRange.kt b/compiler/testData/codegen/box/ranges/literal/openRange.kt index b3b885b3471..9102b06fc3a 100644 --- a/compiler/testData/codegen/box/ranges/literal/openRange.kt +++ b/compiler/testData/codegen/box/ranges/literal/openRange.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/literal/reversedBackSequence.kt b/compiler/testData/codegen/box/ranges/literal/reversedBackSequence.kt index 9d019016d68..4719e88a19b 100644 --- a/compiler/testData/codegen/box/ranges/literal/reversedBackSequence.kt +++ b/compiler/testData/codegen/box/ranges/literal/reversedBackSequence.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/literal/reversedRange.kt b/compiler/testData/codegen/box/ranges/literal/reversedRange.kt index 0893c994e57..38bec62cd9a 100644 --- a/compiler/testData/codegen/box/ranges/literal/reversedRange.kt +++ b/compiler/testData/codegen/box/ranges/literal/reversedRange.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/literal/simpleDownTo.kt b/compiler/testData/codegen/box/ranges/literal/simpleDownTo.kt index f3cb318bc3c..57ae1158e3f 100644 --- a/compiler/testData/codegen/box/ranges/literal/simpleDownTo.kt +++ b/compiler/testData/codegen/box/ranges/literal/simpleDownTo.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/literal/simpleRange.kt b/compiler/testData/codegen/box/ranges/literal/simpleRange.kt index a2914b17a55..9e60bfb7645 100644 --- a/compiler/testData/codegen/box/ranges/literal/simpleRange.kt +++ b/compiler/testData/codegen/box/ranges/literal/simpleRange.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/literal/simpleRangeWithNonConstantEnds.kt b/compiler/testData/codegen/box/ranges/literal/simpleRangeWithNonConstantEnds.kt index 0a83b691502..05642cd81e2 100644 --- a/compiler/testData/codegen/box/ranges/literal/simpleRangeWithNonConstantEnds.kt +++ b/compiler/testData/codegen/box/ranges/literal/simpleRangeWithNonConstantEnds.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/reflection/builtins/collections.kt b/compiler/testData/codegen/box/reflection/builtins/collections.kt index 8bc54f04479..bd82358b5e7 100644 --- a/compiler/testData/codegen/box/reflection/builtins/collections.kt +++ b/compiler/testData/codegen/box/reflection/builtins/collections.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT // FULL_JDK diff --git a/compiler/testData/codegen/box/regressions/generic.kt b/compiler/testData/codegen/box/regressions/generic.kt index 9b2fa0fcd07..ede3a824d0f 100644 --- a/compiler/testData/codegen/box/regressions/generic.kt +++ b/compiler/testData/codegen/box/regressions/generic.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/regressions/kt6434.kt b/compiler/testData/codegen/box/regressions/kt6434.kt index 696c75fae7f..bfc7654874a 100644 --- a/compiler/testData/codegen/box/regressions/kt6434.kt +++ b/compiler/testData/codegen/box/regressions/kt6434.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/regressions/kt789.kt b/compiler/testData/codegen/box/regressions/kt789.kt index 259f578e4a8..d3df588ce1f 100644 --- a/compiler/testData/codegen/box/regressions/kt789.kt +++ b/compiler/testData/codegen/box/regressions/kt789.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME package foo diff --git a/compiler/testData/codegen/box/specialBuiltins/commonBridgesTarget.kt b/compiler/testData/codegen/box/specialBuiltins/commonBridgesTarget.kt index 65ae4ba292a..638ea3eca78 100644 --- a/compiler/testData/codegen/box/specialBuiltins/commonBridgesTarget.kt +++ b/compiler/testData/codegen/box/specialBuiltins/commonBridgesTarget.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // IGNORE_BACKEND: NATIVE diff --git a/compiler/testData/codegen/box/specialBuiltins/explicitSuperCall.kt b/compiler/testData/codegen/box/specialBuiltins/explicitSuperCall.kt index eb8cf9326cf..6c0a3b7f566 100644 --- a/compiler/testData/codegen/box/specialBuiltins/explicitSuperCall.kt +++ b/compiler/testData/codegen/box/specialBuiltins/explicitSuperCall.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // IGNORE_BACKEND: NATIVE diff --git a/compiler/testData/codegen/box/specialBuiltins/valuesInsideEnum.kt b/compiler/testData/codegen/box/specialBuiltins/valuesInsideEnum.kt index 3f73a6729bc..ee008bfcf82 100644 --- a/compiler/testData/codegen/box/specialBuiltins/valuesInsideEnum.kt +++ b/compiler/testData/codegen/box/specialBuiltins/valuesInsideEnum.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class Variants { O, K; companion object { diff --git a/compiler/testData/codegen/box/strings/kt5389_stringBuilderGet.kt b/compiler/testData/codegen/box/strings/kt5389_stringBuilderGet.kt index a6ffe3485a1..49855350814 100644 --- a/compiler/testData/codegen/box/strings/kt5389_stringBuilderGet.kt +++ b/compiler/testData/codegen/box/strings/kt5389_stringBuilderGet.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME fun box(): String { val sb = StringBuilder("OK") diff --git a/compiler/testData/codegen/box/typealias/enumEntryQualifier.kt b/compiler/testData/codegen/box/typealias/enumEntryQualifier.kt index 50ed9a72b95..19c383aaed0 100644 --- a/compiler/testData/codegen/box/typealias/enumEntryQualifier.kt +++ b/compiler/testData/codegen/box/typealias/enumEntryQualifier.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class MyEnum { O; companion object { diff --git a/compiler/testData/codegen/box/when/enumOptimization/bigEnum.kt b/compiler/testData/codegen/box/when/enumOptimization/bigEnum.kt index 499792682d0..629b6d1a32a 100644 --- a/compiler/testData/codegen/box/when/enumOptimization/bigEnum.kt +++ b/compiler/testData/codegen/box/when/enumOptimization/bigEnum.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // CHECK_CASES_COUNT: function=bar1 count=6 // CHECK_IF_COUNT: function=bar1 count=0 diff --git a/compiler/testData/codegen/box/when/enumOptimization/differentEnumClasses.kt b/compiler/testData/codegen/box/when/enumOptimization/differentEnumClasses.kt index 189128144ae..867bc2f5b7a 100644 --- a/compiler/testData/codegen/box/when/enumOptimization/differentEnumClasses.kt +++ b/compiler/testData/codegen/box/when/enumOptimization/differentEnumClasses.kt @@ -1,5 +1,4 @@ // !LANGUAGE: -ProhibitComparisonOfIncompatibleEnums -// IGNORE_BACKEND_FIR: JVM_IR enum class A { O, K diff --git a/compiler/testData/codegen/box/when/enumOptimization/differentEnumClasses2.kt b/compiler/testData/codegen/box/when/enumOptimization/differentEnumClasses2.kt index 7574cb99e69..deffe8ae56f 100644 --- a/compiler/testData/codegen/box/when/enumOptimization/differentEnumClasses2.kt +++ b/compiler/testData/codegen/box/when/enumOptimization/differentEnumClasses2.kt @@ -1,5 +1,4 @@ // !LANGUAGE: -ProhibitComparisonOfIncompatibleEnums -// IGNORE_BACKEND_FIR: JVM_IR enum class A { OK diff --git a/compiler/testData/codegen/box/when/enumOptimization/duplicatingItems.kt b/compiler/testData/codegen/box/when/enumOptimization/duplicatingItems.kt index 04a5eeddd68..0df6b309bf6 100644 --- a/compiler/testData/codegen/box/when/enumOptimization/duplicatingItems.kt +++ b/compiler/testData/codegen/box/when/enumOptimization/duplicatingItems.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // CHECK_CASES_COUNT: function=bar count=3 // CHECK_IF_COUNT: function=bar count=0 diff --git a/compiler/testData/codegen/box/when/enumOptimization/enumInsideClassObject.kt b/compiler/testData/codegen/box/when/enumOptimization/enumInsideClassObject.kt index 7363d8dfc7c..1ce3c8075a0 100644 --- a/compiler/testData/codegen/box/when/enumOptimization/enumInsideClassObject.kt +++ b/compiler/testData/codegen/box/when/enumOptimization/enumInsideClassObject.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // CHECK_CASES_COUNT: function=foo count=3 // CHECK_IF_COUNT: function=foo count=0 diff --git a/compiler/testData/codegen/box/when/enumOptimization/expression.kt b/compiler/testData/codegen/box/when/enumOptimization/expression.kt index c36ecce7c9a..418f1860d09 100644 --- a/compiler/testData/codegen/box/when/enumOptimization/expression.kt +++ b/compiler/testData/codegen/box/when/enumOptimization/expression.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // CHECK_CASES_COUNT: function=bar1 count=3 // CHECK_IF_COUNT: function=bar1 count=0 diff --git a/compiler/testData/codegen/box/when/enumOptimization/functionLiteralInTopLevel.kt b/compiler/testData/codegen/box/when/enumOptimization/functionLiteralInTopLevel.kt index e75e1f6c43e..2266ce69a30 100644 --- a/compiler/testData/codegen/box/when/enumOptimization/functionLiteralInTopLevel.kt +++ b/compiler/testData/codegen/box/when/enumOptimization/functionLiteralInTopLevel.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // CHECK_CASES_COUNT: function=box$lambda count=0 // CHECK_IF_COUNT: function=box$lambda count=1 diff --git a/compiler/testData/codegen/box/when/enumOptimization/kt14597.kt b/compiler/testData/codegen/box/when/enumOptimization/kt14597.kt index 50136100f6e..7af0d40883e 100644 --- a/compiler/testData/codegen/box/when/enumOptimization/kt14597.kt +++ b/compiler/testData/codegen/box/when/enumOptimization/kt14597.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // CHECK_CASES_COUNT: function=box count=6 // CHECK_IF_COUNT: function=box count=1 diff --git a/compiler/testData/codegen/box/when/enumOptimization/kt14597_full.kt b/compiler/testData/codegen/box/when/enumOptimization/kt14597_full.kt index 02bf40b97c6..2926f787c9e 100644 --- a/compiler/testData/codegen/box/when/enumOptimization/kt14597_full.kt +++ b/compiler/testData/codegen/box/when/enumOptimization/kt14597_full.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // CHECK_CASES_COUNT: function=box count=18 // CHECK_IF_COUNT: function=box count=3 diff --git a/compiler/testData/codegen/box/when/enumOptimization/kt15806.kt b/compiler/testData/codegen/box/when/enumOptimization/kt15806.kt index 640feb3311c..54d4d6c5cd9 100644 --- a/compiler/testData/codegen/box/when/enumOptimization/kt15806.kt +++ b/compiler/testData/codegen/box/when/enumOptimization/kt15806.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // CHECK_CASES_COUNT: function=doTheThing count=2 // CHECK_IF_COUNT: function=doTheThing count=2 diff --git a/compiler/testData/codegen/box/when/enumOptimization/manyWhensWithinClass.kt b/compiler/testData/codegen/box/when/enumOptimization/manyWhensWithinClass.kt index 09a0b1c9715..35b69efcfdd 100644 --- a/compiler/testData/codegen/box/when/enumOptimization/manyWhensWithinClass.kt +++ b/compiler/testData/codegen/box/when/enumOptimization/manyWhensWithinClass.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // CHECK_CASES_COUNT: function=bar1_u51tkt$ count=3 // CHECK_IF_COUNT: function=bar1_u51tkt$ count=0 diff --git a/compiler/testData/codegen/box/when/enumOptimization/nullIsTheFirstEntry.kt b/compiler/testData/codegen/box/when/enumOptimization/nullIsTheFirstEntry.kt index 1a9adff912d..74908190cdc 100644 --- a/compiler/testData/codegen/box/when/enumOptimization/nullIsTheFirstEntry.kt +++ b/compiler/testData/codegen/box/when/enumOptimization/nullIsTheFirstEntry.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class E { A, B; } diff --git a/compiler/testData/codegen/box/when/enumOptimization/nullability.kt b/compiler/testData/codegen/box/when/enumOptimization/nullability.kt index b7275f2e004..35beca78fac 100644 --- a/compiler/testData/codegen/box/when/enumOptimization/nullability.kt +++ b/compiler/testData/codegen/box/when/enumOptimization/nullability.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // CHECK_CASES_COUNT: function=foo1 count=0 // CHECK_IF_COUNT: function=foo1 count=2 diff --git a/compiler/testData/codegen/box/when/enumOptimization/withoutElse.kt b/compiler/testData/codegen/box/when/enumOptimization/withoutElse.kt index a1d663b2a72..a1f39c321ec 100644 --- a/compiler/testData/codegen/box/when/enumOptimization/withoutElse.kt +++ b/compiler/testData/codegen/box/when/enumOptimization/withoutElse.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // CHECK_CASES_COUNT: function=bar1 count=3 // CHECK_IF_COUNT: function=bar1 count=0 diff --git a/compiler/testData/codegen/box/when/exhaustiveBreakContinue.kt b/compiler/testData/codegen/box/when/exhaustiveBreakContinue.kt index 79fd70eac78..69c959e13cb 100644 --- a/compiler/testData/codegen/box/when/exhaustiveBreakContinue.kt +++ b/compiler/testData/codegen/box/when/exhaustiveBreakContinue.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class Color { RED, GREEN, BLUE } fun foo(arr: Array): Color { diff --git a/compiler/testData/codegen/box/when/exhaustiveWhenInitialization.kt b/compiler/testData/codegen/box/when/exhaustiveWhenInitialization.kt index 4bfd7487d2b..ccf67614e6c 100644 --- a/compiler/testData/codegen/box/when/exhaustiveWhenInitialization.kt +++ b/compiler/testData/codegen/box/when/exhaustiveWhenInitialization.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class A { V } fun box(): String { diff --git a/compiler/testData/codegen/box/when/exhaustiveWhenReturn.kt b/compiler/testData/codegen/box/when/exhaustiveWhenReturn.kt index fd2ee42ca1b..6b3b7658cc2 100644 --- a/compiler/testData/codegen/box/when/exhaustiveWhenReturn.kt +++ b/compiler/testData/codegen/box/when/exhaustiveWhenReturn.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class A { V } fun box(): String { diff --git a/compiler/testData/codegen/box/when/noElseExhaustive.kt b/compiler/testData/codegen/box/when/noElseExhaustive.kt index 22294cdc19f..e02125f19c8 100644 --- a/compiler/testData/codegen/box/when/noElseExhaustive.kt +++ b/compiler/testData/codegen/box/when/noElseExhaustive.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class En { A, B diff --git a/compiler/testData/codegen/box/when/noElseExhaustiveStatement.kt b/compiler/testData/codegen/box/when/noElseExhaustiveStatement.kt index 497208a3bb5..da79d180335 100644 --- a/compiler/testData/codegen/box/when/noElseExhaustiveStatement.kt +++ b/compiler/testData/codegen/box/when/noElseExhaustiveStatement.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class En { A, B diff --git a/compiler/testData/codegen/box/when/noElseExhaustiveUnitExpected.kt b/compiler/testData/codegen/box/when/noElseExhaustiveUnitExpected.kt index b9ecaccedc1..2c69069abac 100644 --- a/compiler/testData/codegen/box/when/noElseExhaustiveUnitExpected.kt +++ b/compiler/testData/codegen/box/when/noElseExhaustiveUnitExpected.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class En { A, B diff --git a/compiler/testData/codegen/box/when/whenSubjectVariable/kt27161.kt b/compiler/testData/codegen/box/when/whenSubjectVariable/kt27161.kt index f21b6a513c1..18862bde022 100644 --- a/compiler/testData/codegen/box/when/whenSubjectVariable/kt27161.kt +++ b/compiler/testData/codegen/box/when/whenSubjectVariable/kt27161.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class Test { A, B, OTHER } diff --git a/compiler/testData/codegen/box/when/whenSubjectVariable/kt27161_nested.kt b/compiler/testData/codegen/box/when/whenSubjectVariable/kt27161_nested.kt index 05d76795dad..e75b6085120 100644 --- a/compiler/testData/codegen/box/when/whenSubjectVariable/kt27161_nested.kt +++ b/compiler/testData/codegen/box/when/whenSubjectVariable/kt27161_nested.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class Test { A, B, OTHER } diff --git a/compiler/testData/codegen/box/when/whenSubjectVariable/kt27161_nested2.kt b/compiler/testData/codegen/box/when/whenSubjectVariable/kt27161_nested2.kt index d364f3c35c1..f0dbde680a1 100644 --- a/compiler/testData/codegen/box/when/whenSubjectVariable/kt27161_nested2.kt +++ b/compiler/testData/codegen/box/when/whenSubjectVariable/kt27161_nested2.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR enum class Test { A, B, OTHER } diff --git a/compiler/testData/codegen/box/when/whenSubjectVariable/whenByEnum.kt b/compiler/testData/codegen/box/when/whenSubjectVariable/whenByEnum.kt index a17d62466cf..fece15d4c87 100644 --- a/compiler/testData/codegen/box/when/whenSubjectVariable/whenByEnum.kt +++ b/compiler/testData/codegen/box/when/whenSubjectVariable/whenByEnum.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +VariableDeclarationInWhenSubject -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME import kotlin.test.assertEquals diff --git a/compiler/testData/codegen/box/when/whenSubjectVariable/whenByNullableEnum.kt b/compiler/testData/codegen/box/when/whenSubjectVariable/whenByNullableEnum.kt index cc842fc15dd..afd79fb6fba 100644 --- a/compiler/testData/codegen/box/when/whenSubjectVariable/whenByNullableEnum.kt +++ b/compiler/testData/codegen/box/when/whenSubjectVariable/whenByNullableEnum.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +VariableDeclarationInWhenSubject -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME import kotlin.test.assertEquals diff --git a/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateRangesCodegenTestData.java b/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateRangesCodegenTestData.java index 577e7cc084a..4096afb4279 100644 --- a/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateRangesCodegenTestData.java +++ b/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateRangesCodegenTestData.java @@ -71,6 +71,18 @@ public class GenerateRangesCodegenTestData { private static final Map ELEMENT_TYPE_KNOWN_SUBSTRINGS = new HashMap<>(); private static final Map MIN_MAX_CONSTANTS = new LinkedHashMap<>(); + private static final List FIR_PASSING_LITERAL_TESTS = + Arrays.asList("emptyDownto", "emptyRange", "oneElementDownTo", "oneElementRange", "openRange", + "reversedBackSequence", "reversedEmptyBackSequence", "reversedEmptyRange", + "reversedRange", "simpleDownTo", "simpleRange", "simpleRangeWithNonConstantEnds"); + private static final List FIR_PASSING_EXPRESSION_TESTS = + Arrays.asList("emptyDownto", "emptyRange", "inexactSteppedDownTo", "inexactSteppedRange", + "oneElementDownTo", "oneElementRange", "openRange", + "reversedBackSequence", "reversedEmptyBackSequence", "reversedEmptyRange", + "reversedInexactSteppedDownTo", "reversedRange", "reversedSimpleSteppedRange", + "simpleDownTo", "simpleRange", "simpleRangeWithNonConstantEnds", + "simpleSteppedDownTo", "simpleSteppedRange"); + static { for (String integerType : INTEGER_PRIMITIVES) { String suffix = integerType.substring(0, integerType.startsWith("U") ? 2 : 1); @@ -227,11 +239,8 @@ public class GenerateRangesCodegenTestData { } String fileName = testFunName + ".kt"; - boolean useFrontendIR = - testFunName.equals("emptyDownto") || testFunName.equals("emptyRange") || - testFunName.equals("reversedEmptyRange") || testFunName.equals("reversedEmptyBackSequence"); - writeToFile(new File(AS_LITERAL_DIR, fileName), asLiteralBody.toString(), false, !useFrontendIR); - writeToFile(new File(AS_EXPRESSION_DIR, fileName), asExpressionBody.toString(), false, !useFrontendIR); + writeToFile(new File(AS_LITERAL_DIR, fileName), asLiteralBody.toString(), false, !FIR_PASSING_LITERAL_TESTS.contains(testFunName)); + writeToFile(new File(AS_EXPRESSION_DIR, fileName), asExpressionBody.toString(), false, !FIR_PASSING_EXPRESSION_TESTS.contains(testFunName)); writeToFile(new File(UNSIGNED_AS_LITERAL_DIR, fileName), unsignedAsLiteralBody.toString(), true, true); writeToFile(new File(UNSIGNED_AS_EXPRESSION_DIR, fileName), unsignedAsExpressionBody.toString(), true, true); }