Added test for inlining accessors of const properties (#4589)

(cherry picked from commit fa4cd091ae9160b97d79bd318cc92f76ada82fec)
This commit is contained in:
LepilkinaElena
2020-12-10 12:25:38 +03:00
committed by Stanislav Erokhin
parent 55bbc35a31
commit 55cb50e15b
2 changed files with 27 additions and 0 deletions
@@ -3229,6 +3229,11 @@ task inline_defaultArgs(type: KonanLocalTest) {
source = "codegen/inline/defaultArgs.kt"
}
task inline_propertyAccessorInline(type: KonanLocalTest) {
goldValue = "123\n42\n"
source = "codegen/inline/propertyAccessorInline.kt"
}
task inline_twiceInlinedObject(type: KonanLocalTest) {
goldValue = "Ok\n"
source = "codegen/inline/twiceInlinedObject.kt"
@@ -0,0 +1,22 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the LICENSE file.
*/
package codegen.inline.propertyAccessorInline
import kotlin.test.*
object C {
const val x = 42
}
fun getC(): C {
println(123)
return C
}
@Test fun runTest() {
println(getC().x)
}