[K/N] Migrate filecheck test redundant_safepoints to new infra

^KT-62157
This commit is contained in:
Vladimir Sukharev
2023-10-27 22:51:09 +02:00
committed by Space Team
parent 35b83a1225
commit 35e5b0613d
10 changed files with 96 additions and 69 deletions
@@ -2975,26 +2975,6 @@ Task fileCheckTest(String name, Closure<FileCheckTest> configureClosure) {
}
}
if (HostManager.@Companion.hostIsMac) {
fileCheckTest("filecheck_redundant_safepoints_removal_smallbinary") {
enabled = project.globalTestArgs.contains("-opt")
annotatedSource = project.file('filecheck/redundant_safepoints.kt')
targetName = "watchos_arm32"
checkPrefix = "CHECK-SMALLBINARY"
extraOpts = ["-opt"]
phaseToCheck = "RemoveRedundantSafepoints"
}
}
fileCheckTest("filecheck_redundant_safepoints_removal") {
enabled = !isNoopGC && !isSTWMSGC &&
project.globalTestArgs.contains("-opt") &&
!PlatformInfo.needSmallBinary(project)
annotatedSource = project.file('filecheck/redundant_safepoints.kt')
phaseToCheck = "RemoveRedundantSafepoints"
}
createInterop("filecheck_signext_zeroext_interop_input") {
it.defFile 'filecheck/signext_zeroext_interop_input.def'
}
@@ -1,49 +0,0 @@
/*
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
import kotlin.native.Retain
class C
fun f(): Any {
return C()
}
fun g() = f()
// CHECK-LABEL: define %struct.ObjHeader* @"kfun:#h(kotlin.Boolean){}kotlin.Any"
@Retain
fun h(cond: Boolean): Any {
// CHECK: _ZN12_GLOBAL__N_115safePointActionE
// CHECK-SMALLBINARY: {{call .*Kotlin_mm_safePointFunctionPrologue}}
// CHECK-NOT: _ZN12_GLOBAL__N_115safePointActionE
// CHECK-NOT: {{call .*Kotlin_mm_safePointFunctionPrologue}}
// CHECK: br
// CHECK-SMALLBINARY: br
if (cond) {
// CHECK-NOT: _ZN12_GLOBAL__N_115safePointActionE
// CHECK-NOT: {{call .*Kotlin_mm_safePointFunctionPrologue}}
// CHECK: br
// CHECK-SMALLBINARY: br
return listOf(C(), C())
} else {
// CHECK-NOT: _ZN12_GLOBAL__N_115safePointActionE
// CHECK-NOT: {{call .*Kotlin_mm_safePointFunctionPrologue}}
return listOf(C(), C(), C())
}
// CHECK: }
}
// CHECK-LABEL: define void @"kfun:#main(){}"()
@Retain
fun main() {
// CHECK: _ZN12_GLOBAL__N_115safePointActionE
// CHECK-SMALLBINARY: {{call .*Kotlin_mm_safePointFunctionPrologue}}
// CHECK-NOT: _ZN12_GLOBAL__N_115safePointActionE
// CHECK-NOT: {{call .*Kotlin_mm_safePointFunctionPrologue}}
println(g())
println(h(true))
// CHECK: }
}