From b78455093e6e52e310dc61a4854fb561d1d73519 Mon Sep 17 00:00:00 2001 From: Vladimir Sukharev Date: Wed, 10 Jan 2024 17:54:59 +0100 Subject: [PATCH] [K/N][Tests] Adapt test `single_tls_load.kt` to optional inline of EnterFrame --- .../testData/codegen/box/fileCheck/single_tls_load.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/compiler/testData/codegen/box/fileCheck/single_tls_load.kt b/compiler/testData/codegen/box/fileCheck/single_tls_load.kt index 4ea95363c54..1cb5ad21e56 100644 --- a/compiler/testData/codegen/box/fileCheck/single_tls_load.kt +++ b/compiler/testData/codegen/box/fileCheck/single_tls_load.kt @@ -5,7 +5,14 @@ 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 + // https://youtrack.jetbrains.com/issue/KT-64880/K-N-EnterFrame-runtime-function-should-be-always-inlined-in-OPT-mode + // Remove `|call fastcc void @EnterFrame` below, after KT-64880 is fixed + // `call .. @EnterFrame` may or may not be inlined. + // - in case it would be inlined, several `load .. currentThreadDataNode` would happen, and only first of them must stay + // after `OptimizeTLSDataLoads` optimizaion phase. + // - in case of no-inline, several `call .. @EnterFrame` may remain in function code. + + // CHECK: {{_ZN6kotlin2mm14ThreadRegistry22currentThreadDataNode_E|call fastcc void @EnterFrame}} // CHECK-NOT: _ZN6kotlin2mm14ThreadRegistry22currentThreadDataNode_E if (x < 0) throw IllegalStateException() if (x > 0) return f(x - 1, s)