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 ddef4ba3499..56445a73da3 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 @@ -30273,6 +30273,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/ranges/contains"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test + @TestMetadata("charInCharRangeWithPossibleOverflow.kt") + public void testCharInCharRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/charInCharRangeWithPossibleOverflow.kt"); + } + @Test @TestMetadata("comparisonWithRangeBoundEliminated.kt") public void testComparisonWithRangeBoundEliminated() throws Exception { @@ -30489,6 +30495,24 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/ranges/contains/inUntilMinValueNonConst.kt"); } + @Test + @TestMetadata("intInByteRangeWithPossibleOverflow.kt") + public void testIntInByteRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/intInByteRangeWithPossibleOverflow.kt"); + } + + @Test + @TestMetadata("intInIntRangeWithPossibleOverflow.kt") + public void testIntInIntRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/intInIntRangeWithPossibleOverflow.kt"); + } + + @Test + @TestMetadata("intInShortRangeWithPossibleOverflow.kt") + public void testIntInShortRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/intInShortRangeWithPossibleOverflow.kt"); + } + @Test @TestMetadata("jvmStaticContainsInObject.kt") public void testJvmStaticContainsInObject() throws Exception { @@ -30501,6 +30525,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/ranges/contains/kt20106.kt"); } + @Test + @TestMetadata("longInLongRangeWithPossibleOverflow.kt") + public void testLongInLongRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/longInLongRangeWithPossibleOverflow.kt"); + } + @Test @TestMetadata("nullableInPrimitiveRange.kt") public void testNullableInPrimitiveRange() throws Exception { @@ -30519,6 +30549,30 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/ranges/contains/smartCastOnBothEnds.kt"); } + @Test + @TestMetadata("uintInUByteRangeWithPossibleOverflow.kt") + public void testUintInUByteRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/uintInUByteRangeWithPossibleOverflow.kt"); + } + + @Test + @TestMetadata("uintInUIntRangeWithPossibleOverflow.kt") + public void testUintInUIntRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/uintInUIntRangeWithPossibleOverflow.kt"); + } + + @Test + @TestMetadata("uintInUShortRangeWithPossibleOverflow.kt") + public void testUintInUShortRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/uintInUShortRangeWithPossibleOverflow.kt"); + } + + @Test + @TestMetadata("ulongInULongRangeWithPossibleOverflow.kt") + public void testUlongInULongRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/ulongInULongRangeWithPossibleOverflow.kt"); + } + @Test @TestMetadata("userDefinedContainsExtension.kt") public void testUserDefinedContainsExtension() throws Exception { diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/loops/handlers/RangeToHandler.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/loops/handlers/RangeToHandler.kt index d8a7cfd4afd..0b9376aa85d 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/loops/handlers/RangeToHandler.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/loops/handlers/RangeToHandler.kt @@ -8,10 +8,6 @@ package org.jetbrains.kotlin.backend.common.lower.loops.handlers import org.jetbrains.kotlin.backend.common.CommonBackendContext import org.jetbrains.kotlin.backend.common.lower.createIrBuilder import org.jetbrains.kotlin.backend.common.lower.loops.* -import org.jetbrains.kotlin.backend.common.lower.loops.ProgressionDirection -import org.jetbrains.kotlin.backend.common.lower.loops.ProgressionHandler -import org.jetbrains.kotlin.backend.common.lower.loops.ProgressionHeaderInfo -import org.jetbrains.kotlin.backend.common.lower.loops.ProgressionType import org.jetbrains.kotlin.backend.common.lower.matchers.SimpleCalleeMatcher import org.jetbrains.kotlin.ir.builders.irInt import org.jetbrains.kotlin.ir.expressions.IrCall @@ -80,16 +76,41 @@ internal class RangeToHandler(private val context: CommonBackendContext) : private fun IrExpression.convertToExclusiveUpperBound(): IrConstImpl? { val irConst = this as? IrConst<*> ?: return null return when (irConst.kind) { - IrConstKind.Char -> - IrConstImpl.char(startOffset, endOffset, type, IrConstKind.Char.valueOf(irConst).inc()) - IrConstKind.Byte -> - IrConstImpl.byte(startOffset, endOffset, type, IrConstKind.Byte.valueOf(irConst).inc()) - IrConstKind.Short -> - IrConstImpl.short(startOffset, endOffset, type, IrConstKind.Short.valueOf(irConst).inc()) - IrConstKind.Int -> - IrConstImpl.int(startOffset, endOffset, type, IrConstKind.Int.valueOf(irConst).inc()) - IrConstKind.Long -> - IrConstImpl.long(startOffset, endOffset, type, IrConstKind.Long.valueOf(irConst).inc()) + IrConstKind.Char -> { + val charValue = IrConstKind.Char.valueOf(irConst) + if (charValue != Char.MAX_VALUE) + IrConstImpl.char(startOffset, endOffset, type, charValue.inc()) + else + null + } + IrConstKind.Byte -> { + val byteValue = IrConstKind.Byte.valueOf(irConst) + if (byteValue != Byte.MAX_VALUE) + IrConstImpl.byte(startOffset, endOffset, type, byteValue.inc()) + else + null + } + IrConstKind.Short -> { + val shortValue = IrConstKind.Short.valueOf(irConst) + if (shortValue != Short.MAX_VALUE) + IrConstImpl.short(startOffset, endOffset, type, shortValue.inc()) + else + null + } + IrConstKind.Int -> { + val intValue = IrConstKind.Int.valueOf(irConst) + if (intValue != Int.MAX_VALUE) + IrConstImpl.int(startOffset, endOffset, type, intValue.inc()) + else + null + } + IrConstKind.Long -> { + val longValue = IrConstKind.Long.valueOf(irConst) + if (longValue != Long.MAX_VALUE) + IrConstImpl.long(startOffset, endOffset, type, longValue.inc()) + else + null + } else -> null } diff --git a/compiler/testData/codegen/box/ranges/contains/charInCharRangeWithPossibleOverflow.kt b/compiler/testData/codegen/box/ranges/contains/charInCharRangeWithPossibleOverflow.kt new file mode 100644 index 00000000000..681b8434427 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/contains/charInCharRangeWithPossibleOverflow.kt @@ -0,0 +1,6 @@ +fun box(): String { + val x1 = 1.toChar() + if (x1 !in Char.MIN_VALUE..Char.MAX_VALUE) + return "Failed" + return "OK" +} diff --git a/compiler/testData/codegen/box/ranges/contains/intInByteRangeWithPossibleOverflow.kt b/compiler/testData/codegen/box/ranges/contains/intInByteRangeWithPossibleOverflow.kt new file mode 100644 index 00000000000..b2647079eed --- /dev/null +++ b/compiler/testData/codegen/box/ranges/contains/intInByteRangeWithPossibleOverflow.kt @@ -0,0 +1,6 @@ +fun box(): String { + val x1 = 1 + if (x1 !in Byte.MIN_VALUE..Byte.MAX_VALUE) + return "Failed" + return "OK" +} diff --git a/compiler/testData/codegen/box/ranges/contains/intInIntRangeWithPossibleOverflow.kt b/compiler/testData/codegen/box/ranges/contains/intInIntRangeWithPossibleOverflow.kt new file mode 100644 index 00000000000..f6ddeaacca8 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/contains/intInIntRangeWithPossibleOverflow.kt @@ -0,0 +1,6 @@ +fun box(): String { + val x1 = 1 + if (x1 !in Int.MIN_VALUE..Int.MAX_VALUE) + return "Failed" + return "OK" +} diff --git a/compiler/testData/codegen/box/ranges/contains/intInShortRangeWithPossibleOverflow.kt b/compiler/testData/codegen/box/ranges/contains/intInShortRangeWithPossibleOverflow.kt new file mode 100644 index 00000000000..54beec99af0 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/contains/intInShortRangeWithPossibleOverflow.kt @@ -0,0 +1,6 @@ +fun box(): String { + val x1 = 1 + if (x1 !in Short.MIN_VALUE..Short.MAX_VALUE) + return "Failed" + return "OK" +} diff --git a/compiler/testData/codegen/box/ranges/contains/longInLongRangeWithPossibleOverflow.kt b/compiler/testData/codegen/box/ranges/contains/longInLongRangeWithPossibleOverflow.kt new file mode 100644 index 00000000000..43ad3d1bb92 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/contains/longInLongRangeWithPossibleOverflow.kt @@ -0,0 +1,6 @@ +fun box(): String { + val x1 = 1L + if (x1 !in Long.MIN_VALUE..Long.MAX_VALUE) + return "Failed" + return "OK" +} diff --git a/compiler/testData/codegen/box/ranges/contains/uintInUByteRangeWithPossibleOverflow.kt b/compiler/testData/codegen/box/ranges/contains/uintInUByteRangeWithPossibleOverflow.kt new file mode 100644 index 00000000000..d885baf0917 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/contains/uintInUByteRangeWithPossibleOverflow.kt @@ -0,0 +1,8 @@ +// WITH_RUNTIME + +fun box(): String { + val x1 = 1U + if (x1 !in UByte.MIN_VALUE..UByte.MAX_VALUE) + return "Failed" + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/contains/uintInUIntRangeWithPossibleOverflow.kt b/compiler/testData/codegen/box/ranges/contains/uintInUIntRangeWithPossibleOverflow.kt new file mode 100644 index 00000000000..da780b37fb0 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/contains/uintInUIntRangeWithPossibleOverflow.kt @@ -0,0 +1,8 @@ +// WITH_RUNTIME + +fun box(): String { + val x1 = 1U + if (x1 !in UInt.MIN_VALUE..UInt.MAX_VALUE) + return "Failed" + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/contains/uintInUShortRangeWithPossibleOverflow.kt b/compiler/testData/codegen/box/ranges/contains/uintInUShortRangeWithPossibleOverflow.kt new file mode 100644 index 00000000000..7a203d08ed7 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/contains/uintInUShortRangeWithPossibleOverflow.kt @@ -0,0 +1,8 @@ +// WITH_RUNTIME + +fun box(): String { + val x1 = 1U + if (x1 !in UShort.MIN_VALUE..UShort.MAX_VALUE) + return "Failed" + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/contains/ulongInULongRangeWithPossibleOverflow.kt b/compiler/testData/codegen/box/ranges/contains/ulongInULongRangeWithPossibleOverflow.kt new file mode 100644 index 00000000000..196cd071362 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/contains/ulongInULongRangeWithPossibleOverflow.kt @@ -0,0 +1,8 @@ +// WITH_RUNTIME + +fun box(): String { + val x1 = 1UL + if (x1 !in ULong.MIN_VALUE..ULong.MAX_VALUE) + return "Failed" + return "OK" +} 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 52dca94f6d5..860ab04f97b 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 @@ -30117,6 +30117,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/ranges/contains"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test + @TestMetadata("charInCharRangeWithPossibleOverflow.kt") + public void testCharInCharRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/charInCharRangeWithPossibleOverflow.kt"); + } + @Test @TestMetadata("comparisonWithRangeBoundEliminated.kt") public void testComparisonWithRangeBoundEliminated() throws Exception { @@ -30333,6 +30339,24 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/ranges/contains/inUntilMinValueNonConst.kt"); } + @Test + @TestMetadata("intInByteRangeWithPossibleOverflow.kt") + public void testIntInByteRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/intInByteRangeWithPossibleOverflow.kt"); + } + + @Test + @TestMetadata("intInIntRangeWithPossibleOverflow.kt") + public void testIntInIntRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/intInIntRangeWithPossibleOverflow.kt"); + } + + @Test + @TestMetadata("intInShortRangeWithPossibleOverflow.kt") + public void testIntInShortRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/intInShortRangeWithPossibleOverflow.kt"); + } + @Test @TestMetadata("jvmStaticContainsInObject.kt") public void testJvmStaticContainsInObject() throws Exception { @@ -30345,6 +30369,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/ranges/contains/kt20106.kt"); } + @Test + @TestMetadata("longInLongRangeWithPossibleOverflow.kt") + public void testLongInLongRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/longInLongRangeWithPossibleOverflow.kt"); + } + @Test @TestMetadata("nullableInPrimitiveRange.kt") public void testNullableInPrimitiveRange() throws Exception { @@ -30363,6 +30393,30 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/ranges/contains/smartCastOnBothEnds.kt"); } + @Test + @TestMetadata("uintInUByteRangeWithPossibleOverflow.kt") + public void testUintInUByteRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/uintInUByteRangeWithPossibleOverflow.kt"); + } + + @Test + @TestMetadata("uintInUIntRangeWithPossibleOverflow.kt") + public void testUintInUIntRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/uintInUIntRangeWithPossibleOverflow.kt"); + } + + @Test + @TestMetadata("uintInUShortRangeWithPossibleOverflow.kt") + public void testUintInUShortRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/uintInUShortRangeWithPossibleOverflow.kt"); + } + + @Test + @TestMetadata("ulongInULongRangeWithPossibleOverflow.kt") + public void testUlongInULongRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/ulongInULongRangeWithPossibleOverflow.kt"); + } + @Test @TestMetadata("userDefinedContainsExtension.kt") public void testUserDefinedContainsExtension() 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 939da3e8f9d..fcdb239ef96 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 @@ -30273,6 +30273,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/ranges/contains"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test + @TestMetadata("charInCharRangeWithPossibleOverflow.kt") + public void testCharInCharRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/charInCharRangeWithPossibleOverflow.kt"); + } + @Test @TestMetadata("comparisonWithRangeBoundEliminated.kt") public void testComparisonWithRangeBoundEliminated() throws Exception { @@ -30489,6 +30495,24 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/ranges/contains/inUntilMinValueNonConst.kt"); } + @Test + @TestMetadata("intInByteRangeWithPossibleOverflow.kt") + public void testIntInByteRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/intInByteRangeWithPossibleOverflow.kt"); + } + + @Test + @TestMetadata("intInIntRangeWithPossibleOverflow.kt") + public void testIntInIntRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/intInIntRangeWithPossibleOverflow.kt"); + } + + @Test + @TestMetadata("intInShortRangeWithPossibleOverflow.kt") + public void testIntInShortRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/intInShortRangeWithPossibleOverflow.kt"); + } + @Test @TestMetadata("jvmStaticContainsInObject.kt") public void testJvmStaticContainsInObject() throws Exception { @@ -30501,6 +30525,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/ranges/contains/kt20106.kt"); } + @Test + @TestMetadata("longInLongRangeWithPossibleOverflow.kt") + public void testLongInLongRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/longInLongRangeWithPossibleOverflow.kt"); + } + @Test @TestMetadata("nullableInPrimitiveRange.kt") public void testNullableInPrimitiveRange() throws Exception { @@ -30519,6 +30549,30 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/ranges/contains/smartCastOnBothEnds.kt"); } + @Test + @TestMetadata("uintInUByteRangeWithPossibleOverflow.kt") + public void testUintInUByteRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/uintInUByteRangeWithPossibleOverflow.kt"); + } + + @Test + @TestMetadata("uintInUIntRangeWithPossibleOverflow.kt") + public void testUintInUIntRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/uintInUIntRangeWithPossibleOverflow.kt"); + } + + @Test + @TestMetadata("uintInUShortRangeWithPossibleOverflow.kt") + public void testUintInUShortRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/uintInUShortRangeWithPossibleOverflow.kt"); + } + + @Test + @TestMetadata("ulongInULongRangeWithPossibleOverflow.kt") + public void testUlongInULongRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/ulongInULongRangeWithPossibleOverflow.kt"); + } + @Test @TestMetadata("userDefinedContainsExtension.kt") public void testUserDefinedContainsExtension() 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 46e3975a897..6c8452e0d07 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -25628,6 +25628,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/ranges/contains"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @TestMetadata("charInCharRangeWithPossibleOverflow.kt") + public void testCharInCharRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/charInCharRangeWithPossibleOverflow.kt"); + } + @TestMetadata("comparisonWithRangeBoundEliminated.kt") public void testComparisonWithRangeBoundEliminated() throws Exception { runTest("compiler/testData/codegen/box/ranges/contains/comparisonWithRangeBoundEliminated.kt"); @@ -25808,6 +25813,21 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/ranges/contains/inUntilMinValueNonConst.kt"); } + @TestMetadata("intInByteRangeWithPossibleOverflow.kt") + public void testIntInByteRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/intInByteRangeWithPossibleOverflow.kt"); + } + + @TestMetadata("intInIntRangeWithPossibleOverflow.kt") + public void testIntInIntRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/intInIntRangeWithPossibleOverflow.kt"); + } + + @TestMetadata("intInShortRangeWithPossibleOverflow.kt") + public void testIntInShortRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/intInShortRangeWithPossibleOverflow.kt"); + } + @TestMetadata("jvmStaticContainsInObject.kt") public void testJvmStaticContainsInObject() throws Exception { runTest("compiler/testData/codegen/box/ranges/contains/jvmStaticContainsInObject.kt"); @@ -25818,6 +25838,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/ranges/contains/kt20106.kt"); } + @TestMetadata("longInLongRangeWithPossibleOverflow.kt") + public void testLongInLongRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/longInLongRangeWithPossibleOverflow.kt"); + } + @TestMetadata("nullableInPrimitiveRange.kt") public void testNullableInPrimitiveRange() throws Exception { runTest("compiler/testData/codegen/box/ranges/contains/nullableInPrimitiveRange.kt"); @@ -25828,6 +25853,26 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/ranges/contains/rangeContainsString.kt"); } + @TestMetadata("uintInUByteRangeWithPossibleOverflow.kt") + public void testUintInUByteRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/uintInUByteRangeWithPossibleOverflow.kt"); + } + + @TestMetadata("uintInUIntRangeWithPossibleOverflow.kt") + public void testUintInUIntRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/uintInUIntRangeWithPossibleOverflow.kt"); + } + + @TestMetadata("uintInUShortRangeWithPossibleOverflow.kt") + public void testUintInUShortRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/uintInUShortRangeWithPossibleOverflow.kt"); + } + + @TestMetadata("ulongInULongRangeWithPossibleOverflow.kt") + public void testUlongInULongRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/ulongInULongRangeWithPossibleOverflow.kt"); + } + @TestMetadata("userDefinedContainsExtension.kt") public void testUserDefinedContainsExtension() throws Exception { runTest("compiler/testData/codegen/box/ranges/contains/userDefinedContainsExtension.kt"); 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 0295fca6b34..197a6b4ff93 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 @@ -20267,6 +20267,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/ranges/contains"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); } + @TestMetadata("charInCharRangeWithPossibleOverflow.kt") + public void testCharInCharRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/charInCharRangeWithPossibleOverflow.kt"); + } + @TestMetadata("comparisonWithRangeBoundEliminated.kt") public void testComparisonWithRangeBoundEliminated() throws Exception { runTest("compiler/testData/codegen/box/ranges/contains/comparisonWithRangeBoundEliminated.kt"); @@ -20447,11 +20452,31 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes runTest("compiler/testData/codegen/box/ranges/contains/inUntilMinValueNonConst.kt"); } + @TestMetadata("intInByteRangeWithPossibleOverflow.kt") + public void testIntInByteRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/intInByteRangeWithPossibleOverflow.kt"); + } + + @TestMetadata("intInIntRangeWithPossibleOverflow.kt") + public void testIntInIntRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/intInIntRangeWithPossibleOverflow.kt"); + } + + @TestMetadata("intInShortRangeWithPossibleOverflow.kt") + public void testIntInShortRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/intInShortRangeWithPossibleOverflow.kt"); + } + @TestMetadata("kt20106.kt") public void testKt20106() throws Exception { runTest("compiler/testData/codegen/box/ranges/contains/kt20106.kt"); } + @TestMetadata("longInLongRangeWithPossibleOverflow.kt") + public void testLongInLongRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/longInLongRangeWithPossibleOverflow.kt"); + } + @TestMetadata("nullableInPrimitiveRange.kt") public void testNullableInPrimitiveRange() throws Exception { runTest("compiler/testData/codegen/box/ranges/contains/nullableInPrimitiveRange.kt"); @@ -20467,6 +20492,26 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes runTest("compiler/testData/codegen/box/ranges/contains/smartCastOnBothEnds.kt"); } + @TestMetadata("uintInUByteRangeWithPossibleOverflow.kt") + public void testUintInUByteRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/uintInUByteRangeWithPossibleOverflow.kt"); + } + + @TestMetadata("uintInUIntRangeWithPossibleOverflow.kt") + public void testUintInUIntRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/uintInUIntRangeWithPossibleOverflow.kt"); + } + + @TestMetadata("uintInUShortRangeWithPossibleOverflow.kt") + public void testUintInUShortRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/uintInUShortRangeWithPossibleOverflow.kt"); + } + + @TestMetadata("ulongInULongRangeWithPossibleOverflow.kt") + public void testUlongInULongRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/ulongInULongRangeWithPossibleOverflow.kt"); + } + @TestMetadata("userDefinedContainsExtension.kt") public void testUserDefinedContainsExtension() throws Exception { runTest("compiler/testData/codegen/box/ranges/contains/userDefinedContainsExtension.kt"); 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 4dfa86b7696..6ef16b2ac90 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 @@ -19673,6 +19673,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/ranges/contains"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); } + @TestMetadata("charInCharRangeWithPossibleOverflow.kt") + public void testCharInCharRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/charInCharRangeWithPossibleOverflow.kt"); + } + @TestMetadata("comparisonWithRangeBoundEliminated.kt") public void testComparisonWithRangeBoundEliminated() throws Exception { runTest("compiler/testData/codegen/box/ranges/contains/comparisonWithRangeBoundEliminated.kt"); @@ -19853,11 +19858,31 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/ranges/contains/inUntilMinValueNonConst.kt"); } + @TestMetadata("intInByteRangeWithPossibleOverflow.kt") + public void testIntInByteRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/intInByteRangeWithPossibleOverflow.kt"); + } + + @TestMetadata("intInIntRangeWithPossibleOverflow.kt") + public void testIntInIntRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/intInIntRangeWithPossibleOverflow.kt"); + } + + @TestMetadata("intInShortRangeWithPossibleOverflow.kt") + public void testIntInShortRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/intInShortRangeWithPossibleOverflow.kt"); + } + @TestMetadata("kt20106.kt") public void testKt20106() throws Exception { runTest("compiler/testData/codegen/box/ranges/contains/kt20106.kt"); } + @TestMetadata("longInLongRangeWithPossibleOverflow.kt") + public void testLongInLongRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/longInLongRangeWithPossibleOverflow.kt"); + } + @TestMetadata("nullableInPrimitiveRange.kt") public void testNullableInPrimitiveRange() throws Exception { runTest("compiler/testData/codegen/box/ranges/contains/nullableInPrimitiveRange.kt"); @@ -19873,6 +19898,26 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/ranges/contains/smartCastOnBothEnds.kt"); } + @TestMetadata("uintInUByteRangeWithPossibleOverflow.kt") + public void testUintInUByteRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/uintInUByteRangeWithPossibleOverflow.kt"); + } + + @TestMetadata("uintInUIntRangeWithPossibleOverflow.kt") + public void testUintInUIntRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/uintInUIntRangeWithPossibleOverflow.kt"); + } + + @TestMetadata("uintInUShortRangeWithPossibleOverflow.kt") + public void testUintInUShortRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/uintInUShortRangeWithPossibleOverflow.kt"); + } + + @TestMetadata("ulongInULongRangeWithPossibleOverflow.kt") + public void testUlongInULongRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/ulongInULongRangeWithPossibleOverflow.kt"); + } + @TestMetadata("userDefinedContainsExtension.kt") public void testUserDefinedContainsExtension() throws Exception { runTest("compiler/testData/codegen/box/ranges/contains/userDefinedContainsExtension.kt"); 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 0c0d7c0e5e7..77b66474e2b 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 @@ -19723,6 +19723,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/ranges/contains"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); } + @TestMetadata("charInCharRangeWithPossibleOverflow.kt") + public void testCharInCharRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/charInCharRangeWithPossibleOverflow.kt"); + } + @TestMetadata("comparisonWithRangeBoundEliminated.kt") public void testComparisonWithRangeBoundEliminated() throws Exception { runTest("compiler/testData/codegen/box/ranges/contains/comparisonWithRangeBoundEliminated.kt"); @@ -19903,11 +19908,31 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/ranges/contains/inUntilMinValueNonConst.kt"); } + @TestMetadata("intInByteRangeWithPossibleOverflow.kt") + public void testIntInByteRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/intInByteRangeWithPossibleOverflow.kt"); + } + + @TestMetadata("intInIntRangeWithPossibleOverflow.kt") + public void testIntInIntRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/intInIntRangeWithPossibleOverflow.kt"); + } + + @TestMetadata("intInShortRangeWithPossibleOverflow.kt") + public void testIntInShortRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/intInShortRangeWithPossibleOverflow.kt"); + } + @TestMetadata("kt20106.kt") public void testKt20106() throws Exception { runTest("compiler/testData/codegen/box/ranges/contains/kt20106.kt"); } + @TestMetadata("longInLongRangeWithPossibleOverflow.kt") + public void testLongInLongRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/longInLongRangeWithPossibleOverflow.kt"); + } + @TestMetadata("nullableInPrimitiveRange.kt") public void testNullableInPrimitiveRange() throws Exception { runTest("compiler/testData/codegen/box/ranges/contains/nullableInPrimitiveRange.kt"); @@ -19923,6 +19948,26 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/ranges/contains/smartCastOnBothEnds.kt"); } + @TestMetadata("uintInUByteRangeWithPossibleOverflow.kt") + public void testUintInUByteRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/uintInUByteRangeWithPossibleOverflow.kt"); + } + + @TestMetadata("uintInUIntRangeWithPossibleOverflow.kt") + public void testUintInUIntRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/uintInUIntRangeWithPossibleOverflow.kt"); + } + + @TestMetadata("uintInUShortRangeWithPossibleOverflow.kt") + public void testUintInUShortRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/uintInUShortRangeWithPossibleOverflow.kt"); + } + + @TestMetadata("ulongInULongRangeWithPossibleOverflow.kt") + public void testUlongInULongRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/ulongInULongRangeWithPossibleOverflow.kt"); + } + @TestMetadata("userDefinedContainsExtension.kt") public void testUserDefinedContainsExtension() throws Exception { runTest("compiler/testData/codegen/box/ranges/contains/userDefinedContainsExtension.kt"); 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 795849fbcb7..6d87d8a3c77 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 @@ -12654,6 +12654,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/ranges/contains"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); } + @TestMetadata("charInCharRangeWithPossibleOverflow.kt") + public void testCharInCharRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/charInCharRangeWithPossibleOverflow.kt"); + } + @TestMetadata("comparisonWithRangeBoundEliminated.kt") public void testComparisonWithRangeBoundEliminated() throws Exception { runTest("compiler/testData/codegen/box/ranges/contains/comparisonWithRangeBoundEliminated.kt"); @@ -12724,6 +12729,26 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/ranges/contains/inUntilMinValueNonConst.kt"); } + @TestMetadata("intInByteRangeWithPossibleOverflow.kt") + public void testIntInByteRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/intInByteRangeWithPossibleOverflow.kt"); + } + + @TestMetadata("intInIntRangeWithPossibleOverflow.kt") + public void testIntInIntRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/intInIntRangeWithPossibleOverflow.kt"); + } + + @TestMetadata("intInShortRangeWithPossibleOverflow.kt") + public void testIntInShortRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/intInShortRangeWithPossibleOverflow.kt"); + } + + @TestMetadata("longInLongRangeWithPossibleOverflow.kt") + public void testLongInLongRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/longInLongRangeWithPossibleOverflow.kt"); + } + @TestMetadata("nullableInPrimitiveRange.kt") public void testNullableInPrimitiveRange() throws Exception { runTest("compiler/testData/codegen/box/ranges/contains/nullableInPrimitiveRange.kt"); @@ -12739,6 +12764,26 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/ranges/contains/smartCastOnBothEnds.kt"); } + @TestMetadata("uintInUByteRangeWithPossibleOverflow.kt") + public void testUintInUByteRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/uintInUByteRangeWithPossibleOverflow.kt"); + } + + @TestMetadata("uintInUIntRangeWithPossibleOverflow.kt") + public void testUintInUIntRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/uintInUIntRangeWithPossibleOverflow.kt"); + } + + @TestMetadata("uintInUShortRangeWithPossibleOverflow.kt") + public void testUintInUShortRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/uintInUShortRangeWithPossibleOverflow.kt"); + } + + @TestMetadata("ulongInULongRangeWithPossibleOverflow.kt") + public void testUlongInULongRangeWithPossibleOverflow() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/ulongInULongRangeWithPossibleOverflow.kt"); + } + @TestMetadata("userDefinedContainsExtension.kt") public void testUserDefinedContainsExtension() throws Exception { runTest("compiler/testData/codegen/box/ranges/contains/userDefinedContainsExtension.kt");