Files
kotlin/compiler/testData/codegen/bytecodeText/redundantGotoRemoving.kt
Dmitry Petrov 1378b0cf05 Fix bytecode tests after new optimizations
- Turn some const conditions into non-const conditions
- Make sure inlined const values are used where required
(otherwise they are eliminated by POP backward propagation)
2017-05-16 17:28:43 +03:00

15 lines
236 B
Kotlin
Vendored

val nonConstFlag = true
inline fun <T, R> calc(value : T, fn: (T) -> R) : R = fn(value)
inline fun <T> identity(value : T) : T = calc(value) {
if (nonConstFlag) return it
it
}
fun foo() {
val x = identity(1)
}
// 1 GOTO