From 68e2d8dcd9576407cee87dadc9abfe2e87ebd58b Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Thu, 27 Dec 2018 14:54:06 +0300 Subject: [PATCH] Support unsigned integers in intrinsic range values --- .../kotlin/codegen/range/RangeCodegenUtil.kt | 40 ++++---- .../kotlin/codegen/range/RangeValues.kt | 8 +- .../range/comparison/ComparisonGenerator.kt | 4 + .../UnsignedIntegerComparisonGenerator.kt | 43 +++++++++ .../box/unsignedTypes/forInUnsignedDownTo.kt | 93 +++++++++++++++++++ .../forInUnsignedRangeLiteral.kt | 93 +++++++++++++++++++ .../box/unsignedTypes/forInUnsignedUntil.kt | 93 +++++++++++++++++++ .../unsignedTypes/inUnsignedRangeLiteral.kt | 42 +++++++++ .../codegen/BlackBoxCodegenTestGenerated.java | 20 ++++ .../LightAnalysisModeTestGenerated.java | 20 ++++ .../ir/IrBlackBoxCodegenTestGenerated.java | 20 ++++ .../IrJsCodegenBoxTestGenerated.java | 20 ++++ .../semantics/JsCodegenBoxTestGenerated.java | 20 ++++ 13 files changed, 496 insertions(+), 20 deletions(-) create mode 100644 compiler/backend/src/org/jetbrains/kotlin/codegen/range/comparison/UnsignedIntegerComparisonGenerator.kt create mode 100644 compiler/testData/codegen/box/unsignedTypes/forInUnsignedDownTo.kt create mode 100644 compiler/testData/codegen/box/unsignedTypes/forInUnsignedRangeLiteral.kt create mode 100644 compiler/testData/codegen/box/unsignedTypes/forInUnsignedUntil.kt create mode 100644 compiler/testData/codegen/box/unsignedTypes/inUnsignedRangeLiteral.kt diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/RangeCodegenUtil.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/RangeCodegenUtil.kt index cec4cf7f8d2..d5f68923f62 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/RangeCodegenUtil.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/RangeCodegenUtil.kt @@ -8,6 +8,7 @@ package org.jetbrains.kotlin.codegen.range import org.jetbrains.kotlin.builtins.KotlinBuiltIns import org.jetbrains.kotlin.builtins.KotlinBuiltIns.RANGES_PACKAGE_FQ_NAME import org.jetbrains.kotlin.builtins.PrimitiveType +import org.jetbrains.kotlin.builtins.UnsignedTypes import org.jetbrains.kotlin.codegen.AsmUtil.isPrimitiveNumberClassDescriptor import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.diagnostics.PsiDiagnosticUtils @@ -74,31 +75,30 @@ private const val CLOSED_FLOATING_POINT_RANGE_FQN = "kotlin.ranges.ClosedFloatin private const val COMPARABLE_RANGE_FQN = "kotlin.ranges.ComparableRange" private const val UINT_RANGE_FQN = "kotlin.ranges.UIntRange" private const val ULONG_RANGE_FQN = "kotlin.ranges.ULongRange" +private const val UINT_PROGRESSION_FQN = "kotlin.ranges.UIntProgression" +private const val ULONG_PROGRESSION_FQN = "kotlin.ranges.ULongProgression" fun getRangeOrProgressionElementType(rangeType: KotlinType): KotlinType? { val rangeClassDescriptor = rangeType.constructor.declarationDescriptor as? ClassDescriptor ?: return null val builtIns = rangeClassDescriptor.builtIns return when (rangeClassDescriptor.fqNameSafe.asString()) { - CHAR_RANGE_FQN -> builtIns.charType - INT_RANGE_FQN -> builtIns.intType - LONG_RANGE_FQN -> builtIns.longType - - CHAR_PROGRESSION_FQN -> builtIns.charType - INT_PROGRESSION_FQN -> builtIns.intType - LONG_PROGRESSION_FQN -> builtIns.longType + CHAR_RANGE_FQN, CHAR_PROGRESSION_FQN -> builtIns.charType + INT_RANGE_FQN, INT_PROGRESSION_FQN -> builtIns.intType + LONG_RANGE_FQN, LONG_PROGRESSION_FQN -> builtIns.longType CLOSED_FLOAT_RANGE_FQN -> builtIns.floatType CLOSED_DOUBLE_RANGE_FQN -> builtIns.doubleType CLOSED_RANGE_FQN -> rangeType.arguments.singleOrNull()?.type - CLOSED_FLOATING_POINT_RANGE_FQN -> rangeType.arguments.singleOrNull()?.type - COMPARABLE_RANGE_FQN -> rangeType.arguments.singleOrNull()?.type - UINT_RANGE_FQN -> rangeClassDescriptor.findTypeInModuleByTopLevelClassFqName(KotlinBuiltIns.FQ_NAMES.uIntFqName) - ULONG_RANGE_FQN -> rangeClassDescriptor.findTypeInModuleByTopLevelClassFqName(KotlinBuiltIns.FQ_NAMES.uLongFqName) + UINT_RANGE_FQN, UINT_PROGRESSION_FQN -> + rangeClassDescriptor.findTypeInModuleByTopLevelClassFqName(KotlinBuiltIns.FQ_NAMES.uIntFqName) + + ULONG_RANGE_FQN, ULONG_PROGRESSION_FQN -> + rangeClassDescriptor.findTypeInModuleByTopLevelClassFqName(KotlinBuiltIns.FQ_NAMES.uLongFqName) else -> null } @@ -125,12 +125,10 @@ fun isPrimitiveNumberRangeTo(rangeTo: CallableDescriptor) = isPrimitiveRangeToExtension(rangeTo) fun isUnsignedIntegerRangeTo(rangeTo: CallableDescriptor) = - "rangeTo" == rangeTo.name.asString() && isUnsignedIntegerClass(rangeTo.containingDeclaration) + "rangeTo" == rangeTo.name.asString() && isUnsignedIntegerClassDescriptor(rangeTo.containingDeclaration) -fun isUnsignedIntegerClass(descriptor: DeclarationDescriptor) = - descriptor is ClassDescriptor && descriptor.defaultType.let { type -> - KotlinBuiltIns.isUByte(type) || KotlinBuiltIns.isUShort(type) || KotlinBuiltIns.isUInt(type) || KotlinBuiltIns.isULong(type) - } +fun isUnsignedIntegerClassDescriptor(descriptor: DeclarationDescriptor?) = + descriptor != null && UnsignedTypes.isUnsignedClass(descriptor) private inline fun CallableDescriptor.isTopLevelExtensionOnType( name: String, @@ -152,11 +150,21 @@ fun isPrimitiveNumberDownTo(descriptor: CallableDescriptor) = isPrimitiveNumberClassDescriptor(it.constructor.declarationDescriptor) } +fun isUnsignedIntegerDownTo(descriptor: CallableDescriptor) = + descriptor.isTopLevelExtensionOnType("downTo", "kotlin.ranges") { + isUnsignedIntegerClassDescriptor(it.constructor.declarationDescriptor) + } + fun isPrimitiveNumberUntil(descriptor: CallableDescriptor) = descriptor.isTopLevelExtensionOnType("until", "kotlin.ranges") { isPrimitiveNumberClassDescriptor(it.constructor.declarationDescriptor) } +fun isUnsignedIntegerUntil(descriptor: CallableDescriptor) = + descriptor.isTopLevelExtensionOnType("until", "kotlin.ranges") { + isUnsignedIntegerClassDescriptor(it.constructor.declarationDescriptor) + } + fun isArrayOrPrimitiveArrayIndices(descriptor: CallableDescriptor) = descriptor.isTopLevelExtensionOnType("indices", "kotlin.collections") { KotlinBuiltIns.isArray(it) || KotlinBuiltIns.isPrimitiveArray(it) diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/RangeValues.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/RangeValues.kt index 0ed72b87272..fa1161bdb3f 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/RangeValues.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/RangeValues.kt @@ -17,7 +17,7 @@ package org.jetbrains.kotlin.codegen.range import org.jetbrains.kotlin.builtins.KotlinBuiltIns -import org.jetbrains.kotlin.codegen.* +import org.jetbrains.kotlin.codegen.ExpressionCodegen import org.jetbrains.kotlin.config.LanguageFeature import org.jetbrains.kotlin.descriptors.CallableDescriptor import org.jetbrains.kotlin.descriptors.impl.LocalVariableDescriptor @@ -118,11 +118,11 @@ private fun ExpressionCodegen.createIntrinsifiedRangeValueOrNull(rangeCall: Reso val rangeCallee = rangeCall.resultingDescriptor return when { - isPrimitiveNumberRangeTo(rangeCallee) -> + isPrimitiveNumberRangeTo(rangeCallee) || isUnsignedIntegerRangeTo(rangeCallee) -> PrimitiveNumberRangeLiteralRangeValue(rangeCall) - isPrimitiveNumberDownTo(rangeCallee) -> + isPrimitiveNumberDownTo(rangeCallee) || isUnsignedIntegerDownTo(rangeCallee) -> DownToProgressionRangeValue(rangeCall) - isPrimitiveNumberUntil(rangeCallee) -> + isPrimitiveNumberUntil(rangeCallee) || isUnsignedIntegerUntil(rangeCallee) -> PrimitiveNumberUntilRangeValue(rangeCall) isArrayOrPrimitiveArrayIndices(rangeCallee) -> ArrayIndicesRangeValue(rangeCall) diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/comparison/ComparisonGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/comparison/ComparisonGenerator.kt index 8d8daf9384c..6d07abedfde 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/comparison/ComparisonGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/comparison/ComparisonGenerator.kt @@ -47,6 +47,10 @@ fun getComparisonGeneratorForKotlinType(kotlinType: KotlinType): ComparisonGener FloatComparisonGenerator KotlinBuiltIns.isDouble(kotlinType) -> DoubleComparisonGenerator + KotlinBuiltIns.isUInt(kotlinType) -> + UIntComparisonGenerator + KotlinBuiltIns.isULong(kotlinType) -> + ULongComparisonGenerator else -> throw UnsupportedOperationException("Unexpected element type: $kotlinType") } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/comparison/UnsignedIntegerComparisonGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/comparison/UnsignedIntegerComparisonGenerator.kt new file mode 100644 index 00000000000..7214194910c --- /dev/null +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/comparison/UnsignedIntegerComparisonGenerator.kt @@ -0,0 +1,43 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. 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.codegen.range.comparison + +import org.jetbrains.org.objectweb.asm.Label +import org.jetbrains.org.objectweb.asm.Opcodes +import org.jetbrains.org.objectweb.asm.Type +import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter + +class UnsignedIntegerComparisonGenerator( + override val comparedType: Type, + private val compareMethodName: String +) : ComparisonGenerator { + + private val compareMethodDescriptor = Type.getMethodDescriptor(Type.INT_TYPE, comparedType, comparedType) + + override fun jumpIfGreaterOrEqual(v: InstructionAdapter, label: Label) { + compareAndJump(v, label, Opcodes.IFGE) + } + + override fun jumpIfLessOrEqual(v: InstructionAdapter, label: Label) { + compareAndJump(v, label, Opcodes.IFLE) + } + + override fun jumpIfGreater(v: InstructionAdapter, label: Label) { + compareAndJump(v, label, Opcodes.IFGT) + } + + override fun jumpIfLess(v: InstructionAdapter, label: Label) { + compareAndJump(v, label, Opcodes.IFLT) + } + + private fun compareAndJump(v: InstructionAdapter, label: Label, opcode: Int) { + v.invokestatic("kotlin/UnsignedKt", compareMethodName, compareMethodDescriptor, false) + v.visitJumpInsn(opcode, label) + } +} + +val UIntComparisonGenerator = UnsignedIntegerComparisonGenerator(Type.INT_TYPE, "uintCompare") +val ULongComparisonGenerator = UnsignedIntegerComparisonGenerator(Type.LONG_TYPE, "ulongCompare") \ No newline at end of file diff --git a/compiler/testData/codegen/box/unsignedTypes/forInUnsignedDownTo.kt b/compiler/testData/codegen/box/unsignedTypes/forInUnsignedDownTo.kt new file mode 100644 index 00000000000..a2a6c437ceb --- /dev/null +++ b/compiler/testData/codegen/box/unsignedTypes/forInUnsignedDownTo.kt @@ -0,0 +1,93 @@ +// IGNORE_BACKEND: JVM_IR +// WITH_RUNTIME + +const val MaxUI = UInt.MAX_VALUE +const val MinUI = UInt.MIN_VALUE + +const val MaxUL = ULong.MAX_VALUE +const val MinUL = ULong.MIN_VALUE + +val M = MaxUI.toULong() + +fun testSimpleUIntLoop() { + var s = 0 + for (i in 6u downTo 1u) { + s = s*10 + i.toInt() + } + if (s != 654321) throw AssertionError("$s") +} + +fun testEmptyUIntLoop() { + var s = 0 + for (i in 1u downTo 6u) { + s = s*10 + i.toInt() + } + if (s != 0) throw AssertionError("$s") +} + +fun testSimpleULongLoop() { + var s = 0 + for (i in 6UL downTo 1UL) { + s = s*10 + i.toInt() + } + if (s != 654321) throw AssertionError("$s") +} + +fun testEmptyULongLoop() { + var s = 0 + for (i in 1UL downTo 6UL) { + s = s*10 + i.toInt() + } + if (s != 0) throw AssertionError("$s") +} + +fun testULongLoop() { + var s = 0 + for (i in M+6UL downTo M+1UL) { + s = s*10 + (i-M).toInt() + } + if (s != 654321) throw AssertionError("$s") +} + +fun testEmptyULongLoop2() { + var s = 0 + for (i in M+1UL downTo M+6UL) { + s = s*10 + (i-M).toInt() + } + if (s != 0) throw AssertionError("$s") +} + +fun testMaxUIdownToMinUI() { + val xs = ArrayList() + for (i in MinUI downTo MaxUI) { + xs.add(i) + if (xs.size > 23) break + } + if (xs.size > 0) { + throw AssertionError("Wrong elements for MaxUI..MinUI: $xs") + } +} + +fun testMaxULdownToMinUL() { + val xs = ArrayList() + for (i in MinUL downTo MaxUL) { + xs.add(i) + if (xs.size > 23) break + } + if (xs.size > 0) { + throw AssertionError("Wrong elements for MaxUI..MinUI: $xs") + } +} + +fun box(): String { + testSimpleUIntLoop() + testEmptyUIntLoop() + testSimpleULongLoop() + testEmptyULongLoop() + testULongLoop() + testEmptyULongLoop2() + testMaxUIdownToMinUI() + testMaxULdownToMinUL() + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/unsignedTypes/forInUnsignedRangeLiteral.kt b/compiler/testData/codegen/box/unsignedTypes/forInUnsignedRangeLiteral.kt new file mode 100644 index 00000000000..35d2c461a92 --- /dev/null +++ b/compiler/testData/codegen/box/unsignedTypes/forInUnsignedRangeLiteral.kt @@ -0,0 +1,93 @@ +// IGNORE_BACKEND: JVM_IR +// WITH_RUNTIME + +const val MaxUI = UInt.MAX_VALUE +const val MinUI = UInt.MIN_VALUE + +const val MaxUL = ULong.MAX_VALUE +const val MinUL = ULong.MIN_VALUE + +val M = MaxUI.toULong() + +fun testSimpleUIntLoop() { + var s = 0 + for (i in 1u .. 6u) { + s = s*10 + i.toInt() + } + if (s != 123456) throw AssertionError("$s") +} + +fun testEmptyUIntLoop() { + var s = 0 + for (i in 6u .. 1u) { + s = s*10 + i.toInt() + } + if (s != 0) throw AssertionError("$s") +} + +fun testSimpleULongLoop() { + var s = 0 + for (i in 1UL .. 6UL) { + s = s*10 + i.toInt() + } + if (s != 123456) throw AssertionError("$s") +} + +fun testEmptyULongLoop() { + var s = 0 + for (i in 6UL .. 1UL) { + s = s*10 + i.toInt() + } + if (s != 0) throw AssertionError("$s") +} + +fun testULongLoop() { + var s = 0 + for (i in M+1UL..M+6UL) { + s = s*10 + (i-M).toInt() + } + if (s != 123456) throw AssertionError("$s") +} + +fun testEmptyULongLoop2() { + var s = 0 + for (i in M+6UL..M+1UL) { + s = s*10 + (i-M).toInt() + } + if (s != 0) throw AssertionError("$s") +} + +fun testMaxUItoMinUI() { + val xs = ArrayList() + for (i in MaxUI..MinUI) { + xs.add(i) + if (xs.size > 23) break + } + if (xs.size > 0) { + throw AssertionError("Wrong elements for MaxUI..MinUI: $xs") + } +} + +fun testMaxULtoMinUL() { + val xs = ArrayList() + for (i in MaxUL..MinUL) { + xs.add(i) + if (xs.size > 23) break + } + if (xs.size > 0) { + throw AssertionError("Wrong elements for MaxUI..MinUI: $xs") + } +} + +fun box(): String { + testSimpleUIntLoop() + testEmptyUIntLoop() + testSimpleULongLoop() + testEmptyULongLoop() + testULongLoop() + testEmptyULongLoop2() + testMaxUItoMinUI() + testMaxULtoMinUL() + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/unsignedTypes/forInUnsignedUntil.kt b/compiler/testData/codegen/box/unsignedTypes/forInUnsignedUntil.kt new file mode 100644 index 00000000000..3ce9310fd75 --- /dev/null +++ b/compiler/testData/codegen/box/unsignedTypes/forInUnsignedUntil.kt @@ -0,0 +1,93 @@ +// IGNORE_BACKEND: JVM_IR +// WITH_RUNTIME + +const val MaxUI = UInt.MAX_VALUE +const val MinUI = UInt.MIN_VALUE + +const val MaxUL = ULong.MAX_VALUE +const val MinUL = ULong.MIN_VALUE + +val M = MaxUI.toULong() + +fun testSimpleUIntLoop() { + var s = 0 + for (i in 1u until 6u) { + s = s*10 + i.toInt() + } + if (s != 12345) throw AssertionError("$s") +} + +fun testEmptyUIntLoop() { + var s = 0 + for (i in 6u until 1u) { + s = s*10 + i.toInt() + } + if (s != 0) throw AssertionError("$s") +} + +fun testSimpleULongLoop() { + var s = 0 + for (i in 1UL until 6UL) { + s = s*10 + i.toInt() + } + if (s != 12345) throw AssertionError("$s") +} + +fun testEmptyULongLoop() { + var s = 0 + for (i in 6UL until 1UL) { + s = s*10 + i.toInt() + } + if (s != 0) throw AssertionError("$s") +} + +fun testULongLoop() { + var s = 0 + for (i in M+1UL until M+6UL) { + s = s*10 + (i-M).toInt() + } + if (s != 12345) throw AssertionError("$s") +} + +fun testEmptyULongLoop2() { + var s = 0 + for (i in M+6UL until M+1UL) { + s = s*10 + (i-M).toInt() + } + if (s != 0) throw AssertionError("$s") +} + +fun testMaxUItoMinUI() { + val xs = ArrayList() + for (i in MaxUI until MinUI) { + xs.add(i) + if (xs.size > 23) break + } + if (xs.size > 0) { + throw AssertionError("Wrong elements for MaxUI..MinUI: $xs") + } +} + +fun testMaxULtoMinUL() { + val xs = ArrayList() + for (i in MaxUL until MinUL) { + xs.add(i) + if (xs.size > 23) break + } + if (xs.size > 0) { + throw AssertionError("Wrong elements for MaxUI..MinUI: $xs") + } +} + +fun box(): String { + testSimpleUIntLoop() + testEmptyUIntLoop() + testSimpleULongLoop() + testEmptyULongLoop() + testULongLoop() + testEmptyULongLoop2() + testMaxUItoMinUI() + testMaxULtoMinUL() + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/unsignedTypes/inUnsignedRangeLiteral.kt b/compiler/testData/codegen/box/unsignedTypes/inUnsignedRangeLiteral.kt new file mode 100644 index 00000000000..539dcfbe911 --- /dev/null +++ b/compiler/testData/codegen/box/unsignedTypes/inUnsignedRangeLiteral.kt @@ -0,0 +1,42 @@ +// IGNORE_BACKEND: JVM_IR +// WITH_RUNTIME + +const val MaxUI = UInt.MAX_VALUE +const val MinUI = UInt.MIN_VALUE + +const val MaxUL = ULong.MAX_VALUE +const val MinUL = ULong.MIN_VALUE + +val M1 = MaxUI.toULong() +val M2 = M1 + 10UL + +fun box(): String { + if (0u in 1u..10u) throw AssertionError() + if (1u !in 1u..10u) throw AssertionError() + if (5u !in 1u..10u) throw AssertionError() + if (10u !in 1u..10u) throw AssertionError() + if (20u in 1u..10u) throw AssertionError() + + if (0UL in 1UL..10UL) throw AssertionError() + if (1UL !in 1UL..10UL) throw AssertionError() + if (5UL !in 1UL..10UL) throw AssertionError() + if (10UL !in 1UL..10UL) throw AssertionError() + if (20UL in 1UL..10UL) throw AssertionError() + + if (0u !in MinUI..MaxUI) throw AssertionError() + if (MinUI !in MinUI..MaxUI) throw AssertionError() + if (MaxUI !in MinUI..MaxUI) throw AssertionError() + + if (0UL !in MinUL..MaxUL) throw AssertionError() + if (MinUL !in MinUL..MaxUL) throw AssertionError() + if (MaxUL !in MinUL..MaxUL) throw AssertionError() + + if (0UL in M1..M2) throw AssertionError() + if (1UL in M1..M2) throw AssertionError() + if (10UL in M1..M2) throw AssertionError() + if (M1 !in M1..M2) throw AssertionError() + if (M1+1UL !in M1..M2) throw AssertionError() + if (M2 !in M1..M2) throw AssertionError() + + return "OK" +} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index f7c01abdb70..60a3a46ba9b 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -24193,6 +24193,26 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/unsignedTypes/forEachIndexedInListOfUInts.kt"); } + @TestMetadata("forInUnsignedDownTo.kt") + public void testForInUnsignedDownTo() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/forInUnsignedDownTo.kt"); + } + + @TestMetadata("forInUnsignedRangeLiteral.kt") + public void testForInUnsignedRangeLiteral() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/forInUnsignedRangeLiteral.kt"); + } + + @TestMetadata("forInUnsignedUntil.kt") + public void testForInUnsignedUntil() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/forInUnsignedUntil.kt"); + } + + @TestMetadata("inUnsignedRangeLiteral.kt") + public void testInUnsignedRangeLiteral() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/inUnsignedRangeLiteral.kt"); + } + @TestMetadata("iterateOverArrayOfUnsignedValues.kt") public void testIterateOverArrayOfUnsignedValues() throws Exception { runTest("compiler/testData/codegen/box/unsignedTypes/iterateOverArrayOfUnsignedValues.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index dd8aa8e48ec..e1aa071ec83 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -24193,6 +24193,26 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/unsignedTypes/forEachIndexedInListOfUInts.kt"); } + @TestMetadata("forInUnsignedDownTo.kt") + public void testForInUnsignedDownTo() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/forInUnsignedDownTo.kt"); + } + + @TestMetadata("forInUnsignedRangeLiteral.kt") + public void testForInUnsignedRangeLiteral() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/forInUnsignedRangeLiteral.kt"); + } + + @TestMetadata("forInUnsignedUntil.kt") + public void testForInUnsignedUntil() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/forInUnsignedUntil.kt"); + } + + @TestMetadata("inUnsignedRangeLiteral.kt") + public void testInUnsignedRangeLiteral() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/inUnsignedRangeLiteral.kt"); + } + @TestMetadata("iterateOverArrayOfUnsignedValues.kt") public void testIterateOverArrayOfUnsignedValues() throws Exception { runTest("compiler/testData/codegen/box/unsignedTypes/iterateOverArrayOfUnsignedValues.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index 63f11cf0354..ac39cf02673 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -24198,6 +24198,26 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/unsignedTypes/forEachIndexedInListOfUInts.kt"); } + @TestMetadata("forInUnsignedDownTo.kt") + public void testForInUnsignedDownTo() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/forInUnsignedDownTo.kt"); + } + + @TestMetadata("forInUnsignedRangeLiteral.kt") + public void testForInUnsignedRangeLiteral() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/forInUnsignedRangeLiteral.kt"); + } + + @TestMetadata("forInUnsignedUntil.kt") + public void testForInUnsignedUntil() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/forInUnsignedUntil.kt"); + } + + @TestMetadata("inUnsignedRangeLiteral.kt") + public void testInUnsignedRangeLiteral() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/inUnsignedRangeLiteral.kt"); + } + @TestMetadata("iterateOverArrayOfUnsignedValues.kt") public void testIterateOverArrayOfUnsignedValues() throws Exception { runTest("compiler/testData/codegen/box/unsignedTypes/iterateOverArrayOfUnsignedValues.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java index 7651c0d7d13..1fad1150d3f 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java @@ -18643,6 +18643,26 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/unsignedTypes/forEachIndexedInListOfUInts.kt"); } + @TestMetadata("forInUnsignedDownTo.kt") + public void testForInUnsignedDownTo() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/forInUnsignedDownTo.kt"); + } + + @TestMetadata("forInUnsignedRangeLiteral.kt") + public void testForInUnsignedRangeLiteral() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/forInUnsignedRangeLiteral.kt"); + } + + @TestMetadata("forInUnsignedUntil.kt") + public void testForInUnsignedUntil() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/forInUnsignedUntil.kt"); + } + + @TestMetadata("inUnsignedRangeLiteral.kt") + public void testInUnsignedRangeLiteral() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/inUnsignedRangeLiteral.kt"); + } + @TestMetadata("iterateOverArrayOfUnsignedValues.kt") public void testIterateOverArrayOfUnsignedValues() throws Exception { runTest("compiler/testData/codegen/box/unsignedTypes/iterateOverArrayOfUnsignedValues.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index c3c5bd48f52..ae99de6f99a 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -19693,6 +19693,26 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/unsignedTypes/forEachIndexedInListOfUInts.kt"); } + @TestMetadata("forInUnsignedDownTo.kt") + public void testForInUnsignedDownTo() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/forInUnsignedDownTo.kt"); + } + + @TestMetadata("forInUnsignedRangeLiteral.kt") + public void testForInUnsignedRangeLiteral() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/forInUnsignedRangeLiteral.kt"); + } + + @TestMetadata("forInUnsignedUntil.kt") + public void testForInUnsignedUntil() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/forInUnsignedUntil.kt"); + } + + @TestMetadata("inUnsignedRangeLiteral.kt") + public void testInUnsignedRangeLiteral() throws Exception { + runTest("compiler/testData/codegen/box/unsignedTypes/inUnsignedRangeLiteral.kt"); + } + @TestMetadata("iterateOverArrayOfUnsignedValues.kt") public void testIterateOverArrayOfUnsignedValues() throws Exception { runTest("compiler/testData/codegen/box/unsignedTypes/iterateOverArrayOfUnsignedValues.kt");