Files
kotlin/compiler/testData/codegen/bytecodeText/forLoop/forInRangeToLongConst.kt
Mikhael Bogdanov 496765f41e Support target templates in bytecode tests
Avoid test data duplication
2019-07-16 14:08:27 +02:00

31 lines
370 B
Kotlin
Vendored

const val N = 42L
fun test(): Long {
var sum = 0L
for (i in 1L .. N) {
sum += i
}
return sum
}
// JVM non-IR uses while.
// JVM IR uses if + do-while.
// 0 iterator
// 0 getStart
// 0 getEnd
// 0 getFirst
// 0 getLast
// 0 getStep
// 1 IFGT
// 0 L2I
// 0 I2L
// JVM_TEMPLATES
// 1 LCMP
// 1 IF
// JVM_IR_TEMPLATES
// 2 LCMP
// 1 IFLE
// 2 IF