ForLoopsLowering: Fix issue with break/continue in loop over withIndex.
This commit is contained in:
committed by
max-kammerer
parent
724eda8fdb
commit
3ee344b836
+23
-27
@@ -15,7 +15,6 @@ import org.jetbrains.kotlin.ir.builders.*
|
||||
import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin
|
||||
import org.jetbrains.kotlin.ir.declarations.IrVariable
|
||||
import org.jetbrains.kotlin.ir.expressions.IrCall
|
||||
import org.jetbrains.kotlin.ir.expressions.IrContainerExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrLoop
|
||||
import org.jetbrains.kotlin.ir.expressions.impl.IrDoWhileLoopImpl
|
||||
@@ -374,6 +373,7 @@ internal class WithIndexLoopHeader(
|
||||
private val nestedLoopHeader: ForLoopHeader
|
||||
private val indexVariable: IrVariable
|
||||
private val ownsIndexVariable: Boolean
|
||||
private val incrementIndexStatement: IrStatement?
|
||||
|
||||
init {
|
||||
with(builder) {
|
||||
@@ -396,6 +396,7 @@ internal class WithIndexLoopHeader(
|
||||
) {
|
||||
indexVariable = nestedLoopHeader.inductionVariable
|
||||
ownsIndexVariable = false
|
||||
incrementIndexStatement = null
|
||||
} else {
|
||||
indexVariable = scope.createTemporaryVariable(
|
||||
irInt(0),
|
||||
@@ -403,11 +404,26 @@ internal class WithIndexLoopHeader(
|
||||
isMutable = true
|
||||
)
|
||||
ownsIndexVariable = true
|
||||
// `index++` during iteration initialization
|
||||
// TODO: MUSTDO: Check for overflow for Iterable and Sequence (call to checkIndexOverflow()).
|
||||
val plusFun = indexVariable.type.getClass()!!.functions.first {
|
||||
it.name == OperatorNameConventions.PLUS &&
|
||||
it.valueParameters.size == 1 &&
|
||||
it.valueParameters[0].type.isInt()
|
||||
}
|
||||
incrementIndexStatement =
|
||||
irSetVar(
|
||||
indexVariable.symbol, irCallOp(
|
||||
plusFun.symbol, plusFun.returnType,
|
||||
irGet(indexVariable),
|
||||
irInt(1)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add the index variable to the statements from the nested loop header.
|
||||
// Add the index variable (if owned) to the statements from the nested loop header.
|
||||
override val loopInitStatements = nestedLoopHeader.loopInitStatements.let { if (ownsIndexVariable) it + indexVariable else it }
|
||||
|
||||
override val consumesLoopVariableComponents = true
|
||||
@@ -459,10 +475,10 @@ internal class WithIndexLoopHeader(
|
||||
// if (inductionVar <= last) {
|
||||
// do {
|
||||
// val i = index // ADDED
|
||||
// checkIndexOverflow(index++) // ADDED
|
||||
// val v = inductionVar
|
||||
// inductionVar += step
|
||||
// // Loop body
|
||||
// checkIndexOverflow(index++) // ADDED
|
||||
// } while (inductionVar <= last)
|
||||
// }
|
||||
//
|
||||
@@ -478,13 +494,14 @@ internal class WithIndexLoopHeader(
|
||||
// var index = 0
|
||||
// while (it.hasNext())
|
||||
// val i = index
|
||||
// val v = it.next()
|
||||
// checkIndexOverflow(index++)
|
||||
// val v = it.next()
|
||||
// // Loop body
|
||||
// }
|
||||
//
|
||||
// We "wire" the 1st destructured component to index, and the 2nd to the loop variable value from the underlying iterable.
|
||||
loopVariableComponents[1]?.initializer = irGet(indexVariable)
|
||||
listOfNotNull(loopVariableComponents[1]) + nestedLoopHeader.initializeIteration(
|
||||
listOfNotNull(loopVariableComponents[1], incrementIndexStatement) + nestedLoopHeader.initializeIteration(
|
||||
loopVariableComponents[2],
|
||||
linkedMapOf(),
|
||||
symbols,
|
||||
@@ -494,28 +511,7 @@ internal class WithIndexLoopHeader(
|
||||
|
||||
// Use the nested loop header to build the loop. More info in comments in initializeIteration().
|
||||
override fun buildLoop(builder: DeclarationIrBuilder, oldLoop: IrLoop, newBody: IrExpression?) =
|
||||
nestedLoopHeader.buildLoop(builder, oldLoop, newBody).apply {
|
||||
if (ownsIndexVariable) {
|
||||
with(builder) {
|
||||
// Add `index++` to end of the loop.
|
||||
// TODO: MUSTDO: Check for overflow for Iterable and Sequence (call to checkIndexOverflow()).
|
||||
val plusFun = indexVariable.type.getClass()!!.functions.first {
|
||||
it.name == OperatorNameConventions.PLUS &&
|
||||
it.valueParameters.size == 1 &&
|
||||
it.valueParameters[0].type.isInt()
|
||||
}
|
||||
(newLoop.body as IrContainerExpression).statements.add(
|
||||
irSetVar(
|
||||
indexVariable.symbol, irCallOp(
|
||||
plusFun.symbol, plusFun.returnType,
|
||||
irGet(indexVariable),
|
||||
irInt(1)
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
nestedLoopHeader.buildLoop(builder, oldLoop, newBody)
|
||||
}
|
||||
|
||||
internal class IterableLoopHeader(
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
// WITH_RUNTIME
|
||||
|
||||
val arr = arrayOf("a", "b", "c", "d")
|
||||
|
||||
fun box(): String {
|
||||
val s = StringBuilder()
|
||||
|
||||
for ((index, x) in arr.withIndex()) {
|
||||
if (index == 0) continue
|
||||
if (index == 3) break
|
||||
s.append("$index:$x;")
|
||||
}
|
||||
|
||||
val ss = s.toString()
|
||||
return if (ss == "1:b;2:c;") "OK" else "fail: '$ss'"
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
// WITH_RUNTIME
|
||||
|
||||
val cs: CharSequence = "abcd"
|
||||
|
||||
fun box(): String {
|
||||
val s = StringBuilder()
|
||||
|
||||
for ((index, x) in cs.withIndex()) {
|
||||
if (index == 0) continue
|
||||
if (index == 3) break
|
||||
s.append("$index:$x;")
|
||||
}
|
||||
|
||||
val ss = s.toString()
|
||||
return if (ss == "1:b;2:c;") "OK" else "fail: '$ss'"
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
// WITH_RUNTIME
|
||||
|
||||
val xs = listOf("a", "b", "c", "d")
|
||||
|
||||
fun box(): String {
|
||||
val s = StringBuilder()
|
||||
|
||||
for ((index, x) in xs.withIndex()) {
|
||||
if (index == 0) continue
|
||||
if (index == 3) break
|
||||
s.append("$index:$x;")
|
||||
}
|
||||
|
||||
val ss = s.toString()
|
||||
return if (ss == "1:b;2:c;") "OK" else "fail: '$ss'"
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
// WITH_RUNTIME
|
||||
|
||||
val xs = listOf("a", "b", "c", "d").asSequence()
|
||||
|
||||
fun box(): String {
|
||||
val s = StringBuilder()
|
||||
|
||||
for ((index, x) in xs.withIndex()) {
|
||||
if (index == 0) continue
|
||||
if (index == 3) break
|
||||
s.append("$index:$x;")
|
||||
}
|
||||
|
||||
val ss = s.toString()
|
||||
return if (ss == "1:b;2:c;") "OK" else "fail: '$ss'"
|
||||
}
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
// WITH_RUNTIME
|
||||
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
fun box(): String {
|
||||
val indexList = mutableListOf<Int>()
|
||||
val valueList = mutableListOf<Int>()
|
||||
for ((i, v) in (4..11 step 2).withIndex()) {
|
||||
if (i == 0) continue
|
||||
if (i == 3) break
|
||||
indexList += i
|
||||
valueList += v
|
||||
}
|
||||
assertEquals(listOf(1, 2), indexList)
|
||||
assertEquals(listOf(6, 8), valueList)
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+25
@@ -5414,6 +5414,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInArrayOfPrimArrayWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInArrayWithIndexBreakAndContinue.kt")
|
||||
public void testForInArrayWithIndexBreakAndContinue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInArrayWithIndexBreakAndContinue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInArrayWithIndexContinuesAsUnmodified.kt")
|
||||
public void testForInArrayWithIndexContinuesAsUnmodified() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInArrayWithIndexContinuesAsUnmodified.kt");
|
||||
@@ -5527,6 +5532,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInCharSequenceWithIndex/forInCharSequenceWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInCharSequenceWithIndexBreakAndContinue.kt")
|
||||
public void testForInCharSequenceWithIndexBreakAndContinue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInCharSequenceWithIndex/forInCharSequenceWithIndexBreakAndContinue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInCharSequenceWithIndexCheckSideEffects.kt")
|
||||
public void testForInCharSequenceWithIndexCheckSideEffects() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInCharSequenceWithIndex/forInCharSequenceWithIndexCheckSideEffects.kt");
|
||||
@@ -5620,6 +5630,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInListWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInListWithIndexBreakAndContinue.kt")
|
||||
public void testForInListWithIndexBreakAndContinue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInListWithIndexBreakAndContinue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInListWithIndexNoElementVar.kt")
|
||||
public void testForInListWithIndexNoElementVar() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInListWithIndexNoElementVar.kt");
|
||||
@@ -5668,6 +5683,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInSequenceWithIndex/forInSequenceWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInSequenceWithIndexBreakAndContinue.kt")
|
||||
public void testForInSequenceWithIndexBreakAndContinue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInSequenceWithIndex/forInSequenceWithIndexBreakAndContinue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInSequenceWithIndexCheckSideEffects.kt")
|
||||
public void testForInSequenceWithIndexCheckSideEffects() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInSequenceWithIndex/forInSequenceWithIndexCheckSideEffects.kt");
|
||||
@@ -20919,6 +20939,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/ranges/forInProgressionWithIndex/forInUntilWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInWithIndexBreakAndContinue.kt")
|
||||
public void testForInWithIndexBreakAndContinue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ranges/forInProgressionWithIndex/forInWithIndexBreakAndContinue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInWithIndexNoIndexOrElementVar.kt")
|
||||
public void testForInWithIndexNoIndexOrElementVar() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ranges/forInProgressionWithIndex/forInWithIndexNoIndexOrElementVar.kt");
|
||||
|
||||
+25
@@ -5414,6 +5414,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInArrayOfPrimArrayWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInArrayWithIndexBreakAndContinue.kt")
|
||||
public void testForInArrayWithIndexBreakAndContinue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInArrayWithIndexBreakAndContinue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInArrayWithIndexContinuesAsUnmodified.kt")
|
||||
public void testForInArrayWithIndexContinuesAsUnmodified() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInArrayWithIndexContinuesAsUnmodified.kt");
|
||||
@@ -5527,6 +5532,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInCharSequenceWithIndex/forInCharSequenceWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInCharSequenceWithIndexBreakAndContinue.kt")
|
||||
public void testForInCharSequenceWithIndexBreakAndContinue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInCharSequenceWithIndex/forInCharSequenceWithIndexBreakAndContinue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInCharSequenceWithIndexCheckSideEffects.kt")
|
||||
public void testForInCharSequenceWithIndexCheckSideEffects() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInCharSequenceWithIndex/forInCharSequenceWithIndexCheckSideEffects.kt");
|
||||
@@ -5620,6 +5630,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInListWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInListWithIndexBreakAndContinue.kt")
|
||||
public void testForInListWithIndexBreakAndContinue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInListWithIndexBreakAndContinue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInListWithIndexNoElementVar.kt")
|
||||
public void testForInListWithIndexNoElementVar() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInListWithIndexNoElementVar.kt");
|
||||
@@ -5668,6 +5683,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInSequenceWithIndex/forInSequenceWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInSequenceWithIndexBreakAndContinue.kt")
|
||||
public void testForInSequenceWithIndexBreakAndContinue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInSequenceWithIndex/forInSequenceWithIndexBreakAndContinue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInSequenceWithIndexCheckSideEffects.kt")
|
||||
public void testForInSequenceWithIndexCheckSideEffects() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInSequenceWithIndex/forInSequenceWithIndexCheckSideEffects.kt");
|
||||
@@ -20919,6 +20939,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/ranges/forInProgressionWithIndex/forInUntilWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInWithIndexBreakAndContinue.kt")
|
||||
public void testForInWithIndexBreakAndContinue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ranges/forInProgressionWithIndex/forInWithIndexBreakAndContinue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInWithIndexNoIndexOrElementVar.kt")
|
||||
public void testForInWithIndexNoIndexOrElementVar() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ranges/forInProgressionWithIndex/forInWithIndexNoIndexOrElementVar.kt");
|
||||
|
||||
+25
@@ -5384,6 +5384,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInArrayOfPrimArrayWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInArrayWithIndexBreakAndContinue.kt")
|
||||
public void testForInArrayWithIndexBreakAndContinue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInArrayWithIndexBreakAndContinue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInArrayWithIndexContinuesAsUnmodified.kt")
|
||||
public void testForInArrayWithIndexContinuesAsUnmodified() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInArrayWithIndexContinuesAsUnmodified.kt");
|
||||
@@ -5497,6 +5502,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInCharSequenceWithIndex/forInCharSequenceWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInCharSequenceWithIndexBreakAndContinue.kt")
|
||||
public void testForInCharSequenceWithIndexBreakAndContinue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInCharSequenceWithIndex/forInCharSequenceWithIndexBreakAndContinue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInCharSequenceWithIndexCheckSideEffects.kt")
|
||||
public void testForInCharSequenceWithIndexCheckSideEffects() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInCharSequenceWithIndex/forInCharSequenceWithIndexCheckSideEffects.kt");
|
||||
@@ -5590,6 +5600,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInListWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInListWithIndexBreakAndContinue.kt")
|
||||
public void testForInListWithIndexBreakAndContinue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInListWithIndexBreakAndContinue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInListWithIndexNoElementVar.kt")
|
||||
public void testForInListWithIndexNoElementVar() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInListWithIndexNoElementVar.kt");
|
||||
@@ -5638,6 +5653,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInSequenceWithIndex/forInSequenceWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInSequenceWithIndexBreakAndContinue.kt")
|
||||
public void testForInSequenceWithIndexBreakAndContinue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInSequenceWithIndex/forInSequenceWithIndexBreakAndContinue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInSequenceWithIndexCheckSideEffects.kt")
|
||||
public void testForInSequenceWithIndexCheckSideEffects() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInSequenceWithIndex/forInSequenceWithIndexCheckSideEffects.kt");
|
||||
@@ -19428,6 +19448,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/ranges/forInProgressionWithIndex/forInUntilWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInWithIndexBreakAndContinue.kt")
|
||||
public void testForInWithIndexBreakAndContinue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ranges/forInProgressionWithIndex/forInWithIndexBreakAndContinue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInWithIndexNoIndexOrElementVar.kt")
|
||||
public void testForInWithIndexNoIndexOrElementVar() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ranges/forInProgressionWithIndex/forInWithIndexNoIndexOrElementVar.kt");
|
||||
|
||||
+25
@@ -5384,6 +5384,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInArrayOfPrimArrayWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInArrayWithIndexBreakAndContinue.kt")
|
||||
public void testForInArrayWithIndexBreakAndContinue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInArrayWithIndexBreakAndContinue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInArrayWithIndexContinuesAsUnmodified.kt")
|
||||
public void testForInArrayWithIndexContinuesAsUnmodified() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInArrayWithIndexContinuesAsUnmodified.kt");
|
||||
@@ -5497,6 +5502,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInCharSequenceWithIndex/forInCharSequenceWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInCharSequenceWithIndexBreakAndContinue.kt")
|
||||
public void testForInCharSequenceWithIndexBreakAndContinue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInCharSequenceWithIndex/forInCharSequenceWithIndexBreakAndContinue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInCharSequenceWithIndexCheckSideEffects.kt")
|
||||
public void testForInCharSequenceWithIndexCheckSideEffects() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInCharSequenceWithIndex/forInCharSequenceWithIndexCheckSideEffects.kt");
|
||||
@@ -5590,6 +5600,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInListWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInListWithIndexBreakAndContinue.kt")
|
||||
public void testForInListWithIndexBreakAndContinue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInListWithIndexBreakAndContinue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInListWithIndexNoElementVar.kt")
|
||||
public void testForInListWithIndexNoElementVar() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInListWithIndexNoElementVar.kt");
|
||||
@@ -5638,6 +5653,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInSequenceWithIndex/forInSequenceWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInSequenceWithIndexBreakAndContinue.kt")
|
||||
public void testForInSequenceWithIndexBreakAndContinue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInSequenceWithIndex/forInSequenceWithIndexBreakAndContinue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInSequenceWithIndexCheckSideEffects.kt")
|
||||
public void testForInSequenceWithIndexCheckSideEffects() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInSequenceWithIndex/forInSequenceWithIndexCheckSideEffects.kt");
|
||||
@@ -19428,6 +19448,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/ranges/forInProgressionWithIndex/forInUntilWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInWithIndexBreakAndContinue.kt")
|
||||
public void testForInWithIndexBreakAndContinue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ranges/forInProgressionWithIndex/forInWithIndexBreakAndContinue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInWithIndexNoIndexOrElementVar.kt")
|
||||
public void testForInWithIndexNoIndexOrElementVar() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ranges/forInProgressionWithIndex/forInWithIndexNoIndexOrElementVar.kt");
|
||||
|
||||
Generated
+25
@@ -4469,6 +4469,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInArrayOfPrimArrayWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInArrayWithIndexBreakAndContinue.kt")
|
||||
public void testForInArrayWithIndexBreakAndContinue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInArrayWithIndexBreakAndContinue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInArrayWithIndexContinuesAsUnmodified.kt")
|
||||
public void testForInArrayWithIndexContinuesAsUnmodified() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInArrayWithIndexContinuesAsUnmodified.kt");
|
||||
@@ -4582,6 +4587,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInCharSequenceWithIndex/forInCharSequenceWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInCharSequenceWithIndexBreakAndContinue.kt")
|
||||
public void testForInCharSequenceWithIndexBreakAndContinue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInCharSequenceWithIndex/forInCharSequenceWithIndexBreakAndContinue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInCharSequenceWithIndexCheckSideEffects.kt")
|
||||
public void testForInCharSequenceWithIndexCheckSideEffects() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInCharSequenceWithIndex/forInCharSequenceWithIndexCheckSideEffects.kt");
|
||||
@@ -4675,6 +4685,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInListWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInListWithIndexBreakAndContinue.kt")
|
||||
public void testForInListWithIndexBreakAndContinue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInListWithIndexBreakAndContinue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInListWithIndexNoElementVar.kt")
|
||||
public void testForInListWithIndexNoElementVar() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInListWithIndexNoElementVar.kt");
|
||||
@@ -4718,6 +4733,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInSequenceWithIndex/forInSequenceWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInSequenceWithIndexBreakAndContinue.kt")
|
||||
public void testForInSequenceWithIndexBreakAndContinue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInSequenceWithIndex/forInSequenceWithIndexBreakAndContinue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInSequenceWithIndexCheckSideEffects.kt")
|
||||
public void testForInSequenceWithIndexCheckSideEffects() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInSequenceWithIndex/forInSequenceWithIndexCheckSideEffects.kt");
|
||||
@@ -16399,6 +16419,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/ranges/forInProgressionWithIndex/forInUntilWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInWithIndexBreakAndContinue.kt")
|
||||
public void testForInWithIndexBreakAndContinue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ranges/forInProgressionWithIndex/forInWithIndexBreakAndContinue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInWithIndexNoIndexOrElementVar.kt")
|
||||
public void testForInWithIndexNoIndexOrElementVar() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ranges/forInProgressionWithIndex/forInWithIndexNoIndexOrElementVar.kt");
|
||||
|
||||
+25
@@ -4469,6 +4469,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInArrayOfPrimArrayWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInArrayWithIndexBreakAndContinue.kt")
|
||||
public void testForInArrayWithIndexBreakAndContinue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInArrayWithIndexBreakAndContinue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInArrayWithIndexContinuesAsUnmodified.kt")
|
||||
public void testForInArrayWithIndexContinuesAsUnmodified() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInArrayWithIndexContinuesAsUnmodified.kt");
|
||||
@@ -4582,6 +4587,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInCharSequenceWithIndex/forInCharSequenceWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInCharSequenceWithIndexBreakAndContinue.kt")
|
||||
public void testForInCharSequenceWithIndexBreakAndContinue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInCharSequenceWithIndex/forInCharSequenceWithIndexBreakAndContinue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInCharSequenceWithIndexCheckSideEffects.kt")
|
||||
public void testForInCharSequenceWithIndexCheckSideEffects() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInCharSequenceWithIndex/forInCharSequenceWithIndexCheckSideEffects.kt");
|
||||
@@ -4675,6 +4685,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInListWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInListWithIndexBreakAndContinue.kt")
|
||||
public void testForInListWithIndexBreakAndContinue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInListWithIndexBreakAndContinue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInListWithIndexNoElementVar.kt")
|
||||
public void testForInListWithIndexNoElementVar() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInListWithIndexNoElementVar.kt");
|
||||
@@ -4718,6 +4733,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInSequenceWithIndex/forInSequenceWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInSequenceWithIndexBreakAndContinue.kt")
|
||||
public void testForInSequenceWithIndexBreakAndContinue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInSequenceWithIndex/forInSequenceWithIndexBreakAndContinue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInSequenceWithIndexCheckSideEffects.kt")
|
||||
public void testForInSequenceWithIndexCheckSideEffects() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/controlStructures/forInSequenceWithIndex/forInSequenceWithIndexCheckSideEffects.kt");
|
||||
@@ -16504,6 +16524,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/ranges/forInProgressionWithIndex/forInUntilWithIndex.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInWithIndexBreakAndContinue.kt")
|
||||
public void testForInWithIndexBreakAndContinue() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ranges/forInProgressionWithIndex/forInWithIndexBreakAndContinue.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInWithIndexNoIndexOrElementVar.kt")
|
||||
public void testForInWithIndexNoIndexOrElementVar() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ranges/forInProgressionWithIndex/forInWithIndexNoIndexOrElementVar.kt");
|
||||
|
||||
Reference in New Issue
Block a user