Skip to content

Commit 25ff2c5

Browse files
dzharkovSpace Team
authored andcommitted
JVM BE: Ignore a recently introduced test for JVM ABI K1/K2 comparison
The test depends on LanguageFeature.EqualityConstraintForOperatorsUnderAssignments (from 2.3) which effectively is seen as disabled for the K2 pipeline because `supportsFeature` is still delegated to the language settings from the K1 pipeline (see delegated anonymous object at org.jetbrains.kotlin.test.TestSetupUtilsKt.runWithEnablingFirUseOption)
1 parent 1f6a5f8 commit 25ff2c5

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

compiler/testData/codegen/box/inference/ifWithAssignmentAndNothingBranch.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// IGNORE_JVM_ABI_K1_K2
12
// ISSUE: KT-78127
23

34
fun <T : Any> materialize(): T {

compiler/tests-common-new/testFixtures/org/jetbrains/kotlin/test/backend/ir/AbiCheckerSuppressor.kt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import org.jetbrains.kotlin.test.backend.BlackBoxCodegenSuppressor
1010
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.IGNORE_BACKEND
1111
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.IGNORE_BACKEND_K1
1212
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.IGNORE_BACKEND_K2
13+
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.IGNORE_JVM_ABI_K1_K2
1314
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.JVM_ABI_K1_K2_DIFF
1415
import org.jetbrains.kotlin.test.model.AfterAnalysisChecker
1516
import org.jetbrains.kotlin.test.services.ServiceRegistrationData
@@ -35,6 +36,21 @@ class AbiCheckerSuppressor(testServices: TestServices) : AfterAnalysisChecker(te
3536
}
3637
return emptyList()
3738
}
39+
40+
// Some test might be both green in K1 and with a default language version in K2,
41+
// but K2 mode is effectively run with `supportsFeature` working just as the LV were set to 1.9
42+
// (see delegated anonymous object at org.jetbrains.kotlin.test.TestSetupUtilsKt.runWithEnablingFirUseOption).
43+
// And while the mission for JvmAbiConsistencyTest seems to be completed, it's ok sometimes to skip it for the newer test,
44+
// at least with trivial generated ABI.
45+
if (testServices.moduleStructure.allDirectives.contains(IGNORE_JVM_ABI_K1_K2)) {
46+
if (failedAssertions.isEmpty()) {
47+
return listOf(
48+
AssertionError("Test contains ${IGNORE_JVM_ABI_K1_K2.name} both pipelines are successful.").wrap()
49+
)
50+
}
51+
return emptyList()
52+
}
53+
3854
return failedAssertions
3955
}
4056
}

compiler/tests-common-new/testFixtures/org/jetbrains/kotlin/test/directives/CodegenTestDirectives.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,11 @@ object CodegenTestDirectives : SimpleDirectivesContainer() {
240240
applicability = Global
241241
)
242242

243+
val IGNORE_JVM_ABI_K1_K2 by stringDirective(
244+
description = "Ignore failures when running pipelines when computing difference in JVM ABI between K1 and K2",
245+
applicability = Global
246+
)
247+
243248
val DISABLE_IR_VISIBILITY_CHECKS by enumDirective<TargetBackend>(
244249
description = "Don't check for visibility violations when validating IR on the target backend"
245250
)

0 commit comments

Comments
 (0)