diff --git a/kotlin-native/backend.native/tests/build.gradle b/kotlin-native/backend.native/tests/build.gradle index 6da93396b15..290e0c7d779 100644 --- a/kotlin-native/backend.native/tests/build.gradle +++ b/kotlin-native/backend.native/tests/build.gradle @@ -3305,6 +3305,14 @@ standaloneTest("codegen_escapeAnalysis_stackAllocated") { source = "codegen/escapeAnalysis/stackAllocated.kt" } +standaloneTest("codegen_escapeAnalysis_string") { + disabled = (cacheTesting != null) || // Cache is not compatible with -opt. + project.globalTestArgs.contains('-g') || // -g and -opt are incompatible + !isExperimentalMM // strings are frozen in legacy GC + flags = ['-opt', '-tr', '-opt-in=kotlin.native.internal.InternalForKotlinNative'] + source = "codegen/escapeAnalysis/string.kt" +} + task memory_var1(type: KonanLocalTest) { source = "runtime/memory/var1.kt" } diff --git a/kotlin-native/backend.native/tests/codegen/escapeAnalysis/string.kt b/kotlin-native/backend.native/tests/codegen/escapeAnalysis/string.kt new file mode 100644 index 00000000000..f542ce8eeb6 --- /dev/null +++ b/kotlin-native/backend.native/tests/codegen/escapeAnalysis/string.kt @@ -0,0 +1,14 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +package codegen.escapeAnalysis.string + +import kotlin.test.* +import kotlin.native.internal.* + +@Test fun runTest() { + val s = String() + assertTrue(s.isLocal()) +}