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

16 lines
349 B
Kotlin
Vendored

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