Files
kotlin-fork/kotlin-native/backend.native/tests/filecheck/kt49847_class.kt
T
Vladimir Sukharev 26149be44a KT53100: Optimization: <T-unbox>(CONSTANT_PRIMITIVE(x: T?)) => x
Merge-request: KT-MR-6684
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2022-07-21 21:45:03 +00:00

20 lines
463 B
Kotlin

/*
* 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.
*/
class C {
fun foo(x: Int) = x
}
// CHECK-LABEL: define void @"kfun:#main(){}"()
// CHECK-NOT: Int-box
// CHECK-NOT: Int-unbox
// CHECK: ret void
fun main() {
val c = C()
val fooref = c::foo
if( fooref(42) == 42)
println("ok")
}