[K/N] Migrate most simple filecheck tests to new infra

^KT-62157


Merge-request: KT-MR-12376
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
This commit is contained in:
Vladimir Sukharev
2023-10-23 10:07:28 +00:00
committed by Space Team
parent 3d399a8b25
commit e43b634122
113 changed files with 3245 additions and 1595 deletions
@@ -0,0 +1,29 @@
// TARGET_BACKEND: NATIVE
// FILECHECK_STAGE: OptimizeTLSDataLoads
class Wrapper(x: Int)
// CHECK-LABEL: define internal fastcc %struct.ObjHeader* @"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)
return buildString {
for (i in a) { appendLine("$s i") }
}
// CHECK-LABEL: epilogue:
}
fun box(): String {
val result = f(10, "123456")
return if (result == "123456 i\n" +
"123456 i\n" +
"123456 i\n" +
"123456 i\n" +
"123456 i\n")
"OK"
else "FAIL: $result"
}