mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
- Into PrimitiveNumberRangeLiteralRangeValue modifies how bounded value are created by checking if the high bound range can be modified to be exclusive instead of inclusive such as the generated code will be optimized. - Add black box tests checking that the specialization does not fail on any kind of arrays. - Add a bytecode test checking that the code is correctly optimized. Fix of https://youtrack.jetbrains.com/issue/KT-22334
13 lines
205 B
Kotlin
Vendored
13 lines
205 B
Kotlin
Vendored
fun test(): Int {
|
|
val intArray = intArrayOf(1, 2, 3)
|
|
var sum = 0
|
|
for (i in 0..intArray.size-1) {
|
|
sum += intArray[i]
|
|
}
|
|
return sum
|
|
}
|
|
|
|
// 1 IF_ICMPGE
|
|
// 0 IF_ICMPGT
|
|
// 0 IF_ICMPEQ
|