Files
kotlin/compiler/testData/codegen/bytecodeText/forLoop/forInRangeSpecializedToUntil.kt
Mads Ager 507857d452 [IR] Support Collection<*>.indices in for loop lowering.
Unmute a couple of tests that are working as intended.
2019-09-18 19:00:17 +02:00

28 lines
399 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
}
// 0 iterator
// 0 getStart
// 0 getEnd
// 0 getFirst
// 0 getLast
// 0 getStep
// JVM non-IR uses while.
// JVM IR uses if + do-while.
// JVM_TEMPLATES
// 1 IF_ICMPGE
// 1 IF
// JVM_IR_TEMPLATES
// 1 IF_ICMPGT
// 1 IF_ICMPNE
// 2 IF