Files
kotlin/compiler/testData/codegen/bytecodeText/deadCodeElimination/simpleConstructorNotRedundantNotOptimizable.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

19 lines
197 B
Kotlin
Vendored

class A
fun box(u: Int) {
val x: A? = A()
val y: A?
if (u == 0) {
y = x
}
else {
y = null
}
y!!
}
// 0 IFNULL
// 1 IFNONNULL
// 1 throwNpe
// 0 ATHROW