File tree Expand file tree Collapse file tree 3 files changed +21
-2
lines changed
compiler/tests-common-new/testFixtures/org/jetbrains/kotlin/test
native/native.tests/testFixtures/org/jetbrains/kotlin/konan/test/blackbox/support/group Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -245,6 +245,15 @@ object CodegenTestDirectives : SimpleDirectivesContainer() {
245245 applicability = Global
246246 )
247247
248+ // TODO: Drop this directive and make the offset validation enabled by default when KT-81475 is fixed.
249+ val ENABLE_IR_NESTED_OFFSETS_CHECKS by stringDirective(
250+ description = " Enables validation of the nested IR elements offsets"
251+ )
252+
253+ val DISABLE_IR_NESTED_OFFSETS_CHECKS by enumDirective<TargetBackend >(
254+ description = " Disabled validation of the nested IR elements offsets on the target backend"
255+ )
256+
248257 val DISABLE_IR_VISIBILITY_CHECKS by enumDirective<TargetBackend >(
249258 description = " Don't check for visibility violations when validating IR on the target backend"
250259 )
Original file line number Diff line number Diff line change @@ -180,6 +180,9 @@ fun createCompilerConfiguration(
180180 configuration.enableIrVisibilityChecks = ! CodegenTestDirectives .DISABLE_IR_VISIBILITY_CHECKS .isApplicableTo(module, testServices)
181181 configuration.enableIrVarargTypesChecks = ! CodegenTestDirectives .DISABLE_IR_VARARG_TYPE_CHECKS .isApplicableTo(module, testServices)
182182
183+ configuration.enableIrNestedOffsetsChecks = CodegenTestDirectives .ENABLE_IR_NESTED_OFFSETS_CHECKS in module.directives &&
184+ ! CodegenTestDirectives .DISABLE_IR_NESTED_OFFSETS_CHECKS .isApplicableTo(module, testServices)
185+
183186 val messageCollector = MessageCollectorForCompilerTests (System .err, CompilerTestMessageRenderer (module))
184187 configuration.messageCollector = messageCollector
185188 configuration.languageVersionSettings = module.languageVersionSettings
Original file line number Diff line number Diff line change @@ -48,11 +48,9 @@ import org.jetbrains.kotlin.test.InTextDirectivesUtils.isDirectiveDefined
4848import org.jetbrains.kotlin.test.directives.CodegenTestDirectives
4949import org.jetbrains.kotlin.test.directives.LanguageSettingsDirectives.RETURN_VALUE_CHECKER_MODE
5050import org.jetbrains.kotlin.test.directives.model.RegisteredDirectives
51- import org.jetbrains.kotlin.test.frontend.classic.handlers.ClassicUnstableAndK2LanguageFeaturesSkipConfigurator
5251import org.jetbrains.kotlin.test.services.JUnit5Assertions.assertFalse
5352import org.jetbrains.kotlin.test.services.JUnit5Assertions.assertTrue
5453import org.jetbrains.kotlin.test.services.JUnit5Assertions.fail
55- import org.jetbrains.kotlin.test.util.parseLanguageFeature
5654import org.jetbrains.kotlin.utils.addIfNotNull
5755import java.io.File
5856
@@ -196,6 +194,15 @@ private class ExtTestDataFile(
196194 ) {
197195 args.add(" -Xverify-ir-visibility" )
198196 }
197+
198+ if ((structure.directives.contains(CodegenTestDirectives .ENABLE_IR_NESTED_OFFSETS_CHECKS ) ||
199+ defaultDirectives.contains(CodegenTestDirectives .ENABLE_IR_NESTED_OFFSETS_CHECKS )) &&
200+ ! structure.directives[CodegenTestDirectives .DISABLE_IR_NESTED_OFFSETS_CHECKS ].containsNativeOrAny &&
201+ ! defaultDirectives[CodegenTestDirectives .DISABLE_IR_NESTED_OFFSETS_CHECKS ].containsNativeOrAny
202+ ) {
203+ args.add(" -Xverify-ir-nested-offsets" )
204+ }
205+
199206 args + = " -opt-in=kotlin.native.internal.InternalForKotlinNative" // for `Any.isPermanent()` and `Any.isStack()`
200207 args + = " -opt-in=kotlin.native.internal.InternalForKotlinNativeTests" // for ReflectionPackageName
201208 if (! settings.withPlatformLibs && ! structure.directives.contains(WITH_PLATFORM_LIBS ))
You can’t perform that action at this time.
0 commit comments