diff --git a/compiler/testData/codegen/bytecodeText/forLoop/forInDownToCharMinValue.kt b/compiler/testData/codegen/bytecodeText/forLoop/forInDownToCharMinValue.kt index 2fe6aeb695a..39f778edae0 100644 --- a/compiler/testData/codegen/bytecodeText/forLoop/forInDownToCharMinValue.kt +++ b/compiler/testData/codegen/bytecodeText/forLoop/forInDownToCharMinValue.kt @@ -1,8 +1,11 @@ const val M = Char.MIN_VALUE -fun f(a: Char) { +fun f(a: Char): Int { + var n = 0 for (i in a downTo M) { + n++ } + return n } // 0 iterator diff --git a/compiler/testData/codegen/bytecodeText/forLoop/forInDownToIntMinValue.kt b/compiler/testData/codegen/bytecodeText/forLoop/forInDownToIntMinValue.kt index 3817b24cb11..6b13bb6895d 100644 --- a/compiler/testData/codegen/bytecodeText/forLoop/forInDownToIntMinValue.kt +++ b/compiler/testData/codegen/bytecodeText/forLoop/forInDownToIntMinValue.kt @@ -1,8 +1,11 @@ const val M = Int.MIN_VALUE -fun f(a: Int) { +fun f(a: Int): Int { + var n = 0 for (i in a downTo M) { + n++ } + return n } // 0 iterator @@ -11,4 +14,5 @@ fun f(a: Int) { // 0 getFirst // 0 getLast // 0 getStep -// 2 IF_ICMP \ No newline at end of file +// 2 IF_ICMP +// 2 IF \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/forLoop/forInDownToLongMinValue.kt b/compiler/testData/codegen/bytecodeText/forLoop/forInDownToLongMinValue.kt index 168b3a7a18b..9ae281a3d6d 100644 --- a/compiler/testData/codegen/bytecodeText/forLoop/forInDownToLongMinValue.kt +++ b/compiler/testData/codegen/bytecodeText/forLoop/forInDownToLongMinValue.kt @@ -1,8 +1,11 @@ const val M = Long.MIN_VALUE -fun f(a: Long) { +fun f(a: Long): Int { + var n = 0 for (i in a downTo M) { + n++ } + return n } // 0 iterator diff --git a/compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInObjectArrayIndices.kt b/compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInObjectArrayIndices.kt index fc3aa3ceb3b..92b3bc15d4f 100644 --- a/compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInObjectArrayIndices.kt +++ b/compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInObjectArrayIndices.kt @@ -10,5 +10,5 @@ fun test() { // 0 getEnd // 0 getFirst // 0 getLast - -// 1 IF_ICMP +// 1 IF_ICMPGE +// 1 IF \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInPrimitiveArrayIndices.kt b/compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInPrimitiveArrayIndices.kt index ad3f747ef55..078097cab9b 100644 --- a/compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInPrimitiveArrayIndices.kt +++ b/compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInPrimitiveArrayIndices.kt @@ -10,5 +10,5 @@ fun test() { // 0 getEnd // 0 getFirst // 0 getLast - -// 1 IF_ICMP +// 1 IF_ICMPGE +// 1 IF \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/forLoop/forInObjectArray.kt b/compiler/testData/codegen/bytecodeText/forLoop/forInObjectArray.kt index 884c2382e15..c282b88f7bd 100644 --- a/compiler/testData/codegen/bytecodeText/forLoop/forInObjectArray.kt +++ b/compiler/testData/codegen/bytecodeText/forLoop/forInObjectArray.kt @@ -1,11 +1,15 @@ fun array() = arrayOfNulls(4) -fun f() { +fun f(): Int { + var n = 0 for (i in array()) { + n++ } + return n } // 0 iterator // 1 INVOKESTATIC .*\.array \(\) // 1 ARRAYLENGTH -// 1 IF_ICMP \ No newline at end of file +// 1 IF_ICMPGE +// 1 IF \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/forLoop/forInPrimitiveArray.kt b/compiler/testData/codegen/bytecodeText/forLoop/forInPrimitiveArray.kt index 439feb54e74..e9377f5d052 100644 --- a/compiler/testData/codegen/bytecodeText/forLoop/forInPrimitiveArray.kt +++ b/compiler/testData/codegen/bytecodeText/forLoop/forInPrimitiveArray.kt @@ -1,16 +1,21 @@ fun intArray() = intArrayOf(0, 0, 0, 0) fun longArray() = longArrayOf(0, 0, 0, 0) -fun f() { +fun f(): Int { + var n = 0 for (i in intArray()) { + n++ } for (i in longArray()) { + n++ } + return n } // 0 iterator // 1 INVOKESTATIC .*\.intArray \(\) // 1 INVOKESTATIC .*\.longArray \(\) // 2 ARRAYLENGTH -// 2 IF_ICMP \ No newline at end of file +// 2 IF_ICMPGE +// 2 IF \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/forLoop/forInRangeToCharConst.kt b/compiler/testData/codegen/bytecodeText/forLoop/forInRangeToCharConst.kt index 6ed392dc8d9..e53f7e27720 100644 --- a/compiler/testData/codegen/bytecodeText/forLoop/forInRangeToCharConst.kt +++ b/compiler/testData/codegen/bytecodeText/forLoop/forInRangeToCharConst.kt @@ -14,4 +14,5 @@ fun test(): Int { // 0 getFirst // 0 getLast // 0 getStep -// 1 IF_ICMP \ No newline at end of file +// 1 IF_ICMPGT +// 1 IF \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/forLoop/forInRangeToCharMaxValue.kt b/compiler/testData/codegen/bytecodeText/forLoop/forInRangeToCharMaxValue.kt index 7843d76ef46..e061937e0e6 100644 --- a/compiler/testData/codegen/bytecodeText/forLoop/forInRangeToCharMaxValue.kt +++ b/compiler/testData/codegen/bytecodeText/forLoop/forInRangeToCharMaxValue.kt @@ -1,8 +1,11 @@ const val M = Char.MAX_VALUE -fun f(a: Char) { +fun f(a: Char): Int { + var n = 0 for (i in a..M) { + n++ } + return n } // 0 iterator @@ -11,4 +14,5 @@ fun f(a: Char) { // 0 getFirst // 0 getLast // 0 getStep -// 2 IF_ICMP \ No newline at end of file +// 2 IF_ICMP +// 2 IF \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/forLoop/forInRangeToConst.kt b/compiler/testData/codegen/bytecodeText/forLoop/forInRangeToConst.kt index 826e085c5c5..cdd36c9731f 100644 --- a/compiler/testData/codegen/bytecodeText/forLoop/forInRangeToConst.kt +++ b/compiler/testData/codegen/bytecodeText/forLoop/forInRangeToConst.kt @@ -14,4 +14,5 @@ fun test(): Int { // 0 getFirst // 0 getLast // 0 getStep -// 1 IF_ICMP \ No newline at end of file +// 1 IF_ICMPGT +// 1 IF \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/forLoop/forInRangeToIntMaxValue.kt b/compiler/testData/codegen/bytecodeText/forLoop/forInRangeToIntMaxValue.kt index dd8518da46e..b8fc928ed6d 100644 --- a/compiler/testData/codegen/bytecodeText/forLoop/forInRangeToIntMaxValue.kt +++ b/compiler/testData/codegen/bytecodeText/forLoop/forInRangeToIntMaxValue.kt @@ -1,8 +1,11 @@ const val M = Int.MAX_VALUE -fun f(a: Int) { +fun f(a: Int): Int { + var n = 0 for (i in a..M) { + n++ } + return n } // 0 iterator @@ -11,4 +14,5 @@ fun f(a: Int) { // 0 getFirst // 0 getLast // 0 getStep -// 2 IF_ICMP \ No newline at end of file +// 2 IF_ICMP +// 2 IF \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/forLoop/forInRangeToLongConst.kt b/compiler/testData/codegen/bytecodeText/forLoop/forInRangeToLongConst.kt index fdfd915eef2..2332246c148 100644 --- a/compiler/testData/codegen/bytecodeText/forLoop/forInRangeToLongConst.kt +++ b/compiler/testData/codegen/bytecodeText/forLoop/forInRangeToLongConst.kt @@ -15,7 +15,7 @@ fun test(): Long { // 0 getLast // 0 getStep // 1 LCMP -// 0 IFEQ // 1 IFGT +// 1 IF // 0 L2I // 0 I2L \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/forLoop/forInRangeToLongMaxValue.kt b/compiler/testData/codegen/bytecodeText/forLoop/forInRangeToLongMaxValue.kt index ff3fb3f5510..24e1601fb51 100644 --- a/compiler/testData/codegen/bytecodeText/forLoop/forInRangeToLongMaxValue.kt +++ b/compiler/testData/codegen/bytecodeText/forLoop/forInRangeToLongMaxValue.kt @@ -1,8 +1,11 @@ const val M = Long.MAX_VALUE -fun f(a: Long) { +fun f(a: Long): Int { + var n = 0 for (i in a..M) { + n++ } + return n } // 0 iterator diff --git a/compiler/testData/codegen/bytecodeText/forLoop/forInRangeToQualifiedConst.kt b/compiler/testData/codegen/bytecodeText/forLoop/forInRangeToQualifiedConst.kt index 522fb251a7d..ec1771aaf8e 100644 --- a/compiler/testData/codegen/bytecodeText/forLoop/forInRangeToQualifiedConst.kt +++ b/compiler/testData/codegen/bytecodeText/forLoop/forInRangeToQualifiedConst.kt @@ -17,4 +17,5 @@ fun test(): Int { // 0 getFirst // 0 getLast // 0 getStep -// 1 IF_ICMP \ No newline at end of file +// 1 IF_ICMPGT +// 1 IF \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/forLoop/forInRangeWithImplicitReceiver.kt b/compiler/testData/codegen/bytecodeText/forLoop/forInRangeWithImplicitReceiver.kt index 01c8280c6c2..bf4425bb49f 100644 --- a/compiler/testData/codegen/bytecodeText/forLoop/forInRangeWithImplicitReceiver.kt +++ b/compiler/testData/codegen/bytecodeText/forLoop/forInRangeWithImplicitReceiver.kt @@ -11,4 +11,6 @@ fun Int.digitsUpto(end: Int): Int { // 0 getEnd // 0 getFirst // 0 getLast -// 0 getStep \ No newline at end of file +// 0 getStep +// 2 IF_ICMP +// 2 IF \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/forLoop/forInUntil.kt b/compiler/testData/codegen/bytecodeText/forLoop/forInUntil.kt index 4ea36ceec8b..f6fd56234c6 100644 --- a/compiler/testData/codegen/bytecodeText/forLoop/forInUntil.kt +++ b/compiler/testData/codegen/bytecodeText/forLoop/forInUntil.kt @@ -12,4 +12,5 @@ fun test(a: Int, b: Int): Int { // 0 getFirst // 0 getLast // 0 getStep -// 1 IF_ICMP \ No newline at end of file +// 1 IF_ICMPGE +// 1 IF \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/forLoop/forInUntilCharMaxValue.kt b/compiler/testData/codegen/bytecodeText/forLoop/forInUntilCharMaxValue.kt index a17c6d78008..085aff42891 100644 --- a/compiler/testData/codegen/bytecodeText/forLoop/forInUntilCharMaxValue.kt +++ b/compiler/testData/codegen/bytecodeText/forLoop/forInUntilCharMaxValue.kt @@ -1,8 +1,11 @@ const val M = Char.MAX_VALUE -fun f(a: Char) { +fun f(a: Char): Int { + var n = 0 for (i in a until M) { + n++ } + return n } // 0 iterator @@ -11,4 +14,5 @@ fun f(a: Char) { // 0 getFirst // 0 getLast // 0 getStep -// 1 IF_ICMP \ No newline at end of file +// 1 IF_ICMPGE +// 1 IF \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/forLoop/forInUntilIntMaxValue.kt b/compiler/testData/codegen/bytecodeText/forLoop/forInUntilIntMaxValue.kt index 413ea5c0afd..6b58ef852a7 100644 --- a/compiler/testData/codegen/bytecodeText/forLoop/forInUntilIntMaxValue.kt +++ b/compiler/testData/codegen/bytecodeText/forLoop/forInUntilIntMaxValue.kt @@ -1,8 +1,11 @@ const val M = Int.MAX_VALUE -fun f(a: Int) { +fun f(a: Int): Int { + var n = 0 for (i in a until M) { + n++ } + return n } // 0 iterator @@ -11,4 +14,5 @@ fun f(a: Int) { // 0 getFirst // 0 getLast // 0 getStep -// 1 IF_ICMP \ No newline at end of file +// 1 IF_ICMPGE +// 1 IF \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/forLoop/forInUntilLongMaxValue.kt b/compiler/testData/codegen/bytecodeText/forLoop/forInUntilLongMaxValue.kt index 2a5c5f15db5..d45ddcc1318 100644 --- a/compiler/testData/codegen/bytecodeText/forLoop/forInUntilLongMaxValue.kt +++ b/compiler/testData/codegen/bytecodeText/forLoop/forInUntilLongMaxValue.kt @@ -1,8 +1,11 @@ const val M = Long.MAX_VALUE -fun f(a: Long) { +fun f(a: Long): Int { + var n = 0 for (i in a until M) { + n++ } + return n } // 0 iterator @@ -12,4 +15,5 @@ fun f(a: Long) { // 0 getLast // 0 getStep // 1 LCMP +// 1 IFGE // 1 IF \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/forLoop/forIntInDownTo.kt b/compiler/testData/codegen/bytecodeText/forLoop/forIntInDownTo.kt index eddeb534ade..3c12c664cf4 100644 --- a/compiler/testData/codegen/bytecodeText/forLoop/forIntInDownTo.kt +++ b/compiler/testData/codegen/bytecodeText/forLoop/forIntInDownTo.kt @@ -11,4 +11,5 @@ fun test(): Int { // 0 getEnd // 0 getFirst // 0 getLast -// 1 IF_ICMP \ No newline at end of file +// 1 IF_ICMP +// 1 IF \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/forLoop/primitiveLiteralRange1.kt b/compiler/testData/codegen/bytecodeText/forLoop/primitiveLiteralRange1.kt index a1b8812cfa6..656f1b21e38 100644 --- a/compiler/testData/codegen/bytecodeText/forLoop/primitiveLiteralRange1.kt +++ b/compiler/testData/codegen/bytecodeText/forLoop/primitiveLiteralRange1.kt @@ -9,4 +9,5 @@ fun f() { // 0 getFirst // 0 getLast // 0 getStep -// 1 IF_ICMP \ No newline at end of file +// 1 IF_ICMPGT +// 1 IF \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/forLoop/primitiveLiteralRange2.kt b/compiler/testData/codegen/bytecodeText/forLoop/primitiveLiteralRange2.kt index c3c20c6f4c2..b00ccd0835b 100644 --- a/compiler/testData/codegen/bytecodeText/forLoop/primitiveLiteralRange2.kt +++ b/compiler/testData/codegen/bytecodeText/forLoop/primitiveLiteralRange2.kt @@ -9,4 +9,5 @@ fun f(a: Int, b: Int) { // 0 getFirst // 0 getLast // 0 getStep -// 2 IF_ICMP \ No newline at end of file +// 2 IF_ICMP +// 2 IF \ No newline at end of file