diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmLower.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmLower.kt index 14a8c999d86..e1a2fabb7c0 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmLower.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmLower.kt @@ -37,6 +37,12 @@ private fun makePatchParentsPhase(number: Int) = namedIrFilePhase( nlevels = 0 ) +private val expectDeclarationsRemovingPhase = makeIrFilePhase( + ::ExpectDeclarationsRemoving, + name = "ExpectDeclarationsRemoving", + description = "Remove expect declaration from module fragment" +) + private val propertiesPhase = makeIrFilePhase( { context -> PropertiesLowering(context, JvmLoweredDeclarationOrigin.SYNTHETIC_METHOD_FOR_PROPERTY_ANNOTATIONS) { propertyName -> @@ -51,7 +57,8 @@ private val propertiesPhase = makeIrFilePhase( internal val jvmPhases = namedIrFilePhase( name = "IrLowering", description = "IR lowering", - lower = jvmCoercionToUnitPhase then + lower = expectDeclarationsRemovingPhase then + jvmCoercionToUnitPhase then fileClassPhase then kCallableNamePropertyPhase then diff --git a/compiler/testData/codegen/box/multiplatform/defaultArguments/bothInExpectAndActual.kt b/compiler/testData/codegen/box/multiplatform/defaultArguments/bothInExpectAndActual.kt index 4e23ead306d..6b56a9b4592 100644 --- a/compiler/testData/codegen/box/multiplatform/defaultArguments/bothInExpectAndActual.kt +++ b/compiler/testData/codegen/box/multiplatform/defaultArguments/bothInExpectAndActual.kt @@ -1,5 +1,5 @@ // !LANGUAGE: +MultiPlatformProjects -// IGNORE_BACKEND: JVM_IR, NATIVE +// IGNORE_BACKEND: NATIVE // FILE: common.kt public expect fun Array.copyInto( diff --git a/compiler/testData/codegen/box/multiplatform/defaultArguments/bothInExpectAndActual2.kt b/compiler/testData/codegen/box/multiplatform/defaultArguments/bothInExpectAndActual2.kt index 431ad307f58..3974053cdc8 100644 --- a/compiler/testData/codegen/box/multiplatform/defaultArguments/bothInExpectAndActual2.kt +++ b/compiler/testData/codegen/box/multiplatform/defaultArguments/bothInExpectAndActual2.kt @@ -1,5 +1,5 @@ // !LANGUAGE: +MultiPlatformProjects -// IGNORE_BACKEND: JVM_IR, NATIVE +// IGNORE_BACKEND: NATIVE // FILE: common.kt expect interface I { diff --git a/compiler/testData/codegen/box/multiplatform/defaultArguments/constructor.kt b/compiler/testData/codegen/box/multiplatform/defaultArguments/constructor.kt index 3d18adacce5..b9ecb11356c 100644 --- a/compiler/testData/codegen/box/multiplatform/defaultArguments/constructor.kt +++ b/compiler/testData/codegen/box/multiplatform/defaultArguments/constructor.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +MultiPlatformProjects -// IGNORE_BACKEND: JVM_IR // WITH_RUNTIME // FILE: common.kt diff --git a/compiler/testData/codegen/box/multiplatform/defaultArguments/dispatchReceiverValue.kt b/compiler/testData/codegen/box/multiplatform/defaultArguments/dispatchReceiverValue.kt index 8423a1c30cd..b93a0c189ab 100644 --- a/compiler/testData/codegen/box/multiplatform/defaultArguments/dispatchReceiverValue.kt +++ b/compiler/testData/codegen/box/multiplatform/defaultArguments/dispatchReceiverValue.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +MultiPlatformProjects -// IGNORE_BACKEND: JVM_IR // FILE: common.kt diff --git a/compiler/testData/codegen/box/multiplatform/defaultArguments/extensionReceiverValue.kt b/compiler/testData/codegen/box/multiplatform/defaultArguments/extensionReceiverValue.kt index 2cb06f51c6e..9f8c33145b2 100644 --- a/compiler/testData/codegen/box/multiplatform/defaultArguments/extensionReceiverValue.kt +++ b/compiler/testData/codegen/box/multiplatform/defaultArguments/extensionReceiverValue.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +MultiPlatformProjects -// IGNORE_BACKEND: JVM_IR // FILE: common.kt diff --git a/compiler/testData/codegen/box/multiplatform/defaultArguments/function.kt b/compiler/testData/codegen/box/multiplatform/defaultArguments/function.kt index 53f7f987aea..ba521667c6c 100644 --- a/compiler/testData/codegen/box/multiplatform/defaultArguments/function.kt +++ b/compiler/testData/codegen/box/multiplatform/defaultArguments/function.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +MultiPlatformProjects -// IGNORE_BACKEND: JVM_IR // WITH_RUNTIME // FILE: common.kt diff --git a/compiler/testData/codegen/box/multiplatform/defaultArguments/inheritedFromCommonClass.kt b/compiler/testData/codegen/box/multiplatform/defaultArguments/inheritedFromCommonClass.kt index 658cd7d94b2..d1482e4be44 100644 --- a/compiler/testData/codegen/box/multiplatform/defaultArguments/inheritedFromCommonClass.kt +++ b/compiler/testData/codegen/box/multiplatform/defaultArguments/inheritedFromCommonClass.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +MultiPlatformProjects -// IGNORE_BACKEND: JVM_IR // WITH_RUNTIME // FILE: common.kt diff --git a/compiler/testData/codegen/box/multiplatform/defaultArguments/inheritedFromExpectedClass.kt b/compiler/testData/codegen/box/multiplatform/defaultArguments/inheritedFromExpectedClass.kt index 23aae686691..0c4d319f8e3 100644 --- a/compiler/testData/codegen/box/multiplatform/defaultArguments/inheritedFromExpectedClass.kt +++ b/compiler/testData/codegen/box/multiplatform/defaultArguments/inheritedFromExpectedClass.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +MultiPlatformProjects -// IGNORE_BACKEND: JVM_IR // WITH_RUNTIME // FILE: common.kt diff --git a/compiler/testData/codegen/box/multiplatform/defaultArguments/inheritedFromExpectedInterface.kt b/compiler/testData/codegen/box/multiplatform/defaultArguments/inheritedFromExpectedInterface.kt index 7793809e421..97f349ebc2f 100644 --- a/compiler/testData/codegen/box/multiplatform/defaultArguments/inheritedFromExpectedInterface.kt +++ b/compiler/testData/codegen/box/multiplatform/defaultArguments/inheritedFromExpectedInterface.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +MultiPlatformProjects -// IGNORE_BACKEND: JVM_IR // FILE: lib.kt expect interface I { diff --git a/compiler/testData/codegen/box/multiplatform/defaultArguments/inheritedFromExpectedMethod.kt b/compiler/testData/codegen/box/multiplatform/defaultArguments/inheritedFromExpectedMethod.kt index c4ea69ccf78..63e1ad8803c 100644 --- a/compiler/testData/codegen/box/multiplatform/defaultArguments/inheritedFromExpectedMethod.kt +++ b/compiler/testData/codegen/box/multiplatform/defaultArguments/inheritedFromExpectedMethod.kt @@ -1,6 +1,5 @@ // !LANGUAGE: +MultiPlatformProjects // WITH_RUNTIME -// IGNORE_BACKEND: JVM_IR // FILE: common.kt expect open class C() { diff --git a/compiler/testData/codegen/box/multiplatform/defaultArguments/inheritedInExpectedDeclarations.kt b/compiler/testData/codegen/box/multiplatform/defaultArguments/inheritedInExpectedDeclarations.kt index abe6f5ca198..aa6b60ae1ff 100644 --- a/compiler/testData/codegen/box/multiplatform/defaultArguments/inheritedInExpectedDeclarations.kt +++ b/compiler/testData/codegen/box/multiplatform/defaultArguments/inheritedInExpectedDeclarations.kt @@ -1,6 +1,5 @@ // !LANGUAGE: +MultiPlatformProjects // WITH_RUNTIME -// IGNORE_BACKEND: JVM_IR // FILE: common.kt expect open class A() { diff --git a/compiler/testData/codegen/box/multiplatform/defaultArguments/inheritedViaAnotherInterfaceIndirectly.kt b/compiler/testData/codegen/box/multiplatform/defaultArguments/inheritedViaAnotherInterfaceIndirectly.kt index c4b8332d606..ccb1059ca15 100644 --- a/compiler/testData/codegen/box/multiplatform/defaultArguments/inheritedViaAnotherInterfaceIndirectly.kt +++ b/compiler/testData/codegen/box/multiplatform/defaultArguments/inheritedViaAnotherInterfaceIndirectly.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +MultiPlatformProjects -// IGNORE_BACKEND: JVM_IR // FILE: lib.kt diff --git a/compiler/testData/codegen/box/multiplatform/defaultArguments/jvmOverloads.kt b/compiler/testData/codegen/box/multiplatform/defaultArguments/jvmOverloads.kt index 25c5e1c4b9d..700e90f9b5f 100644 --- a/compiler/testData/codegen/box/multiplatform/defaultArguments/jvmOverloads.kt +++ b/compiler/testData/codegen/box/multiplatform/defaultArguments/jvmOverloads.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +MultiPlatformProjects -// IGNORE_BACKEND: JVM_IR // TARGET_BACKEND: JVM // WITH_RUNTIME // FILE: J.java diff --git a/compiler/testData/codegen/box/multiplatform/defaultArguments/kt23239.kt b/compiler/testData/codegen/box/multiplatform/defaultArguments/kt23239.kt index 55334ec1fda..93667c0d415 100644 --- a/compiler/testData/codegen/box/multiplatform/defaultArguments/kt23239.kt +++ b/compiler/testData/codegen/box/multiplatform/defaultArguments/kt23239.kt @@ -1,6 +1,5 @@ // !LANGUAGE: +MultiPlatformProjects // WITH_RUNTIME -// IGNORE_BACKEND: JVM_IR // FILE: common.kt expect open class C() { diff --git a/compiler/testData/codegen/box/multiplatform/defaultArguments/kt23739.kt b/compiler/testData/codegen/box/multiplatform/defaultArguments/kt23739.kt index edf577e31fd..986d18ffaa0 100644 --- a/compiler/testData/codegen/box/multiplatform/defaultArguments/kt23739.kt +++ b/compiler/testData/codegen/box/multiplatform/defaultArguments/kt23739.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +MultiPlatformProjects -// IGNORE_BACKEND: JVM_IR // FILE: common.kt // A LOT OF LINES diff --git a/compiler/testData/codegen/box/multiplatform/defaultArguments/parametersInArgumentValues.kt b/compiler/testData/codegen/box/multiplatform/defaultArguments/parametersInArgumentValues.kt index a06969933c1..0b6b0757211 100644 --- a/compiler/testData/codegen/box/multiplatform/defaultArguments/parametersInArgumentValues.kt +++ b/compiler/testData/codegen/box/multiplatform/defaultArguments/parametersInArgumentValues.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +MultiPlatformProjects -// IGNORE_BACKEND: JVM_IR // FILE: common.kt diff --git a/compiler/testData/codegen/box/multiplatform/optionalExpectation.kt b/compiler/testData/codegen/box/multiplatform/optionalExpectation.kt index f4dd337e0e4..bff1124353c 100644 --- a/compiler/testData/codegen/box/multiplatform/optionalExpectation.kt +++ b/compiler/testData/codegen/box/multiplatform/optionalExpectation.kt @@ -1,7 +1,6 @@ // !LANGUAGE: +MultiPlatformProjects // !USE_EXPERIMENTAL: kotlin.ExperimentalMultiplatform // IGNORE_BACKEND: NATIVE -// IGNORE_BACKEND: JVM_IR // IGNORE_BACKEND: JS_IR // WITH_RUNTIME // MODULE: library