[K/N] Add test for tls load optimisation
^KT-50139
This commit is contained in:
@@ -6037,6 +6037,12 @@ fileCheckTest("filecheck_adopted_function_reference") {
|
|||||||
annotatedSource = project.file('filecheck/adopted_function_reference.kt')
|
annotatedSource = project.file('filecheck/adopted_function_reference.kt')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fileCheckTest("filecheck_single_tls_load") {
|
||||||
|
enabled = isExperimentalMM && project.globalTestArgs.contains("-opt")
|
||||||
|
annotatedSource = project.file('filecheck/single_tls_load.kt')
|
||||||
|
phaseToCheck = "OptimizeTLSDataLoads"
|
||||||
|
}
|
||||||
|
|
||||||
fileCheckTest("filecheck_signext_zeroext0") {
|
fileCheckTest("filecheck_signext_zeroext0") {
|
||||||
annotatedSource = project.file('filecheck/signext_zeroext0.kt')
|
annotatedSource = project.file('filecheck/signext_zeroext0.kt')
|
||||||
if (project.testTarget == 'mingw_x64') {
|
if (project.testTarget == 'mingw_x64') {
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2021 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
class Wrapper(x: Int)
|
||||||
|
|
||||||
|
// CHECK-LABEL: "kfun:#f(kotlin.Int;kotlin.String){}"
|
||||||
|
fun f(x: Int, s: 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") }
|
||||||
|
// CHECK: {{^}$}}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun main() { f(10, "123456") }
|
||||||
Reference in New Issue
Block a user