From 41247e8cef8a1710775695c41b663143d6fef942 Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Wed, 21 Jun 2023 14:49:24 +0200 Subject: [PATCH] Native: workaround KT-59552 in filecheck_single_tls_load test After recent changes (0cfb801) println got inlined into the checked function. As a result, the test became affected by KT-59552. Fix the test by moving println out of the checked function. --- .../backend.native/tests/filecheck/single_tls_load.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/kotlin-native/backend.native/tests/filecheck/single_tls_load.kt b/kotlin-native/backend.native/tests/filecheck/single_tls_load.kt index d48adf0c520..92e299fe153 100644 --- a/kotlin-native/backend.native/tests/filecheck/single_tls_load.kt +++ b/kotlin-native/backend.native/tests/filecheck/single_tls_load.kt @@ -5,16 +5,18 @@ class Wrapper(x: Int) -// CHECK-LABEL: "kfun:#f(kotlin.Int;kotlin.String){}" -fun f(x: Int, s: String) { +// CHECK-LABEL: "kfun:#f(kotlin.Int;kotlin.String){}kotlin.String" +fun f(x: Int, s: String): String { // CHECK: _ZN6kotlin2mm14ThreadRegistry22currentThreadDataNode_E // CHECK-NOT: _ZN6kotlin2mm14ThreadRegistry22currentThreadDataNode_E if (x < 0) throw IllegalStateException() if (x > 0) return f(x - 1, s) val b = Wrapper(2) val a = listOf(x, x, Wrapper(1), 2, x) - for (i in a) { println("$s i") } + return buildString { + for (i in a) { appendLine("$s i") } + } // CHECK: {{^}$}} } -fun main() { f(10, "123456") } \ No newline at end of file +fun main() { println(f(10, "123456")) }