[K/N] Fix filecheck test for redundant safepoints removal
This commit is contained in:
@@ -6053,13 +6053,24 @@ if (HostManager.@Companion.hostIsMac) {
|
||||
phaseToCheck = "BitcodeOptimization"
|
||||
}
|
||||
|
||||
fileCheckTest("filecheck_redundant_safepoints_removal") {
|
||||
fileCheckTest("filecheck_redundant_safepoints_removal_arm") {
|
||||
enabled = isExperimentalMM && project.globalTestArgs.contains("-opt")
|
||||
annotatedSource = project.file('filecheck/redundant_safepoints.kt')
|
||||
targetName = "watchos_arm32"
|
||||
checkPrefix = "CHECK-ARM"
|
||||
extraOpts = ["-Xbinary=memoryModel=experimental", "-opt"]
|
||||
phaseToCheck = "RemoveRedundantSafepoints"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fileCheckTest("filecheck_redundant_safepoints_removal") {
|
||||
enabled = isExperimentalMM &&
|
||||
project.globalTestArgs.contains("-opt") &&
|
||||
project.testTarget != "watchos_arm32" &&
|
||||
project.testTarget != "ios_arm32"
|
||||
annotatedSource = project.file('filecheck/redundant_safepoints.kt')
|
||||
phaseToCheck = "RemoveRedundantSafepoints"
|
||||
}
|
||||
|
||||
fileCheckTest("filecheck_replace_invoke_with_call") {
|
||||
|
||||
@@ -15,17 +15,21 @@ fun g() = f()
|
||||
// CHECK-LABEL: define %struct.ObjHeader* @"kfun:#h(kotlin.Boolean){}kotlin.Any"
|
||||
@Retain
|
||||
fun h(cond: Boolean): Any {
|
||||
// CHECK: Kotlin_mm_safePointFunctionPrologue
|
||||
// CHECK-NOT: Kotlin_mm_safePointFunctionPrologue
|
||||
// CHECK: _ZN6kotlin2mm8internal20gSuspensionRequestedE
|
||||
// CHECK-ARM: {{call .*Kotlin_mm_safePointFunctionPrologue}}
|
||||
// CHECK-NOT: _ZN6kotlin2mm8internal20gSuspensionRequestedE
|
||||
// CHECK-NOT: {{call .*Kotlin_mm_safePointFunctionPrologue}}
|
||||
// CHECK: br
|
||||
// CHECK-ARM: br
|
||||
if (cond) {
|
||||
// CHECK: Kotlin_mm_safePointFunctionPrologue
|
||||
// CHECK-NOT: Kotlin_mm_safePointFunctionPrologue
|
||||
// CHECK-NOT: _ZN6kotlin2mm8internal20gSuspensionRequestedE
|
||||
// CHECK-NOT: {{call .*Kotlin_mm_safePointFunctionPrologue}}
|
||||
// CHECK: br
|
||||
// CHECK-ARM: br
|
||||
return listOf(C(), C())
|
||||
} else {
|
||||
// CHECK: Kotlin_mm_safePointFunctionPrologue
|
||||
// CHECK-NOT: Kotlin_mm_safePointFunctionPrologue
|
||||
// CHECK-NOT: _ZN6kotlin2mm8internal20gSuspensionRequestedE
|
||||
// CHECK-NOT: {{call .*Kotlin_mm_safePointFunctionPrologue}}
|
||||
return listOf(C(), C(), C())
|
||||
}
|
||||
// CHECK: }
|
||||
@@ -34,8 +38,10 @@ fun h(cond: Boolean): Any {
|
||||
// CHECK-LABEL: define void @"kfun:#main(){}"()
|
||||
@Retain
|
||||
fun main() {
|
||||
// CHECK: Kotlin_mm_safePointFunctionPrologue
|
||||
// CHECK-NOT: Kotlin_mm_safePointFunctionPrologue
|
||||
// CHECK: _ZN6kotlin2mm8internal20gSuspensionRequestedE
|
||||
// CHECK-ARM: {{call .*Kotlin_mm_safePointFunctionPrologue}}
|
||||
// CHECK-NOT: _ZN6kotlin2mm8internal20gSuspensionRequestedE
|
||||
// CHECK-NOT: {{call .*Kotlin_mm_safePointFunctionPrologue}}
|
||||
println(g())
|
||||
println(h(true))
|
||||
// CHECK: }
|
||||
|
||||
Reference in New Issue
Block a user