Files
kotlin/compiler/testData/codegen/bytecodeText/capturedVarsOptimization/sharedSlotsWithCapturedVars.kt
Ilmir Usmanov 871134cff8 Update test data
#KT-28309
2018-12-28 14:18:39 +03:00

32 lines
496 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM_IR
fun box(): String {
run {
run {
var x1 = 0
run { ++x1 }
if (x1 == 0) return "fail"
}
run {
var x2 = 0
run { x2++ }
if (x2 == 0) return "fail"
}
}
return "OK"
}
// Shared variable slots (x1, x2):
// 4 ILOAD 2
// 4 ISTORE 2
// Temporary variable slots for 'x2++' + store to fake index:
// 0 ILOAD 1
// 2 ISTORE 1
// 0 NEW
// 0 GETFIELD
// 0 PUTFIELD