Files
kotlin/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToIntMaxValueReversed.kt
2018-06-28 12:26:41 +02:00

16 lines
347 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_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"
}