diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index 6c985134bee..a589881e463 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -1234,6 +1234,64 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT } } + @Nested + @TestMetadata("compiler/testData/codegen/box/arrays/forInUnsignedArray") + @TestDataPath("$PROJECT_ROOT") + public class ForInUnsignedArray { + @Test + public void testAllFilesPresentInForInUnsignedArray() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/arrays/forInUnsignedArray"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("forInUnsignedArray.kt") + public void testForInUnsignedArray() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArray.kt"); + } + + @Test + @TestMetadata("forInUnsignedArrayIndices.kt") + public void testForInUnsignedArrayIndices() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayIndices.kt"); + } + + @Test + @TestMetadata("forInUnsignedArrayIndicesReversed.kt") + public void testForInUnsignedArrayIndicesReversed() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayIndicesReversed.kt"); + } + + @Test + @TestMetadata("forInUnsignedArrayReversed.kt") + public void testForInUnsignedArrayReversed() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayReversed.kt"); + } + + @Test + @TestMetadata("forInUnsignedArrayWithIndex.kt") + public void testForInUnsignedArrayWithIndex() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndex.kt"); + } + + @Test + @TestMetadata("forInUnsignedArrayWithIndexNoElementVar.kt") + public void testForInUnsignedArrayWithIndexNoElementVar() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexNoElementVar.kt"); + } + + @Test + @TestMetadata("forInUnsignedArrayWithIndexNoIndexVar.kt") + public void testForInUnsignedArrayWithIndexNoIndexVar() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexNoIndexVar.kt"); + } + + @Test + @TestMetadata("forInUnsignedArrayWithIndexReversed.kt") + public void testForInUnsignedArrayWithIndexReversed() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexReversed.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/arrays/multiDecl") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBytecodeTextTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBytecodeTextTestGenerated.java index 5cc80a1dace..e55dd5b059e 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBytecodeTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBytecodeTextTestGenerated.java @@ -3113,6 +3113,24 @@ public class FirBytecodeTextTestGenerated extends AbstractFirBytecodeTextTest { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInRangeToULongMaxValue.kt"); } + @Test + @TestMetadata("forInUnsignedArray.kt") + public void testForInUnsignedArray() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInUnsignedArray.kt"); + } + + @Test + @TestMetadata("forInUnsignedArrayIndices.kt") + public void testForInUnsignedArrayIndices() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInUnsignedArrayIndices.kt"); + } + + @Test + @TestMetadata("forInUnsignedArrayWithIndex.kt") + public void testForInUnsignedArrayWithIndex() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInUnsignedArrayWithIndex.kt"); + } + @Test @TestMetadata("forInUntilUIntMaxValue.kt") public void testForInUntilUIntMaxValue() throws Exception { diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/loops/handlers/IndexedGetIterationHandlers.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/loops/handlers/IndexedGetIterationHandlers.kt index e670c8651cc..978ba13979c 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/loops/handlers/IndexedGetIterationHandlers.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/loops/handlers/IndexedGetIterationHandlers.kt @@ -19,10 +19,7 @@ import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction import org.jetbrains.kotlin.ir.expressions.IrExpression import org.jetbrains.kotlin.ir.symbols.IrSymbol import org.jetbrains.kotlin.ir.types.* -import org.jetbrains.kotlin.ir.util.functions -import org.jetbrains.kotlin.ir.util.getPropertyGetter -import org.jetbrains.kotlin.ir.util.getSimpleFunction -import org.jetbrains.kotlin.ir.util.isPrimitiveArray +import org.jetbrains.kotlin.ir.util.* import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.util.OperatorNameConventions @@ -75,7 +72,7 @@ abstract class IndexedGetIterationHandler( /** Builds a [HeaderInfo] for arrays. */ internal class ArrayIterationHandler(context: CommonBackendContext) : IndexedGetIterationHandler(context, canCacheLast = true) { - override fun matchIterable(expression: IrExpression) = expression.type.run { isArray() || isPrimitiveArray() } + override fun matchIterable(expression: IrExpression) = expression.type.run { isArray() || isPrimitiveArray() || isUnsignedArray() } override val IrType.sizePropertyGetter get() = getClass()!!.getPropertyGetter("size")!!.owner diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/loops/handlers/IndicesHandlers.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/loops/handlers/IndicesHandlers.kt index 72ae87a8e47..484d2f49fc3 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/loops/handlers/IndicesHandlers.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/loops/handlers/IndicesHandlers.kt @@ -18,6 +18,7 @@ import org.jetbrains.kotlin.ir.symbols.IrSymbol import org.jetbrains.kotlin.ir.types.* import org.jetbrains.kotlin.ir.util.getPropertyGetter import org.jetbrains.kotlin.ir.util.isPrimitiveArray +import org.jetbrains.kotlin.ir.util.isUnsignedArray import org.jetbrains.kotlin.name.FqName /** Builds a [HeaderInfo] for progressions built using the `indices` extension property. */ @@ -77,7 +78,7 @@ internal class CollectionIndicesHandler(context: CommonBackendContext) : Indices internal class ArrayIndicesHandler(context: CommonBackendContext) : IndicesHandler(context) { override val matcher = SimpleCalleeMatcher { - extensionReceiver { it != null && it.type.run { isArray() || isPrimitiveArray() } } + extensionReceiver { it != null && it.type.run { isArray() || isPrimitiveArray() || isUnsignedArray() } } fqName { it == FqName("kotlin.collections.") } parameterCount { it == 0 } } diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/loops/handlers/WithIndexHandler.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/loops/handlers/WithIndexHandler.kt index 553526723a3..b684f832e39 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/loops/handlers/WithIndexHandler.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/loops/handlers/WithIndexHandler.kt @@ -19,6 +19,7 @@ import org.jetbrains.kotlin.ir.types.isIterable import org.jetbrains.kotlin.ir.types.isSequence import org.jetbrains.kotlin.ir.types.isSubtypeOfClass import org.jetbrains.kotlin.ir.util.isPrimitiveArray +import org.jetbrains.kotlin.ir.util.isUnsignedArray import org.jetbrains.kotlin.name.FqName /** Builds a [HeaderInfo] for calls to `withIndex()`. */ @@ -30,7 +31,7 @@ internal class WithIndexHandler(context: CommonBackendContext, private val visit createIrCallMatcher(Quantifier.ANY) { callee { fqName { it == FqName("kotlin.collections.withIndex") } - extensionReceiver { it != null && it.type.run { isArray() || isPrimitiveArray() || isIterable() } } + extensionReceiver { it != null && it.type.run { isArray() || isPrimitiveArray() || isUnsignedArray() || isIterable() } } parameterCount { it == 0 } } callee { diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/ir/util/IrTypeUtils.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/ir/util/IrTypeUtils.kt index 8d87f0545b8..e542c65497f 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/ir/util/IrTypeUtils.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/ir/util/IrTypeUtils.kt @@ -67,6 +67,8 @@ fun IrType.isThrowable(): Boolean = isTypeFromKotlinPackage { name -> name.asStr fun IrType.isUnsigned(): Boolean = isTypeFromKotlinPackage { name -> UnsignedTypes.isShortNameOfUnsignedType(name) } +fun IrType.isUnsignedArray(): Boolean = isTypeFromKotlinPackage { name -> UnsignedTypes.isShortNameOfUnsignedArray(name) } + private inline fun IrType.isTypeFromKotlinPackage(namePredicate: (Name) -> Boolean): Boolean { if (this is IrSimpleType) { val classClassifier = classifier as? IrClassSymbol ?: return false diff --git a/compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArray.kt b/compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArray.kt new file mode 100644 index 00000000000..019e9634993 --- /dev/null +++ b/compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArray.kt @@ -0,0 +1,17 @@ +// WITH_RUNTIME +// IGNORE_BACKEND: WASM + +fun test(uis: UIntArray): String { + var s = "" + for (ui in uis) { + s += ui + } + return s +} + + +fun box(): String { + val test = test(uintArrayOf(1U, 2U, 3U)) + if (test != "123") return "Failed: $test" + return "OK" +} diff --git a/compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayIndices.kt b/compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayIndices.kt new file mode 100644 index 00000000000..9beda562b42 --- /dev/null +++ b/compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayIndices.kt @@ -0,0 +1,17 @@ +// WITH_RUNTIME +// IGNORE_BACKEND: WASM + +fun test(uis: UIntArray): String { + var s = "" + for (i in uis.indices) { + s += "$i:${uis[i]};" + } + return s +} + + +fun box(): String { + val test = test(uintArrayOf(1U, 2U, 3U)) + if (test != "0:1;1:2;2:3;") return "Failed: $test" + return "OK" +} diff --git a/compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayIndicesReversed.kt b/compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayIndicesReversed.kt new file mode 100644 index 00000000000..618df355b12 --- /dev/null +++ b/compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayIndicesReversed.kt @@ -0,0 +1,17 @@ +// WITH_RUNTIME +// IGNORE_BACKEND: WASM + +fun test(uis: UIntArray): String { + var s = "" + for (i in uis.indices.reversed()) { + s += "$i:${uis[i]};" + } + return s +} + + +fun box(): String { + val test = test(uintArrayOf(1U, 2U, 3U)) + if (test != "2:3;1:2;0:1;") return "Failed: $test" + return "OK" +} diff --git a/compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayReversed.kt b/compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayReversed.kt new file mode 100644 index 00000000000..9170f1a5fd4 --- /dev/null +++ b/compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayReversed.kt @@ -0,0 +1,17 @@ +// WITH_RUNTIME +// IGNORE_BACKEND: WASM + +fun test(uis: UIntArray): String { + var s = "" + for (ui in uis.reversed()) { + s += ui + } + return s +} + + +fun box(): String { + val test = test(uintArrayOf(1U, 2U, 3U)) + if (test != "321") return "Failed: $test" + return "OK" +} diff --git a/compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndex.kt b/compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndex.kt new file mode 100644 index 00000000000..0b2fd4c55da --- /dev/null +++ b/compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndex.kt @@ -0,0 +1,17 @@ +// WITH_RUNTIME +// IGNORE_BACKEND: WASM + +fun test(uis: UIntArray): String { + var s = "" + for ((i, ui) in uis.withIndex()) { + s += "$i:$ui;" + } + return s +} + + +fun box(): String { + val test = test(uintArrayOf(1U, 2U, 3U)) + if (test != "0:1;1:2;2:3;") return "Failed: $test" + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexNoElementVar.kt b/compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexNoElementVar.kt new file mode 100644 index 00000000000..bfbed07471a --- /dev/null +++ b/compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexNoElementVar.kt @@ -0,0 +1,17 @@ +// WITH_RUNTIME +// IGNORE_BACKEND: WASM + +fun test(uis: UIntArray): String { + var s = "" + for ((i, _) in uis.withIndex()) { + s += "$i:${uis[i]};" + } + return s +} + + +fun box(): String { + val test = test(uintArrayOf(1U, 2U, 3U)) + if (test != "0:1;1:2;2:3;") return "Failed: $test" + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexNoIndexVar.kt b/compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexNoIndexVar.kt new file mode 100644 index 00000000000..36e3d8f2958 --- /dev/null +++ b/compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexNoIndexVar.kt @@ -0,0 +1,17 @@ +// WITH_RUNTIME +// IGNORE_BACKEND: WASM + +fun test(uis: UIntArray): String { + var s = "" + for ((_, ui) in uis.withIndex()) { + s += ui + } + return s +} + + +fun box(): String { + val test = test(uintArrayOf(1U, 2U, 3U)) + if (test != "123") return "Failed: $test" + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexReversed.kt b/compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexReversed.kt new file mode 100644 index 00000000000..3e8560ad37c --- /dev/null +++ b/compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexReversed.kt @@ -0,0 +1,17 @@ +// WITH_RUNTIME +// IGNORE_BACKEND: WASM + +fun test(uis: UIntArray): String { + var s = "" + for ((i, ui) in uis.withIndex().reversed()) { + s += "$i:$ui;" + } + return s +} + + +fun box(): String { + val test = test(uintArrayOf(1U, 2U, 3U)) + if (test != "2:3;1:2;0:1;") return "Failed: $test" + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/forInDownTo/forInDownToWithPossibleUnderflow.kt b/compiler/testData/codegen/box/ranges/forInDownTo/forInDownToWithPossibleUnderflow.kt index e9215e52112..9c76adaf210 100644 --- a/compiler/testData/codegen/box/ranges/forInDownTo/forInDownToWithPossibleUnderflow.kt +++ b/compiler/testData/codegen/box/ranges/forInDownTo/forInDownToWithPossibleUnderflow.kt @@ -47,7 +47,9 @@ fun testLong() { s += i if (t > 2) throw Exception("too many iterations: $t") } - if (s != "-9223372036854775807-9223372036854775808") throw Exception(s) + if (s != "-9223372036854775807-9223372036854775808" && + s != "-9223372036854776000-9223372036854776000" // JS + ) throw Exception(s) } fun testChar() { diff --git a/compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInUnsignedArray.kt b/compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInUnsignedArray.kt new file mode 100644 index 00000000000..966ccac1e05 --- /dev/null +++ b/compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInUnsignedArray.kt @@ -0,0 +1,35 @@ +// WITH_RUNTIME + +// 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(uis: UIntArray): UInt { + var s = 0U + for (ui in uis) { + s += ui + } + return s +} + +// 0 iterator +// 0 getStart +// 0 getEnd +// 0 getFirst +// 0 getLast +// 1 IF_ICMPGE +// 0 IF_ICMPGT +// 0 IF_ICMPLE +// 1 IF + +// JVM_IR_TEMPLATES +// 6 ILOAD +// 5 ISTORE +// 1 IADD +// 0 ISUB +// 1 IINC \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInUnsignedArrayIndices.kt b/compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInUnsignedArrayIndices.kt new file mode 100644 index 00000000000..f30f970a6a8 --- /dev/null +++ b/compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInUnsignedArrayIndices.kt @@ -0,0 +1,45 @@ +// WITH_RUNTIME + +// 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(uis: UIntArray): UInt { + var s = 0U + for (i in uis.indices) { + s += uis[i] + } + return s +} + +// 0 iterator +// 0 getStart +// 0 getEnd + +// JVM_TEMPLATES +// 1 getFirst +// 1 getLast +// 0 IF_ICMPGE +// 1 IF_ICMPGT +// 0 IF_ICMPLE +// 2 IF + +// JVM_IR_TEMPLATES +// 0 getFirst +// 0 getLast +// 1 IF_ICMPGE +// 0 IF_ICMPGT +// 0 IF_ICMPLE +// 1 IF + +// JVM_IR_TEMPLATES +// 5 ILOAD +// 4 ISTORE +// 1 IADD +// 0 ISUB +// 1 IINC \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInUnsignedArrayWithIndex.kt b/compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInUnsignedArrayWithIndex.kt new file mode 100644 index 00000000000..26efca20b56 --- /dev/null +++ b/compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInUnsignedArrayWithIndex.kt @@ -0,0 +1,46 @@ +// WITH_RUNTIME +// IGNORE_BACKEND_FIR: JVM_IR + +// 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(uis: UIntArray): UInt { + var s = 0U + for ((i, ui) in uis.withIndex()) { + s += ui + } + return s +} + +// JVM_TEMPLATES +// 1 withIndex +// 1 iterator +// 1 hasNext +// 1 next +// 1 component1 +// 1 component2 +// 0 ARRAYLENGTH +// 1 ICONST_0 + +// JVM_IR_TEMPLATES +// 0 withIndex +// 0 iterator +// 0 hasNext +// 0 next +// 0 component1 +// 0 component2 +// 1 INVOKESTATIC kotlin\/UIntArray\.getSize\-impl \(\[I\)I +// 2 ICONST_0 + +// JVM_IR_TEMPLATES +// 7 ILOAD +// 6 ISTORE +// 1 IADD +// 0 ISUB +// 1 IINC \ No newline at end of file diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index 856a33cb09e..2fa81eb0be4 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -1168,6 +1168,64 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { } } + @Nested + @TestMetadata("compiler/testData/codegen/box/arrays/forInUnsignedArray") + @TestDataPath("$PROJECT_ROOT") + public class ForInUnsignedArray { + @Test + public void testAllFilesPresentInForInUnsignedArray() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/arrays/forInUnsignedArray"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @Test + @TestMetadata("forInUnsignedArray.kt") + public void testForInUnsignedArray() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArray.kt"); + } + + @Test + @TestMetadata("forInUnsignedArrayIndices.kt") + public void testForInUnsignedArrayIndices() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayIndices.kt"); + } + + @Test + @TestMetadata("forInUnsignedArrayIndicesReversed.kt") + public void testForInUnsignedArrayIndicesReversed() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayIndicesReversed.kt"); + } + + @Test + @TestMetadata("forInUnsignedArrayReversed.kt") + public void testForInUnsignedArrayReversed() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayReversed.kt"); + } + + @Test + @TestMetadata("forInUnsignedArrayWithIndex.kt") + public void testForInUnsignedArrayWithIndex() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndex.kt"); + } + + @Test + @TestMetadata("forInUnsignedArrayWithIndexNoElementVar.kt") + public void testForInUnsignedArrayWithIndexNoElementVar() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexNoElementVar.kt"); + } + + @Test + @TestMetadata("forInUnsignedArrayWithIndexNoIndexVar.kt") + public void testForInUnsignedArrayWithIndexNoIndexVar() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexNoIndexVar.kt"); + } + + @Test + @TestMetadata("forInUnsignedArrayWithIndexReversed.kt") + public void testForInUnsignedArrayWithIndexReversed() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexReversed.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/arrays/multiDecl") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BytecodeTextTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BytecodeTextTestGenerated.java index 041025d66db..dd34b9f78f5 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BytecodeTextTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BytecodeTextTestGenerated.java @@ -3005,6 +3005,24 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInRangeToULongMaxValue.kt"); } + @Test + @TestMetadata("forInUnsignedArray.kt") + public void testForInUnsignedArray() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInUnsignedArray.kt"); + } + + @Test + @TestMetadata("forInUnsignedArrayIndices.kt") + public void testForInUnsignedArrayIndices() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInUnsignedArrayIndices.kt"); + } + + @Test + @TestMetadata("forInUnsignedArrayWithIndex.kt") + public void testForInUnsignedArrayWithIndex() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInUnsignedArrayWithIndex.kt"); + } + @Test @TestMetadata("forInUntilUIntMaxValue.kt") public void testForInUntilUIntMaxValue() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index fec45f1f568..7ef3db8a5a7 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -1234,6 +1234,64 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes } } + @Nested + @TestMetadata("compiler/testData/codegen/box/arrays/forInUnsignedArray") + @TestDataPath("$PROJECT_ROOT") + public class ForInUnsignedArray { + @Test + public void testAllFilesPresentInForInUnsignedArray() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/arrays/forInUnsignedArray"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("forInUnsignedArray.kt") + public void testForInUnsignedArray() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArray.kt"); + } + + @Test + @TestMetadata("forInUnsignedArrayIndices.kt") + public void testForInUnsignedArrayIndices() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayIndices.kt"); + } + + @Test + @TestMetadata("forInUnsignedArrayIndicesReversed.kt") + public void testForInUnsignedArrayIndicesReversed() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayIndicesReversed.kt"); + } + + @Test + @TestMetadata("forInUnsignedArrayReversed.kt") + public void testForInUnsignedArrayReversed() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayReversed.kt"); + } + + @Test + @TestMetadata("forInUnsignedArrayWithIndex.kt") + public void testForInUnsignedArrayWithIndex() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndex.kt"); + } + + @Test + @TestMetadata("forInUnsignedArrayWithIndexNoElementVar.kt") + public void testForInUnsignedArrayWithIndexNoElementVar() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexNoElementVar.kt"); + } + + @Test + @TestMetadata("forInUnsignedArrayWithIndexNoIndexVar.kt") + public void testForInUnsignedArrayWithIndexNoIndexVar() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexNoIndexVar.kt"); + } + + @Test + @TestMetadata("forInUnsignedArrayWithIndexReversed.kt") + public void testForInUnsignedArrayWithIndexReversed() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexReversed.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/arrays/multiDecl") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBytecodeTextTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBytecodeTextTestGenerated.java index 4e2ba0c3852..1d98bfa4fa7 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBytecodeTextTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBytecodeTextTestGenerated.java @@ -3113,6 +3113,24 @@ public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInRangeToULongMaxValue.kt"); } + @Test + @TestMetadata("forInUnsignedArray.kt") + public void testForInUnsignedArray() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInUnsignedArray.kt"); + } + + @Test + @TestMetadata("forInUnsignedArrayIndices.kt") + public void testForInUnsignedArrayIndices() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInUnsignedArrayIndices.kt"); + } + + @Test + @TestMetadata("forInUnsignedArrayWithIndex.kt") + public void testForInUnsignedArrayWithIndex() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInUnsignedArrayWithIndex.kt"); + } + @Test @TestMetadata("forInUntilUIntMaxValue.kt") public void testForInUntilUIntMaxValue() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index e76d16278fa..e9fb17b3a20 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -1029,6 +1029,59 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes } } + @TestMetadata("compiler/testData/codegen/box/arrays/forInUnsignedArray") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ForInUnsignedArray extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInForInUnsignedArray() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/arrays/forInUnsignedArray"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @TestMetadata("forInUnsignedArray.kt") + public void testForInUnsignedArray() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArray.kt"); + } + + @TestMetadata("forInUnsignedArrayIndices.kt") + public void testForInUnsignedArrayIndices() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayIndices.kt"); + } + + @TestMetadata("forInUnsignedArrayIndicesReversed.kt") + public void testForInUnsignedArrayIndicesReversed() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayIndicesReversed.kt"); + } + + @TestMetadata("forInUnsignedArrayReversed.kt") + public void testForInUnsignedArrayReversed() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayReversed.kt"); + } + + @TestMetadata("forInUnsignedArrayWithIndex.kt") + public void testForInUnsignedArrayWithIndex() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndex.kt"); + } + + @TestMetadata("forInUnsignedArrayWithIndexNoElementVar.kt") + public void testForInUnsignedArrayWithIndexNoElementVar() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexNoElementVar.kt"); + } + + @TestMetadata("forInUnsignedArrayWithIndexNoIndexVar.kt") + public void testForInUnsignedArrayWithIndexNoIndexVar() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexNoIndexVar.kt"); + } + + @TestMetadata("forInUnsignedArrayWithIndexReversed.kt") + public void testForInUnsignedArrayWithIndexReversed() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexReversed.kt"); + } + } + @TestMetadata("compiler/testData/codegen/box/arrays/multiDecl") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java index fc2a6056a41..054f0b82d44 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java @@ -659,6 +659,59 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes } } + @TestMetadata("compiler/testData/codegen/box/arrays/forInUnsignedArray") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ForInUnsignedArray extends AbstractIrJsCodegenBoxES6Test { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath); + } + + public void testAllFilesPresentInForInUnsignedArray() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/arrays/forInUnsignedArray"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @TestMetadata("forInUnsignedArray.kt") + public void testForInUnsignedArray() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArray.kt"); + } + + @TestMetadata("forInUnsignedArrayIndices.kt") + public void testForInUnsignedArrayIndices() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayIndices.kt"); + } + + @TestMetadata("forInUnsignedArrayIndicesReversed.kt") + public void testForInUnsignedArrayIndicesReversed() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayIndicesReversed.kt"); + } + + @TestMetadata("forInUnsignedArrayReversed.kt") + public void testForInUnsignedArrayReversed() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayReversed.kt"); + } + + @TestMetadata("forInUnsignedArrayWithIndex.kt") + public void testForInUnsignedArrayWithIndex() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndex.kt"); + } + + @TestMetadata("forInUnsignedArrayWithIndexNoElementVar.kt") + public void testForInUnsignedArrayWithIndexNoElementVar() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexNoElementVar.kt"); + } + + @TestMetadata("forInUnsignedArrayWithIndexNoIndexVar.kt") + public void testForInUnsignedArrayWithIndexNoIndexVar() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexNoIndexVar.kt"); + } + + @TestMetadata("forInUnsignedArrayWithIndexReversed.kt") + public void testForInUnsignedArrayWithIndexReversed() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexReversed.kt"); + } + } + @TestMetadata("compiler/testData/codegen/box/arrays/multiDecl") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java index 891021ff99a..29ca6f7e833 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java @@ -659,6 +659,59 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { } } + @TestMetadata("compiler/testData/codegen/box/arrays/forInUnsignedArray") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ForInUnsignedArray extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInForInUnsignedArray() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/arrays/forInUnsignedArray"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @TestMetadata("forInUnsignedArray.kt") + public void testForInUnsignedArray() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArray.kt"); + } + + @TestMetadata("forInUnsignedArrayIndices.kt") + public void testForInUnsignedArrayIndices() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayIndices.kt"); + } + + @TestMetadata("forInUnsignedArrayIndicesReversed.kt") + public void testForInUnsignedArrayIndicesReversed() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayIndicesReversed.kt"); + } + + @TestMetadata("forInUnsignedArrayReversed.kt") + public void testForInUnsignedArrayReversed() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayReversed.kt"); + } + + @TestMetadata("forInUnsignedArrayWithIndex.kt") + public void testForInUnsignedArrayWithIndex() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndex.kt"); + } + + @TestMetadata("forInUnsignedArrayWithIndexNoElementVar.kt") + public void testForInUnsignedArrayWithIndexNoElementVar() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexNoElementVar.kt"); + } + + @TestMetadata("forInUnsignedArrayWithIndexNoIndexVar.kt") + public void testForInUnsignedArrayWithIndexNoIndexVar() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexNoIndexVar.kt"); + } + + @TestMetadata("forInUnsignedArrayWithIndexReversed.kt") + public void testForInUnsignedArrayWithIndexReversed() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexReversed.kt"); + } + } + @TestMetadata("compiler/testData/codegen/box/arrays/multiDecl") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index 67f7f327926..5ba8f7f7a79 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -624,6 +624,59 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { } } + @TestMetadata("compiler/testData/codegen/box/arrays/forInUnsignedArray") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ForInUnsignedArray extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInForInUnsignedArray() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/arrays/forInUnsignedArray"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); + } + + @TestMetadata("forInUnsignedArray.kt") + public void testForInUnsignedArray() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArray.kt"); + } + + @TestMetadata("forInUnsignedArrayIndices.kt") + public void testForInUnsignedArrayIndices() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayIndices.kt"); + } + + @TestMetadata("forInUnsignedArrayIndicesReversed.kt") + public void testForInUnsignedArrayIndicesReversed() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayIndicesReversed.kt"); + } + + @TestMetadata("forInUnsignedArrayReversed.kt") + public void testForInUnsignedArrayReversed() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayReversed.kt"); + } + + @TestMetadata("forInUnsignedArrayWithIndex.kt") + public void testForInUnsignedArrayWithIndex() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndex.kt"); + } + + @TestMetadata("forInUnsignedArrayWithIndexNoElementVar.kt") + public void testForInUnsignedArrayWithIndexNoElementVar() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexNoElementVar.kt"); + } + + @TestMetadata("forInUnsignedArrayWithIndexNoIndexVar.kt") + public void testForInUnsignedArrayWithIndexNoIndexVar() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexNoIndexVar.kt"); + } + + @TestMetadata("forInUnsignedArrayWithIndexReversed.kt") + public void testForInUnsignedArrayWithIndexReversed() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexReversed.kt"); + } + } + @TestMetadata("compiler/testData/codegen/box/arrays/multiDecl") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsLegacyPrimitiveArraysBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsLegacyPrimitiveArraysBoxTestGenerated.java index 86082628ae2..4e307878f2a 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsLegacyPrimitiveArraysBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsLegacyPrimitiveArraysBoxTestGenerated.java @@ -406,6 +406,59 @@ public class JsLegacyPrimitiveArraysBoxTestGenerated extends AbstractJsLegacyPri } } + @TestMetadata("compiler/testData/codegen/box/arrays/forInUnsignedArray") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ForInUnsignedArray extends AbstractJsLegacyPrimitiveArraysBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInForInUnsignedArray() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/arrays/forInUnsignedArray"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); + } + + @TestMetadata("forInUnsignedArray.kt") + public void testForInUnsignedArray() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArray.kt"); + } + + @TestMetadata("forInUnsignedArrayIndices.kt") + public void testForInUnsignedArrayIndices() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayIndices.kt"); + } + + @TestMetadata("forInUnsignedArrayIndicesReversed.kt") + public void testForInUnsignedArrayIndicesReversed() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayIndicesReversed.kt"); + } + + @TestMetadata("forInUnsignedArrayReversed.kt") + public void testForInUnsignedArrayReversed() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayReversed.kt"); + } + + @TestMetadata("forInUnsignedArrayWithIndex.kt") + public void testForInUnsignedArrayWithIndex() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndex.kt"); + } + + @TestMetadata("forInUnsignedArrayWithIndexNoElementVar.kt") + public void testForInUnsignedArrayWithIndexNoElementVar() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexNoElementVar.kt"); + } + + @TestMetadata("forInUnsignedArrayWithIndexNoIndexVar.kt") + public void testForInUnsignedArrayWithIndexNoIndexVar() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexNoIndexVar.kt"); + } + + @TestMetadata("forInUnsignedArrayWithIndexReversed.kt") + public void testForInUnsignedArrayWithIndexReversed() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexReversed.kt"); + } + } + @TestMetadata("compiler/testData/codegen/box/arrays/multiDecl") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java index c6e148ada5c..1d9f0490218 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java @@ -579,6 +579,59 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest } } + @TestMetadata("compiler/testData/codegen/box/arrays/forInUnsignedArray") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ForInUnsignedArray extends AbstractIrCodegenBoxWasmTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.WASM, testDataFilePath); + } + + public void testAllFilesPresentInForInUnsignedArray() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/arrays/forInUnsignedArray"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); + } + + @TestMetadata("forInUnsignedArray.kt") + public void testForInUnsignedArray() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArray.kt"); + } + + @TestMetadata("forInUnsignedArrayIndices.kt") + public void testForInUnsignedArrayIndices() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayIndices.kt"); + } + + @TestMetadata("forInUnsignedArrayIndicesReversed.kt") + public void testForInUnsignedArrayIndicesReversed() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayIndicesReversed.kt"); + } + + @TestMetadata("forInUnsignedArrayReversed.kt") + public void testForInUnsignedArrayReversed() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayReversed.kt"); + } + + @TestMetadata("forInUnsignedArrayWithIndex.kt") + public void testForInUnsignedArrayWithIndex() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndex.kt"); + } + + @TestMetadata("forInUnsignedArrayWithIndexNoElementVar.kt") + public void testForInUnsignedArrayWithIndexNoElementVar() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexNoElementVar.kt"); + } + + @TestMetadata("forInUnsignedArrayWithIndexNoIndexVar.kt") + public void testForInUnsignedArrayWithIndexNoIndexVar() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexNoIndexVar.kt"); + } + + @TestMetadata("forInUnsignedArrayWithIndexReversed.kt") + public void testForInUnsignedArrayWithIndexReversed() throws Exception { + runTest("compiler/testData/codegen/box/arrays/forInUnsignedArray/forInUnsignedArrayWithIndexReversed.kt"); + } + } + @TestMetadata("compiler/testData/codegen/box/arrays/multiDecl") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class)