Files
kotlin/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToIntMaxValueReversed.kt
2019-11-19 11:00:09 +03:00

15 lines
326 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
const val M = Int.MAX_VALUE
fun box(): String {
var step = 0
for (i in (M .. M).reversed()) {
++step
if (step > 1) throw AssertionError("Should be executed once")
}
if (step != 1) throw AssertionError("Should be executed once")
return "OK"
}