diff --git a/compiler/testData/codegen/box/compileKotlinAgainstKotlin/callDeserializedPropertyOnInlineClassTypeOldMangling.kt b/compiler/testData/codegen/box/compileKotlinAgainstKotlin/callDeserializedPropertyOnInlineClassTypeOldMangling.kt index ea62b6bea6b..467bfa9f4df 100644 --- a/compiler/testData/codegen/box/compileKotlinAgainstKotlin/callDeserializedPropertyOnInlineClassTypeOldMangling.kt +++ b/compiler/testData/codegen/box/compileKotlinAgainstKotlin/callDeserializedPropertyOnInlineClassTypeOldMangling.kt @@ -1,7 +1,7 @@ // TARGET_BACKEND: JVM // !LANGUAGE: +InlineClasses // MODULE: lib -// KOTLIN_CONFIGURATION_FLAGS: +JVM.USE_OLD_INLINE_CLASSES_MANGLING_SCHEME +// USE_OLD_INLINE_CLASSES_MANGLING_SCHEME // FILE: A.kt package a diff --git a/compiler/testData/codegen/box/compileKotlinAgainstKotlin/constructorWithInlineClassParametersInBinaryDependenciesOldMangling.kt b/compiler/testData/codegen/box/compileKotlinAgainstKotlin/constructorWithInlineClassParametersInBinaryDependenciesOldMangling.kt index dc31e923699..dfad96236c7 100644 --- a/compiler/testData/codegen/box/compileKotlinAgainstKotlin/constructorWithInlineClassParametersInBinaryDependenciesOldMangling.kt +++ b/compiler/testData/codegen/box/compileKotlinAgainstKotlin/constructorWithInlineClassParametersInBinaryDependenciesOldMangling.kt @@ -1,7 +1,7 @@ // TARGET_BACKEND: JVM // !LANGUAGE: +InlineClasses // MODULE: lib -// KOTLIN_CONFIGURATION_FLAGS: +JVM.USE_OLD_INLINE_CLASSES_MANGLING_SCHEME +// USE_OLD_INLINE_CLASSES_MANGLING_SCHEME // FILE: A.kt package lib diff --git a/compiler/testData/codegen/box/compileKotlinAgainstKotlin/defaultWithInlineClassAndReceiversOldMangling.kt b/compiler/testData/codegen/box/compileKotlinAgainstKotlin/defaultWithInlineClassAndReceiversOldMangling.kt index 1c6ccbe5712..59a484beb0f 100644 --- a/compiler/testData/codegen/box/compileKotlinAgainstKotlin/defaultWithInlineClassAndReceiversOldMangling.kt +++ b/compiler/testData/codegen/box/compileKotlinAgainstKotlin/defaultWithInlineClassAndReceiversOldMangling.kt @@ -1,7 +1,7 @@ // TARGET_BACKEND: JVM // !LANGUAGE: +InlineClasses // MODULE: lib -// KOTLIN_CONFIGURATION_FLAGS: +JVM.USE_OLD_INLINE_CLASSES_MANGLING_SCHEME +// USE_OLD_INLINE_CLASSES_MANGLING_SCHEME // FILE: A.kt package z diff --git a/compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClassFakeOverrideManglingOldMangling.kt b/compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClassFakeOverrideManglingOldMangling.kt index a94b562e712..802d480d41c 100644 --- a/compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClassFakeOverrideManglingOldMangling.kt +++ b/compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClassFakeOverrideManglingOldMangling.kt @@ -1,7 +1,7 @@ // TARGET_BACKEND: JVM // !LANGUAGE: +InlineClasses // MODULE: lib -// KOTLIN_CONFIGURATION_FLAGS: +JVM.USE_OLD_INLINE_CLASSES_MANGLING_SCHEME +// USE_OLD_INLINE_CLASSES_MANGLING_SCHEME // FILE: 1.kt inline class IC(val s: String) diff --git a/compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClassFromBinaryDependenciesOldMangling.kt b/compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClassFromBinaryDependenciesOldMangling.kt index d1dfed9babd..3e6eb84c125 100644 --- a/compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClassFromBinaryDependenciesOldMangling.kt +++ b/compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClassFromBinaryDependenciesOldMangling.kt @@ -2,7 +2,7 @@ // !LANGUAGE: +InlineClasses // WITH_STDLIB // MODULE: lib -// KOTLIN_CONFIGURATION_FLAGS: +JVM.USE_OLD_INLINE_CLASSES_MANGLING_SCHEME +// USE_OLD_INLINE_CLASSES_MANGLING_SCHEME // FILE: A.kt package z diff --git a/compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClassInlineFunctionCallOldMangling.kt b/compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClassInlineFunctionCallOldMangling.kt index 99ccd461a58..d4f0876963c 100644 --- a/compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClassInlineFunctionCallOldMangling.kt +++ b/compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClassInlineFunctionCallOldMangling.kt @@ -1,7 +1,7 @@ // TARGET_BACKEND: JVM // !LANGUAGE: +InlineClasses // MODULE: lib -// KOTLIN_CONFIGURATION_FLAGS: +JVM.USE_OLD_INLINE_CLASSES_MANGLING_SCHEME +// USE_OLD_INLINE_CLASSES_MANGLING_SCHEME // FILE: A.kt inline class A(val x: String) { diff --git a/compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClassInlinePropertyOldMangling.kt b/compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClassInlinePropertyOldMangling.kt index c71e6ecd2eb..3021fd7157f 100644 --- a/compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClassInlinePropertyOldMangling.kt +++ b/compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClassInlinePropertyOldMangling.kt @@ -1,7 +1,7 @@ // TARGET_BACKEND: JVM // !LANGUAGE: +InlineClasses // MODULE: lib -// KOTLIN_CONFIGURATION_FLAGS: +JVM.USE_OLD_INLINE_CLASSES_MANGLING_SCHEME +// USE_OLD_INLINE_CLASSES_MANGLING_SCHEME // FILE: A.kt package a diff --git a/compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClassesOldMangling.kt b/compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClassesOldMangling.kt index 30060eb0e33..67a7fa2ac1e 100644 --- a/compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClassesOldMangling.kt +++ b/compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClassesOldMangling.kt @@ -3,7 +3,7 @@ // WITH_STDLIB // MODULE: lib -// KOTLIN_CONFIGURATION_FLAGS: +JVM.USE_OLD_INLINE_CLASSES_MANGLING_SCHEME +// USE_OLD_INLINE_CLASSES_MANGLING_SCHEME // FILE: 1.kt package test diff --git a/compiler/testData/codegen/box/compileKotlinAgainstKotlin/privateCompanionObjectValInDifferentModuleOldMangling.kt b/compiler/testData/codegen/box/compileKotlinAgainstKotlin/privateCompanionObjectValInDifferentModuleOldMangling.kt index 56407d4eb7a..3bd80bf3e08 100644 --- a/compiler/testData/codegen/box/compileKotlinAgainstKotlin/privateCompanionObjectValInDifferentModuleOldMangling.kt +++ b/compiler/testData/codegen/box/compileKotlinAgainstKotlin/privateCompanionObjectValInDifferentModuleOldMangling.kt @@ -4,7 +4,7 @@ // WITH_REFLECT // MODULE: lib -// KOTLIN_CONFIGURATION_FLAGS: +JVM.USE_OLD_INLINE_CLASSES_MANGLING_SCHEME +// USE_OLD_INLINE_CLASSES_MANGLING_SCHEME // FILE: A.kt package a diff --git a/compiler/testData/codegen/box/compileKotlinAgainstKotlin/privateTopLevelValInDifferentModuleOldMangling.kt b/compiler/testData/codegen/box/compileKotlinAgainstKotlin/privateTopLevelValInDifferentModuleOldMangling.kt index adc2b7119f1..13f01a8f87f 100644 --- a/compiler/testData/codegen/box/compileKotlinAgainstKotlin/privateTopLevelValInDifferentModuleOldMangling.kt +++ b/compiler/testData/codegen/box/compileKotlinAgainstKotlin/privateTopLevelValInDifferentModuleOldMangling.kt @@ -4,7 +4,7 @@ // WITH_REFLECT // MODULE: lib -// KOTLIN_CONFIGURATION_FLAGS: +JVM.USE_OLD_INLINE_CLASSES_MANGLING_SCHEME +// USE_OLD_INLINE_CLASSES_MANGLING_SCHEME // FILE: A.kt package a diff --git a/compiler/testData/codegen/box/compileKotlinAgainstKotlin/suspendFunWithDefaultOldMangling.kt b/compiler/testData/codegen/box/compileKotlinAgainstKotlin/suspendFunWithDefaultOldMangling.kt index 5ce925d1188..c531356ccb0 100644 --- a/compiler/testData/codegen/box/compileKotlinAgainstKotlin/suspendFunWithDefaultOldMangling.kt +++ b/compiler/testData/codegen/box/compileKotlinAgainstKotlin/suspendFunWithDefaultOldMangling.kt @@ -3,7 +3,7 @@ // !LANGUAGE: +InlineClasses // WITH_STDLIB // MODULE: lib -// KOTLIN_CONFIGURATION_FLAGS: +JVM.USE_OLD_INLINE_CLASSES_MANGLING_SCHEME +// USE_OLD_INLINE_CLASSES_MANGLING_SCHEME // FILE: a.kt package a diff --git a/compiler/testData/codegen/box/ranges/contains/inUntilMaxValue.kt b/compiler/testData/codegen/box/ranges/contains/inUntilMaxValue.kt index 6d7eaa554f5..71f2b6f7692 100644 --- a/compiler/testData/codegen/box/ranges/contains/inUntilMaxValue.kt +++ b/compiler/testData/codegen/box/ranges/contains/inUntilMaxValue.kt @@ -1,6 +1,6 @@ // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME -// KOTLIN_CONFIGURATION_FLAGS: +JVM.USE_OLD_INLINE_CLASSES_MANGLING_SCHEME +// USE_OLD_INLINE_CLASSES_MANGLING_SCHEME fun box(): String { if (Char.MAX_VALUE in Char.MAX_VALUE until Char.MAX_VALUE) return "Fail in Char.MAX_VALUE" @@ -19,4 +19,4 @@ fun box(): String { if (!(ULong.MAX_VALUE !in ULong.MAX_VALUE until ULong.MAX_VALUE)) return "Fail !in ULong.MAX_VALUE" return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/ranges/contains/inUntilMinValue.kt b/compiler/testData/codegen/box/ranges/contains/inUntilMinValue.kt index 02e05512f22..79146450a63 100644 --- a/compiler/testData/codegen/box/ranges/contains/inUntilMinValue.kt +++ b/compiler/testData/codegen/box/ranges/contains/inUntilMinValue.kt @@ -1,6 +1,6 @@ // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME -// KOTLIN_CONFIGURATION_FLAGS: +JVM.USE_OLD_INLINE_CLASSES_MANGLING_SCHEME +// USE_OLD_INLINE_CLASSES_MANGLING_SCHEME fun box(): String { if ('b' in 'a' until Char.MIN_VALUE) return "Fail in Char.MIN_VALUE" @@ -19,4 +19,4 @@ fun box(): String { if (!(1uL !in 0uL until ULong.MIN_VALUE)) return "Fail !in ULong.MIN_VALUE" return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/ranges/contains/inUntilMinValueNonConst.kt b/compiler/testData/codegen/box/ranges/contains/inUntilMinValueNonConst.kt index cbd0898d652..285ed90b400 100644 --- a/compiler/testData/codegen/box/ranges/contains/inUntilMinValueNonConst.kt +++ b/compiler/testData/codegen/box/ranges/contains/inUntilMinValueNonConst.kt @@ -1,6 +1,6 @@ // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME -// KOTLIN_CONFIGURATION_FLAGS: +JVM.USE_OLD_INLINE_CLASSES_MANGLING_SCHEME +// USE_OLD_INLINE_CLASSES_MANGLING_SCHEME fun box(): String { val charBound = Char.MIN_VALUE @@ -24,4 +24,4 @@ fun box(): String { if (!(1uL !in 0uL until uLongBound)) return "Fail !in ULong.MIN_VALUE" return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/unsignedTypes/unsignedRangeIterator.kt b/compiler/testData/codegen/box/unsignedTypes/unsignedRangeIterator.kt index 4932f2971e6..231ed35f7a1 100644 --- a/compiler/testData/codegen/box/unsignedTypes/unsignedRangeIterator.kt +++ b/compiler/testData/codegen/box/unsignedTypes/unsignedRangeIterator.kt @@ -1,6 +1,6 @@ // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME -// KOTLIN_CONFIGURATION_FLAGS: +JVM.USE_OLD_INLINE_CLASSES_MANGLING_SCHEME +// USE_OLD_INLINE_CLASSES_MANGLING_SCHEME fun testUIntRangeForEach() { var s = 0 @@ -42,4 +42,4 @@ fun box(): String { testULongProgressionForEach() return "OK" -} \ No newline at end of file +} diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/JvmEnvironmentConfigurationDirectives.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/JvmEnvironmentConfigurationDirectives.kt index 7284c782bea..5e16746d2b8 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/JvmEnvironmentConfigurationDirectives.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/JvmEnvironmentConfigurationDirectives.kt @@ -54,8 +54,13 @@ object JvmEnvironmentConfigurationDirectives : SimpleDirectivesContainer() { additionalParser = JVMConstructorCallNormalizationMode.Companion::fromStringOrNull ) + @Suppress("RemoveExplicitTypeArguments") val SAM_CONVERSIONS by enumDirective( description = "SAM conversion code generation scheme", additionalParser = JvmSamConversions.Companion::fromString ) + + val USE_OLD_INLINE_CLASSES_MANGLING_SCHEME by directive( + description = "Enable old mangling scheme for inline classes" + ) } diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/JvmEnvironmentConfigurator.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/JvmEnvironmentConfigurator.kt index e69850d3bc8..ba8c614bc3e 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/JvmEnvironmentConfigurator.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/JvmEnvironmentConfigurator.kt @@ -23,6 +23,7 @@ import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirective import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives.CONSTRUCTOR_CALL_NORMALIZATION_MODE import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives.SAM_CONVERSIONS import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives.STRING_CONCAT +import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives.USE_OLD_INLINE_CLASSES_MANGLING_SCHEME import org.jetbrains.kotlin.test.directives.LanguageSettingsDirectives import org.jetbrains.kotlin.test.directives.model.DirectivesContainer import org.jetbrains.kotlin.test.directives.model.RegisteredDirectives @@ -53,6 +54,7 @@ class JvmEnvironmentConfigurator(testServices: TestServices) : EnvironmentConfig register(ASSERTIONS_MODE, JVMConfigurationKeys.ASSERTIONS_MODE) register(CONSTRUCTOR_CALL_NORMALIZATION_MODE, JVMConfigurationKeys.CONSTRUCTOR_CALL_NORMALIZATION_MODE) register(SAM_CONVERSIONS, JVMConfigurationKeys.SAM_CONVERSIONS) + register(USE_OLD_INLINE_CLASSES_MANGLING_SCHEME, JVMConfigurationKeys.USE_OLD_INLINE_CLASSES_MANGLING_SCHEME) } override fun configureCompilerConfiguration(configuration: CompilerConfiguration, module: TestModule, project: MockProject) {