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.
This commit is contained in:
Svyatoslav Scherbina
2023-06-21 14:49:24 +02:00
committed by Space Team
parent 13baf43ae3
commit 41247e8cef
@@ -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") }
fun main() { println(f(10, "123456")) }