Files
kotlin/compiler/testData/codegen/bytecodeText/deadCodeElimination/boxing.kt
Alexander Udalov 6a90dc2efe Fix bytecode text tests for language version 1.4
New null check assertions are generated a bit more efficiently, with a
call to `checkNotNull` instead of IFNONNULL+jump.
2020-01-20 19:12:59 +01:00

28 lines
384 B
Kotlin
Vendored

class A
fun foo(x: Any?) {}
fun box() {
val x: Int? = 1
x!!
val z: Int? = if (1 == 1) x else null
z!!
foo(1 as java.lang.Integer)
val y: Any? = if (1 == 1) x else A()
y!!
}
// 0 IFNULL
// 0 IFNONULL
// 0 throwNpe
// 0 ATHROW
// JVM_TEMPLATES:
// 1 checkNotNull \(Ljava/lang/Object;\)V
// JVM_IR_TEMPLATES:
// 0 checkNotNull \(Ljava/lang/Object;\)V