Files
kotlin/compiler/testData/codegen/bytecodeText/deadCodeElimination/boxing.kt
Ting-Yuan Huang 79fcaae991 Implement constant folding in the IR backend for JVM
The newly added pass folds the set of constant functions of the
current backend, plus IrBuiltIns.
2019-03-20 21:02:55 +01:00

23 lines
290 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM_IR
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
// 1 IFNONNULL
// 1 throwNpe
// 0 ATHROW