Optimize rangeUntil operator in for-loops and contains
Newly added tests are basically copies of the existing tests on `until`. Note that this operator is optimized for all backends, but the fact that it's optimized is only checked for the JVM backend in bytecode text tests. #KT-53330 Fixed
This commit is contained in:
committed by
Space Team
parent
bc5acb5e9d
commit
28759a3ac3
+70
@@ -2772,6 +2772,70 @@ public class FirBytecodeTextTestGenerated extends AbstractFirBytecodeTextTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class ForInRangeUntil {
|
||||
@Test
|
||||
public void testAllFilesPresentInForInRangeUntil() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("forInRangeUntilChar.kt")
|
||||
public void testForInRangeUntilChar() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil/forInRangeUntilChar.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("forInRangeUntilCharMaxValue.kt")
|
||||
public void testForInRangeUntilCharMaxValue() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil/forInRangeUntilCharMaxValue.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("forInRangeUntilCharMinValue.kt")
|
||||
public void testForInRangeUntilCharMinValue() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil/forInRangeUntilCharMinValue.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("forInRangeUntilInt.kt")
|
||||
public void testForInRangeUntilInt() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil/forInRangeUntilInt.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("forInRangeUntilIntMaxValue.kt")
|
||||
public void testForInRangeUntilIntMaxValue() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil/forInRangeUntilIntMaxValue.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("forInRangeUntilIntMinValue.kt")
|
||||
public void testForInRangeUntilIntMinValue() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil/forInRangeUntilIntMinValue.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("forInRangeUntilLong.kt")
|
||||
public void testForInRangeUntilLong() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil/forInRangeUntilLong.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("forInRangeUntilLongMaxValue.kt")
|
||||
public void testForInRangeUntilLongMaxValue() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil/forInRangeUntilLongMaxValue.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("forInRangeUntilLongMinValue.kt")
|
||||
public void testForInRangeUntilLongMinValue() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil/forInRangeUntilLongMinValue.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInRangeWithUpperBoundMinus1")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@@ -5224,6 +5288,12 @@ public class FirBytecodeTextTestGenerated extends AbstractFirBytecodeTextTest {
|
||||
runTest("compiler/testData/codegen/bytecodeText/ranges/inOptimizableUnsignedRange.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inRangeUntil.kt")
|
||||
public void testInRangeUntil() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/ranges/inRangeUntil.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inUntil.kt")
|
||||
public void testInUntil() throws Exception {
|
||||
|
||||
+1
@@ -393,6 +393,7 @@ internal open class RangeHeaderInfoBuilder(context: CommonBackendContext, scopeO
|
||||
ArrayIndicesHandler(context),
|
||||
CharSequenceIndicesHandler(context),
|
||||
UntilHandler(context),
|
||||
RangeUntilHandler(context),
|
||||
DownToHandler(context),
|
||||
RangeToHandler(context)
|
||||
)
|
||||
|
||||
+1
-1
@@ -79,7 +79,7 @@ val forLoopsPhase = makeIrFilePhase(
|
||||
* } while (loopVar != last)
|
||||
* }
|
||||
* ```
|
||||
* If loop is an until loop (e.g., `for (i in A until B)`), it is transformed into:
|
||||
* If loop is an until loop (e.g., `for (i in A until B)` or `for (i in A..<B)`, it is transformed into:
|
||||
* ```
|
||||
* var inductionVar = A
|
||||
* val last = B - 1
|
||||
|
||||
+1
@@ -266,6 +266,7 @@ internal abstract class HeaderInfoBuilder(
|
||||
ArrayIndicesHandler(context),
|
||||
CharSequenceIndicesHandler(context),
|
||||
UntilHandler(context),
|
||||
RangeUntilHandler(context),
|
||||
DownToHandler(context),
|
||||
RangeToHandler(context),
|
||||
StepHandler(context, this)
|
||||
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.backend.common.lower.loops.handlers
|
||||
|
||||
import org.jetbrains.kotlin.backend.common.CommonBackendContext
|
||||
import org.jetbrains.kotlin.backend.common.lower.createIrBuilder
|
||||
import org.jetbrains.kotlin.backend.common.lower.loops.*
|
||||
import org.jetbrains.kotlin.ir.builders.irInt
|
||||
import org.jetbrains.kotlin.ir.expressions.IrCall
|
||||
import org.jetbrains.kotlin.ir.symbols.IrSymbol
|
||||
|
||||
/** Builds a [HeaderInfo] for progressions built using the `rangeUntil` member function (`..<` operator). */
|
||||
internal class RangeUntilHandler(private val context: CommonBackendContext) : HeaderInfoHandler<IrCall, ProgressionType> {
|
||||
private val progressionElementTypes = context.ir.symbols.progressionElementTypes
|
||||
|
||||
override fun matchIterable(expression: IrCall): Boolean {
|
||||
val callee = expression.symbol.owner
|
||||
return callee.valueParameters.singleOrNull()?.type in progressionElementTypes &&
|
||||
callee.extensionReceiverParameter == null &&
|
||||
callee.dispatchReceiverParameter?.type in progressionElementTypes &&
|
||||
callee.name.asString() == "rangeUntil"
|
||||
}
|
||||
|
||||
override fun build(expression: IrCall, data: ProgressionType, scopeOwner: IrSymbol): HeaderInfo =
|
||||
with(context.createIrBuilder(scopeOwner, expression.startOffset, expression.endOffset)) {
|
||||
ProgressionHeaderInfo(
|
||||
data,
|
||||
first = expression.dispatchReceiver!!,
|
||||
last = expression.getValueArgument(0)!!,
|
||||
step = irInt(1),
|
||||
canOverflow = false,
|
||||
isLastInclusive = false,
|
||||
direction = ProgressionDirection.INCREASING
|
||||
)
|
||||
}
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
// !OPT_IN: kotlin.ExperimentalStdlibApi
|
||||
// IGNORE_BACKEND: JVM
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
// Range and progression-based loops generated with Kotlin compiler should be
|
||||
// as close as possible to Java counter loops ('for (int i = a; i < b; ++i) { ... }').
|
||||
// Otherwise it may result in performance regression due to missing HotSpot optimizations.
|
||||
// Run Kotlin compiler benchmarks (https://github.com/Kotlin/kotlin-benchmarks)
|
||||
// with compiler built from your changes if you are not sure.
|
||||
|
||||
fun test(a: Char, b: Char): String {
|
||||
var s = ""
|
||||
for (i in a..<b) {
|
||||
s += i
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
// 0 iterator
|
||||
// 0 getStart
|
||||
// 0 getEnd
|
||||
// 0 getFirst
|
||||
// 0 getLast
|
||||
// 0 getStep
|
||||
|
||||
// 1 IF_ICMPGE
|
||||
// 0 IF_ICMPLT
|
||||
// 1 IF
|
||||
|
||||
// JVM_IR_TEMPLATES
|
||||
// 5 ILOAD
|
||||
// 2 ISTORE
|
||||
// 1 IADD
|
||||
// 0 ISUB
|
||||
// 0 IINC
|
||||
Vendored
+39
@@ -0,0 +1,39 @@
|
||||
// !OPT_IN: kotlin.ExperimentalStdlibApi
|
||||
// IGNORE_BACKEND: JVM
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
// Range and progression-based loops generated with Kotlin compiler should be
|
||||
// as close as possible to Java counter loops ('for (int i = a; i < b; ++i) { ... }').
|
||||
// Otherwise it may result in performance regression due to missing HotSpot optimizations.
|
||||
// Run Kotlin compiler benchmarks (https://github.com/Kotlin/kotlin-benchmarks)
|
||||
// with compiler built from your changes if you are not sure.
|
||||
|
||||
const val M = Char.MAX_VALUE
|
||||
|
||||
fun f(a: Char): Int {
|
||||
var n = 0
|
||||
for (i in a..<M) {
|
||||
n++
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
// 0 iterator
|
||||
// 0 getStart
|
||||
// 0 getEnd
|
||||
// 0 getFirst
|
||||
// 0 getLast
|
||||
// 0 getStep
|
||||
|
||||
// 1 IF_ICMPGE
|
||||
// 0 IF_ICMPLT
|
||||
// 1 IF
|
||||
|
||||
// JVM_IR_TEMPLATES
|
||||
// 4 ILOAD
|
||||
// 3 ISTORE
|
||||
// 1 IADD
|
||||
// 0 ISUB
|
||||
// 1 IINC
|
||||
Vendored
+38
@@ -0,0 +1,38 @@
|
||||
// !OPT_IN: kotlin.ExperimentalStdlibApi
|
||||
// IGNORE_BACKEND: JVM
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
// Range and progression-based loops generated with Kotlin compiler should be
|
||||
// as close as possible to Java counter loops ('for (int i = a; i < b; ++i) { ... }').
|
||||
// Otherwise it may result in performance regression due to missing HotSpot optimizations.
|
||||
// Run Kotlin compiler benchmarks (https://github.com/Kotlin/kotlin-benchmarks)
|
||||
// with compiler built from your changes if you are not sure.
|
||||
|
||||
const val M = Char.MIN_VALUE
|
||||
|
||||
fun f(a: Char): Int {
|
||||
var n = 0
|
||||
for (i in a..<M) {
|
||||
n++
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
// 0 iterator
|
||||
// 0 getStart
|
||||
// 0 getEnd
|
||||
// 0 getFirst
|
||||
// 0 getLast
|
||||
// 0 getStep
|
||||
|
||||
// 1 IFGE
|
||||
// 1 IF
|
||||
|
||||
// JVM_IR_TEMPLATES
|
||||
// 4 ILOAD
|
||||
// 3 ISTORE
|
||||
// 1 IADD
|
||||
// 0 ISUB
|
||||
// 1 IINC
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
// !OPT_IN: kotlin.ExperimentalStdlibApi
|
||||
// IGNORE_BACKEND: JVM
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
// Range and progression-based loops generated with Kotlin compiler should be
|
||||
// as close as possible to Java counter loops ('for (int i = a; i < b; ++i) { ... }').
|
||||
// Otherwise it may result in performance regression due to missing HotSpot optimizations.
|
||||
// Run Kotlin compiler benchmarks (https://github.com/Kotlin/kotlin-benchmarks)
|
||||
// with compiler built from your changes if you are not sure.
|
||||
|
||||
fun test(a: Int, b: Int): Int {
|
||||
var sum = 0
|
||||
for (i in a..<b) {
|
||||
sum = sum * 10 + i
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
// 0 iterator
|
||||
// 0 getStart
|
||||
// 0 getEnd
|
||||
// 0 getFirst
|
||||
// 0 getLast
|
||||
// 0 getStep
|
||||
|
||||
// 1 IF_ICMPGE
|
||||
// 1 IF
|
||||
|
||||
// JVM_IR_TEMPLATES
|
||||
// 6 ILOAD
|
||||
// 3 ISTORE
|
||||
// 1 IADD
|
||||
// 0 ISUB
|
||||
// 1 IINC
|
||||
Vendored
+38
@@ -0,0 +1,38 @@
|
||||
// !OPT_IN: kotlin.ExperimentalStdlibApi
|
||||
// IGNORE_BACKEND: JVM
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
// Range and progression-based loops generated with Kotlin compiler should be
|
||||
// as close as possible to Java counter loops ('for (int i = a; i < b; ++i) { ... }').
|
||||
// Otherwise it may result in performance regression due to missing HotSpot optimizations.
|
||||
// Run Kotlin compiler benchmarks (https://github.com/Kotlin/kotlin-benchmarks)
|
||||
// with compiler built from your changes if you are not sure.
|
||||
|
||||
const val M = Int.MAX_VALUE
|
||||
|
||||
fun f(a: Int): Int {
|
||||
var n = 0
|
||||
for (i in a..<M) {
|
||||
n++
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
// 0 iterator
|
||||
// 0 getStart
|
||||
// 0 getEnd
|
||||
// 0 getFirst
|
||||
// 0 getLast
|
||||
// 0 getStep
|
||||
|
||||
// 1 IF_ICMPGE
|
||||
// 1 IF
|
||||
|
||||
// JVM_IR_TEMPLATES
|
||||
// 3 ILOAD
|
||||
// 2 ISTORE
|
||||
// 0 IADD
|
||||
// 0 ISUB
|
||||
// 2 IINC
|
||||
Vendored
+41
@@ -0,0 +1,41 @@
|
||||
// !OPT_IN: kotlin.ExperimentalStdlibApi
|
||||
// IGNORE_BACKEND: JVM
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
// Range and progression-based loops generated with Kotlin compiler should be
|
||||
// as close as possible to Java counter loops ('for (int i = a; i < b; ++i) { ... }').
|
||||
// Otherwise it may result in performance regression due to missing HotSpot optimizations.
|
||||
// Run Kotlin compiler benchmarks (https://github.com/Kotlin/kotlin-benchmarks)
|
||||
// with compiler built from your changes if you are not sure.
|
||||
|
||||
const val M = Int.MIN_VALUE
|
||||
|
||||
fun f(a: Int): Int {
|
||||
var n = 0
|
||||
for (i in a..<M) {
|
||||
n++
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
// JVM non-IR uses while.
|
||||
// JVM IR uses if + do-while.
|
||||
|
||||
// 0 iterator
|
||||
// 0 getStart
|
||||
// 0 getEnd
|
||||
// 0 getFirst
|
||||
// 0 getLast
|
||||
// 0 getStep
|
||||
|
||||
// 1 IF_ICMPGE
|
||||
// 1 IF
|
||||
|
||||
// JVM_IR_TEMPLATES
|
||||
// 3 ILOAD
|
||||
// 2 ISTORE
|
||||
// 0 IADD
|
||||
// 0 ISUB
|
||||
// 2 IINC
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
// !OPT_IN: kotlin.ExperimentalStdlibApi
|
||||
// IGNORE_BACKEND: JVM
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
// Range and progression-based loops generated with Kotlin compiler should be
|
||||
// as close as possible to Java counter loops ('for (int i = a; i < b; ++i) { ... }').
|
||||
// Otherwise it may result in performance regression due to missing HotSpot optimizations.
|
||||
// Run Kotlin compiler benchmarks (https://github.com/Kotlin/kotlin-benchmarks)
|
||||
// with compiler built from your changes if you are not sure.
|
||||
|
||||
fun test(a: Long, b: Long): Long {
|
||||
var sum = 0L
|
||||
for (i in a..<b) {
|
||||
sum = sum * 10L + i
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
// 0 iterator
|
||||
// 0 getStart
|
||||
// 0 getEnd
|
||||
// 0 getFirst
|
||||
// 0 getLast
|
||||
// 0 getStep
|
||||
|
||||
// 1 LCMP
|
||||
// 1 IFGE
|
||||
// 1 IF
|
||||
|
||||
// JVM_IR_TEMPLATES
|
||||
// 0 ILOAD
|
||||
// 0 ISTORE
|
||||
// 0 IADD
|
||||
// 0 ISUB
|
||||
// 0 IINC
|
||||
Vendored
+39
@@ -0,0 +1,39 @@
|
||||
// !OPT_IN: kotlin.ExperimentalStdlibApi
|
||||
// IGNORE_BACKEND: JVM
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
// Range and progression-based loops generated with Kotlin compiler should be
|
||||
// as close as possible to Java counter loops ('for (int i = a; i < b; ++i) { ... }').
|
||||
// Otherwise it may result in performance regression due to missing HotSpot optimizations.
|
||||
// Run Kotlin compiler benchmarks (https://github.com/Kotlin/kotlin-benchmarks)
|
||||
// with compiler built from your changes if you are not sure.
|
||||
|
||||
const val M = Long.MAX_VALUE
|
||||
|
||||
fun f(a: Long): Int {
|
||||
var n = 0
|
||||
for (i in a..<M) {
|
||||
n++
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
// 0 iterator
|
||||
// 0 getStart
|
||||
// 0 getEnd
|
||||
// 0 getFirst
|
||||
// 0 getLast
|
||||
// 0 getStep
|
||||
|
||||
// 1 LCMP
|
||||
// 1 IFGE
|
||||
// 1 IF
|
||||
|
||||
// JVM_IR_TEMPLATES
|
||||
// 1 ILOAD
|
||||
// 1 ISTORE
|
||||
// 0 IADD
|
||||
// 0 ISUB
|
||||
// 1 IINC
|
||||
Vendored
+38
@@ -0,0 +1,38 @@
|
||||
// !OPT_IN: kotlin.ExperimentalStdlibApi
|
||||
// IGNORE_BACKEND: JVM
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
// Range and progression-based loops generated with Kotlin compiler should be
|
||||
// as close as possible to Java counter loops ('for (int i = a; i < b; ++i) { ... }').
|
||||
// Otherwise it may result in performance regression due to missing HotSpot optimizations.
|
||||
// Run Kotlin compiler benchmarks (https://github.com/Kotlin/kotlin-benchmarks)
|
||||
// with compiler built from your changes if you are not sure.
|
||||
|
||||
const val M = Long.MIN_VALUE
|
||||
|
||||
fun f(a: Long): Int {
|
||||
var n = 0
|
||||
for (i in a..<M) {
|
||||
n++
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
// 0 iterator
|
||||
// 0 getStart
|
||||
// 0 getEnd
|
||||
// 0 getFirst
|
||||
// 0 getLast
|
||||
// 0 getStep
|
||||
|
||||
// 1 IFGE
|
||||
// 1 IF
|
||||
|
||||
// JVM_IR_TEMPLATES
|
||||
// 1 ILOAD
|
||||
// 1 ISTORE
|
||||
// 0 IADD
|
||||
// 0 ISUB
|
||||
// 1 IINC
|
||||
@@ -0,0 +1,16 @@
|
||||
// !OPT_IN: kotlin.ExperimentalStdlibApi
|
||||
// IGNORE_BACKEND: JVM
|
||||
|
||||
fun testChar(a: Char, x: Char, y: Char) = a in x..<y
|
||||
|
||||
fun testByte(a: Byte, x: Byte, y: Byte) = a in x..<y
|
||||
|
||||
fun testShort(a: Short, x: Short, y: Short) = a in x..<y
|
||||
|
||||
fun testInt(a: Int, x: Int, y: Int) = a in x..<y
|
||||
|
||||
fun testLong(a: Long, x: Long, y: Long) = a in x..<y
|
||||
|
||||
// 0 until
|
||||
// 0 INVOKEVIRTUAL
|
||||
// 0 contains
|
||||
+70
@@ -2706,6 +2706,70 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class ForInRangeUntil {
|
||||
@Test
|
||||
public void testAllFilesPresentInForInRangeUntil() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("forInRangeUntilChar.kt")
|
||||
public void testForInRangeUntilChar() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil/forInRangeUntilChar.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("forInRangeUntilCharMaxValue.kt")
|
||||
public void testForInRangeUntilCharMaxValue() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil/forInRangeUntilCharMaxValue.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("forInRangeUntilCharMinValue.kt")
|
||||
public void testForInRangeUntilCharMinValue() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil/forInRangeUntilCharMinValue.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("forInRangeUntilInt.kt")
|
||||
public void testForInRangeUntilInt() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil/forInRangeUntilInt.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("forInRangeUntilIntMaxValue.kt")
|
||||
public void testForInRangeUntilIntMaxValue() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil/forInRangeUntilIntMaxValue.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("forInRangeUntilIntMinValue.kt")
|
||||
public void testForInRangeUntilIntMinValue() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil/forInRangeUntilIntMinValue.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("forInRangeUntilLong.kt")
|
||||
public void testForInRangeUntilLong() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil/forInRangeUntilLong.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("forInRangeUntilLongMaxValue.kt")
|
||||
public void testForInRangeUntilLongMaxValue() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil/forInRangeUntilLongMaxValue.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("forInRangeUntilLongMinValue.kt")
|
||||
public void testForInRangeUntilLongMinValue() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil/forInRangeUntilLongMinValue.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInRangeWithUpperBoundMinus1")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@@ -4888,6 +4952,12 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
|
||||
runTest("compiler/testData/codegen/bytecodeText/ranges/inOptimizableUnsignedRange.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inRangeUntil.kt")
|
||||
public void testInRangeUntil() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/ranges/inRangeUntil.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inUntil.kt")
|
||||
public void testInUntil() throws Exception {
|
||||
|
||||
+70
@@ -2772,6 +2772,70 @@ public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class ForInRangeUntil {
|
||||
@Test
|
||||
public void testAllFilesPresentInForInRangeUntil() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("forInRangeUntilChar.kt")
|
||||
public void testForInRangeUntilChar() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil/forInRangeUntilChar.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("forInRangeUntilCharMaxValue.kt")
|
||||
public void testForInRangeUntilCharMaxValue() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil/forInRangeUntilCharMaxValue.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("forInRangeUntilCharMinValue.kt")
|
||||
public void testForInRangeUntilCharMinValue() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil/forInRangeUntilCharMinValue.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("forInRangeUntilInt.kt")
|
||||
public void testForInRangeUntilInt() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil/forInRangeUntilInt.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("forInRangeUntilIntMaxValue.kt")
|
||||
public void testForInRangeUntilIntMaxValue() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil/forInRangeUntilIntMaxValue.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("forInRangeUntilIntMinValue.kt")
|
||||
public void testForInRangeUntilIntMinValue() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil/forInRangeUntilIntMinValue.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("forInRangeUntilLong.kt")
|
||||
public void testForInRangeUntilLong() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil/forInRangeUntilLong.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("forInRangeUntilLongMaxValue.kt")
|
||||
public void testForInRangeUntilLongMaxValue() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil/forInRangeUntilLongMaxValue.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("forInRangeUntilLongMinValue.kt")
|
||||
public void testForInRangeUntilLongMinValue() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeUntil/forInRangeUntilLongMinValue.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInRangeWithUpperBoundMinus1")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@@ -5224,6 +5288,12 @@ public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest {
|
||||
runTest("compiler/testData/codegen/bytecodeText/ranges/inOptimizableUnsignedRange.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inRangeUntil.kt")
|
||||
public void testInRangeUntil() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/ranges/inRangeUntil.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inUntil.kt")
|
||||
public void testInUntil() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user