diff --git a/compiler/testData/codegen/box/ranges/expression/emptyDownto.kt b/compiler/testData/codegen/box/ranges/expression/emptyDownto.kt index 75880835761..ddde88f8c3b 100644 --- a/compiler/testData/codegen/box/ranges/expression/emptyDownto.kt +++ b/compiler/testData/codegen/box/ranges/expression/emptyDownto.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() val range1 = 5 downTo 10 diff --git a/compiler/testData/codegen/box/ranges/expression/emptyRange.kt b/compiler/testData/codegen/box/ranges/expression/emptyRange.kt index cfea55b3a37..a7d9cec4a62 100644 --- a/compiler/testData/codegen/box/ranges/expression/emptyRange.kt +++ b/compiler/testData/codegen/box/ranges/expression/emptyRange.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() val range1 = 10..5 diff --git a/compiler/testData/codegen/box/ranges/expression/inexactDownToMinValue.kt b/compiler/testData/codegen/box/ranges/expression/inexactDownToMinValue.kt index 01742296e15..79ba651fb3b 100644 --- a/compiler/testData/codegen/box/ranges/expression/inexactDownToMinValue.kt +++ b/compiler/testData/codegen/box/ranges/expression/inexactDownToMinValue.kt @@ -1,26 +1,15 @@ // TODO: muted automatically, investigate should it be ran for JS_IR or not // IGNORE_BACKEND: JS_IR -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - -// TODO: muted automatically, investigate should it be ran for NATIVE or not -// IGNORE_BACKEND: NATIVE - // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME -import java.lang.Integer.MAX_VALUE as MaxI -import java.lang.Integer.MIN_VALUE as MinI -import java.lang.Byte.MAX_VALUE as MaxB -import java.lang.Byte.MIN_VALUE as MinB -import java.lang.Short.MAX_VALUE as MaxS -import java.lang.Short.MIN_VALUE as MinS -import java.lang.Long.MAX_VALUE as MaxL -import java.lang.Long.MIN_VALUE as MinL -import java.lang.Character.MAX_VALUE as MaxC -import java.lang.Character.MIN_VALUE as MinC +const val MinI = Int.MIN_VALUE +const val MinB = Byte.MIN_VALUE +const val MinS = Short.MIN_VALUE +const val MinL = Long.MIN_VALUE +const val MinC = Char.MIN_VALUE fun box(): String { val list1 = ArrayList() diff --git a/compiler/testData/codegen/box/ranges/expression/inexactSteppedDownTo.kt b/compiler/testData/codegen/box/ranges/expression/inexactSteppedDownTo.kt index 34bbbb10d9c..026374f3ee9 100644 --- a/compiler/testData/codegen/box/ranges/expression/inexactSteppedDownTo.kt +++ b/compiler/testData/codegen/box/ranges/expression/inexactSteppedDownTo.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() val range1 = 8 downTo 3 step 2 diff --git a/compiler/testData/codegen/box/ranges/expression/inexactSteppedRange.kt b/compiler/testData/codegen/box/ranges/expression/inexactSteppedRange.kt index 35368b0f5c6..8d6ef96540f 100644 --- a/compiler/testData/codegen/box/ranges/expression/inexactSteppedRange.kt +++ b/compiler/testData/codegen/box/ranges/expression/inexactSteppedRange.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() val range1 = 3..8 step 2 diff --git a/compiler/testData/codegen/box/ranges/expression/inexactToMaxValue.kt b/compiler/testData/codegen/box/ranges/expression/inexactToMaxValue.kt index dfab085e26f..3fd404fe696 100644 --- a/compiler/testData/codegen/box/ranges/expression/inexactToMaxValue.kt +++ b/compiler/testData/codegen/box/ranges/expression/inexactToMaxValue.kt @@ -1,26 +1,15 @@ // TODO: muted automatically, investigate should it be ran for JS_IR or not // IGNORE_BACKEND: JS_IR -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - -// TODO: muted automatically, investigate should it be ran for NATIVE or not -// IGNORE_BACKEND: NATIVE - // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME -import java.lang.Integer.MAX_VALUE as MaxI -import java.lang.Integer.MIN_VALUE as MinI -import java.lang.Byte.MAX_VALUE as MaxB -import java.lang.Byte.MIN_VALUE as MinB -import java.lang.Short.MAX_VALUE as MaxS -import java.lang.Short.MIN_VALUE as MinS -import java.lang.Long.MAX_VALUE as MaxL -import java.lang.Long.MIN_VALUE as MinL -import java.lang.Character.MAX_VALUE as MaxC -import java.lang.Character.MIN_VALUE as MinC +const val MaxI = Int.MAX_VALUE +const val MaxB = Byte.MAX_VALUE +const val MaxS = Short.MAX_VALUE +const val MaxL = Long.MAX_VALUE +const val MaxC = Char.MAX_VALUE fun box(): String { val list1 = ArrayList() diff --git a/compiler/testData/codegen/box/ranges/expression/maxValueMinusTwoToMaxValue.kt b/compiler/testData/codegen/box/ranges/expression/maxValueMinusTwoToMaxValue.kt index 942c0713afc..78ecf8b183d 100644 --- a/compiler/testData/codegen/box/ranges/expression/maxValueMinusTwoToMaxValue.kt +++ b/compiler/testData/codegen/box/ranges/expression/maxValueMinusTwoToMaxValue.kt @@ -1,26 +1,15 @@ // TODO: muted automatically, investigate should it be ran for JS_IR or not // IGNORE_BACKEND: JS_IR -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - -// TODO: muted automatically, investigate should it be ran for NATIVE or not -// IGNORE_BACKEND: NATIVE - // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME -import java.lang.Integer.MAX_VALUE as MaxI -import java.lang.Integer.MIN_VALUE as MinI -import java.lang.Byte.MAX_VALUE as MaxB -import java.lang.Byte.MIN_VALUE as MinB -import java.lang.Short.MAX_VALUE as MaxS -import java.lang.Short.MIN_VALUE as MinS -import java.lang.Long.MAX_VALUE as MaxL -import java.lang.Long.MIN_VALUE as MinL -import java.lang.Character.MAX_VALUE as MaxC -import java.lang.Character.MIN_VALUE as MinC +const val MaxI = Int.MAX_VALUE +const val MaxB = Byte.MAX_VALUE +const val MaxS = Short.MAX_VALUE +const val MaxL = Long.MAX_VALUE +const val MaxC = Char.MAX_VALUE fun box(): String { val list1 = ArrayList() diff --git a/compiler/testData/codegen/box/ranges/expression/maxValueToMaxValue.kt b/compiler/testData/codegen/box/ranges/expression/maxValueToMaxValue.kt index b200641e5e4..0db7515c90e 100644 --- a/compiler/testData/codegen/box/ranges/expression/maxValueToMaxValue.kt +++ b/compiler/testData/codegen/box/ranges/expression/maxValueToMaxValue.kt @@ -1,26 +1,15 @@ // TODO: muted automatically, investigate should it be ran for JS_IR or not // IGNORE_BACKEND: JS_IR -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - -// TODO: muted automatically, investigate should it be ran for NATIVE or not -// IGNORE_BACKEND: NATIVE - // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME -import java.lang.Integer.MAX_VALUE as MaxI -import java.lang.Integer.MIN_VALUE as MinI -import java.lang.Byte.MAX_VALUE as MaxB -import java.lang.Byte.MIN_VALUE as MinB -import java.lang.Short.MAX_VALUE as MaxS -import java.lang.Short.MIN_VALUE as MinS -import java.lang.Long.MAX_VALUE as MaxL -import java.lang.Long.MIN_VALUE as MinL -import java.lang.Character.MAX_VALUE as MaxC -import java.lang.Character.MIN_VALUE as MinC +const val MaxI = Int.MAX_VALUE +const val MaxB = Byte.MAX_VALUE +const val MaxS = Short.MAX_VALUE +const val MaxL = Long.MAX_VALUE +const val MaxC = Char.MAX_VALUE fun box(): String { val list1 = ArrayList() diff --git a/compiler/testData/codegen/box/ranges/expression/maxValueToMinValue.kt b/compiler/testData/codegen/box/ranges/expression/maxValueToMinValue.kt index 27ab145f4fe..2114baae529 100644 --- a/compiler/testData/codegen/box/ranges/expression/maxValueToMinValue.kt +++ b/compiler/testData/codegen/box/ranges/expression/maxValueToMinValue.kt @@ -1,26 +1,20 @@ // TODO: muted automatically, investigate should it be ran for JS_IR or not // IGNORE_BACKEND: JS_IR -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - -// TODO: muted automatically, investigate should it be ran for NATIVE or not -// IGNORE_BACKEND: NATIVE - // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME -import java.lang.Integer.MAX_VALUE as MaxI -import java.lang.Integer.MIN_VALUE as MinI -import java.lang.Byte.MAX_VALUE as MaxB -import java.lang.Byte.MIN_VALUE as MinB -import java.lang.Short.MAX_VALUE as MaxS -import java.lang.Short.MIN_VALUE as MinS -import java.lang.Long.MAX_VALUE as MaxL -import java.lang.Long.MIN_VALUE as MinL -import java.lang.Character.MAX_VALUE as MaxC -import java.lang.Character.MIN_VALUE as MinC +const val MaxI = Int.MAX_VALUE +const val MinI = Int.MIN_VALUE +const val MaxB = Byte.MAX_VALUE +const val MinB = Byte.MIN_VALUE +const val MaxS = Short.MAX_VALUE +const val MinS = Short.MIN_VALUE +const val MaxL = Long.MAX_VALUE +const val MinL = Long.MIN_VALUE +const val MaxC = Char.MAX_VALUE +const val MinC = Char.MIN_VALUE fun box(): String { val list1 = ArrayList() diff --git a/compiler/testData/codegen/box/ranges/expression/oneElementDownTo.kt b/compiler/testData/codegen/box/ranges/expression/oneElementDownTo.kt index e50f10bf98f..beb5eaa3b44 100644 --- a/compiler/testData/codegen/box/ranges/expression/oneElementDownTo.kt +++ b/compiler/testData/codegen/box/ranges/expression/oneElementDownTo.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() val range1 = 5 downTo 5 diff --git a/compiler/testData/codegen/box/ranges/expression/oneElementRange.kt b/compiler/testData/codegen/box/ranges/expression/oneElementRange.kt index 46da3795740..bc921310360 100644 --- a/compiler/testData/codegen/box/ranges/expression/oneElementRange.kt +++ b/compiler/testData/codegen/box/ranges/expression/oneElementRange.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() val range1 = 5..5 diff --git a/compiler/testData/codegen/box/ranges/expression/openRange.kt b/compiler/testData/codegen/box/ranges/expression/openRange.kt index 0bd20bfebdb..44309cdd129 100644 --- a/compiler/testData/codegen/box/ranges/expression/openRange.kt +++ b/compiler/testData/codegen/box/ranges/expression/openRange.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() val range1 = 1 until 5 diff --git a/compiler/testData/codegen/box/ranges/expression/overflowZeroDownToMaxValue.kt b/compiler/testData/codegen/box/ranges/expression/overflowZeroDownToMaxValue.kt index 6da1957ed05..40fcbe2e2ab 100644 --- a/compiler/testData/codegen/box/ranges/expression/overflowZeroDownToMaxValue.kt +++ b/compiler/testData/codegen/box/ranges/expression/overflowZeroDownToMaxValue.kt @@ -1,26 +1,12 @@ // TODO: muted automatically, investigate should it be ran for JS_IR or not // IGNORE_BACKEND: JS_IR -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - -// TODO: muted automatically, investigate should it be ran for NATIVE or not -// IGNORE_BACKEND: NATIVE - // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME -import java.lang.Integer.MAX_VALUE as MaxI -import java.lang.Integer.MIN_VALUE as MinI -import java.lang.Byte.MAX_VALUE as MaxB -import java.lang.Byte.MIN_VALUE as MinB -import java.lang.Short.MAX_VALUE as MaxS -import java.lang.Short.MIN_VALUE as MinS -import java.lang.Long.MAX_VALUE as MaxL -import java.lang.Long.MIN_VALUE as MinL -import java.lang.Character.MAX_VALUE as MaxC -import java.lang.Character.MIN_VALUE as MinC +const val MaxI = Int.MAX_VALUE +const val MaxL = Long.MAX_VALUE fun box(): String { val list1 = ArrayList() diff --git a/compiler/testData/codegen/box/ranges/expression/overflowZeroToMinValue.kt b/compiler/testData/codegen/box/ranges/expression/overflowZeroToMinValue.kt index 099c6d6837b..99f01e4e741 100644 --- a/compiler/testData/codegen/box/ranges/expression/overflowZeroToMinValue.kt +++ b/compiler/testData/codegen/box/ranges/expression/overflowZeroToMinValue.kt @@ -1,26 +1,12 @@ // TODO: muted automatically, investigate should it be ran for JS_IR or not // IGNORE_BACKEND: JS_IR -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - -// TODO: muted automatically, investigate should it be ran for NATIVE or not -// IGNORE_BACKEND: NATIVE - // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME -import java.lang.Integer.MAX_VALUE as MaxI -import java.lang.Integer.MIN_VALUE as MinI -import java.lang.Byte.MAX_VALUE as MaxB -import java.lang.Byte.MIN_VALUE as MinB -import java.lang.Short.MAX_VALUE as MaxS -import java.lang.Short.MIN_VALUE as MinS -import java.lang.Long.MAX_VALUE as MaxL -import java.lang.Long.MIN_VALUE as MinL -import java.lang.Character.MAX_VALUE as MaxC -import java.lang.Character.MIN_VALUE as MinC +const val MinI = Int.MIN_VALUE +const val MinL = Long.MIN_VALUE fun box(): String { val list1 = ArrayList() diff --git a/compiler/testData/codegen/box/ranges/expression/progressionDownToMinValue.kt b/compiler/testData/codegen/box/ranges/expression/progressionDownToMinValue.kt index 8f24ba7884c..7d701ce34d1 100644 --- a/compiler/testData/codegen/box/ranges/expression/progressionDownToMinValue.kt +++ b/compiler/testData/codegen/box/ranges/expression/progressionDownToMinValue.kt @@ -1,26 +1,15 @@ // TODO: muted automatically, investigate should it be ran for JS_IR or not // IGNORE_BACKEND: JS_IR -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - -// TODO: muted automatically, investigate should it be ran for NATIVE or not -// IGNORE_BACKEND: NATIVE - // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME -import java.lang.Integer.MAX_VALUE as MaxI -import java.lang.Integer.MIN_VALUE as MinI -import java.lang.Byte.MAX_VALUE as MaxB -import java.lang.Byte.MIN_VALUE as MinB -import java.lang.Short.MAX_VALUE as MaxS -import java.lang.Short.MIN_VALUE as MinS -import java.lang.Long.MAX_VALUE as MaxL -import java.lang.Long.MIN_VALUE as MinL -import java.lang.Character.MAX_VALUE as MaxC -import java.lang.Character.MIN_VALUE as MinC +const val MinI = Int.MIN_VALUE +const val MinB = Byte.MIN_VALUE +const val MinS = Short.MIN_VALUE +const val MinL = Long.MIN_VALUE +const val MinC = Char.MIN_VALUE fun box(): String { val list1 = ArrayList() diff --git a/compiler/testData/codegen/box/ranges/expression/progressionMaxValueMinusTwoToMaxValue.kt b/compiler/testData/codegen/box/ranges/expression/progressionMaxValueMinusTwoToMaxValue.kt index 58e009cd45e..b02badbaeb0 100644 --- a/compiler/testData/codegen/box/ranges/expression/progressionMaxValueMinusTwoToMaxValue.kt +++ b/compiler/testData/codegen/box/ranges/expression/progressionMaxValueMinusTwoToMaxValue.kt @@ -1,26 +1,15 @@ // TODO: muted automatically, investigate should it be ran for JS_IR or not // IGNORE_BACKEND: JS_IR -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - -// TODO: muted automatically, investigate should it be ran for NATIVE or not -// IGNORE_BACKEND: NATIVE - // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME -import java.lang.Integer.MAX_VALUE as MaxI -import java.lang.Integer.MIN_VALUE as MinI -import java.lang.Byte.MAX_VALUE as MaxB -import java.lang.Byte.MIN_VALUE as MinB -import java.lang.Short.MAX_VALUE as MaxS -import java.lang.Short.MIN_VALUE as MinS -import java.lang.Long.MAX_VALUE as MaxL -import java.lang.Long.MIN_VALUE as MinL -import java.lang.Character.MAX_VALUE as MaxC -import java.lang.Character.MIN_VALUE as MinC +const val MaxI = Int.MAX_VALUE +const val MaxB = Byte.MAX_VALUE +const val MaxS = Short.MAX_VALUE +const val MaxL = Long.MAX_VALUE +const val MaxC = Char.MAX_VALUE fun box(): String { val list1 = ArrayList() diff --git a/compiler/testData/codegen/box/ranges/expression/progressionMaxValueToMaxValue.kt b/compiler/testData/codegen/box/ranges/expression/progressionMaxValueToMaxValue.kt index c298ec6f3c4..7e537aed6f8 100644 --- a/compiler/testData/codegen/box/ranges/expression/progressionMaxValueToMaxValue.kt +++ b/compiler/testData/codegen/box/ranges/expression/progressionMaxValueToMaxValue.kt @@ -1,26 +1,15 @@ // TODO: muted automatically, investigate should it be ran for JS_IR or not // IGNORE_BACKEND: JS_IR -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - -// TODO: muted automatically, investigate should it be ran for NATIVE or not -// IGNORE_BACKEND: NATIVE - // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME -import java.lang.Integer.MAX_VALUE as MaxI -import java.lang.Integer.MIN_VALUE as MinI -import java.lang.Byte.MAX_VALUE as MaxB -import java.lang.Byte.MIN_VALUE as MinB -import java.lang.Short.MAX_VALUE as MaxS -import java.lang.Short.MIN_VALUE as MinS -import java.lang.Long.MAX_VALUE as MaxL -import java.lang.Long.MIN_VALUE as MinL -import java.lang.Character.MAX_VALUE as MaxC -import java.lang.Character.MIN_VALUE as MinC +const val MaxI = Int.MAX_VALUE +const val MaxB = Byte.MAX_VALUE +const val MaxS = Short.MAX_VALUE +const val MaxL = Long.MAX_VALUE +const val MaxC = Char.MAX_VALUE fun box(): String { val list1 = ArrayList() diff --git a/compiler/testData/codegen/box/ranges/expression/progressionMaxValueToMinValue.kt b/compiler/testData/codegen/box/ranges/expression/progressionMaxValueToMinValue.kt index b8fce399fe9..8ae9c9e874d 100644 --- a/compiler/testData/codegen/box/ranges/expression/progressionMaxValueToMinValue.kt +++ b/compiler/testData/codegen/box/ranges/expression/progressionMaxValueToMinValue.kt @@ -1,26 +1,20 @@ // TODO: muted automatically, investigate should it be ran for JS_IR or not // IGNORE_BACKEND: JS_IR -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - -// TODO: muted automatically, investigate should it be ran for NATIVE or not -// IGNORE_BACKEND: NATIVE - // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME -import java.lang.Integer.MAX_VALUE as MaxI -import java.lang.Integer.MIN_VALUE as MinI -import java.lang.Byte.MAX_VALUE as MaxB -import java.lang.Byte.MIN_VALUE as MinB -import java.lang.Short.MAX_VALUE as MaxS -import java.lang.Short.MIN_VALUE as MinS -import java.lang.Long.MAX_VALUE as MaxL -import java.lang.Long.MIN_VALUE as MinL -import java.lang.Character.MAX_VALUE as MaxC -import java.lang.Character.MIN_VALUE as MinC +const val MaxI = Int.MAX_VALUE +const val MinI = Int.MIN_VALUE +const val MaxB = Byte.MAX_VALUE +const val MinB = Byte.MIN_VALUE +const val MaxS = Short.MAX_VALUE +const val MinS = Short.MIN_VALUE +const val MaxL = Long.MAX_VALUE +const val MinL = Long.MIN_VALUE +const val MaxC = Char.MAX_VALUE +const val MinC = Char.MIN_VALUE fun box(): String { val list1 = ArrayList() diff --git a/compiler/testData/codegen/box/ranges/expression/progressionMinValueToMinValue.kt b/compiler/testData/codegen/box/ranges/expression/progressionMinValueToMinValue.kt index 4c92dc2d8ce..7609130c065 100644 --- a/compiler/testData/codegen/box/ranges/expression/progressionMinValueToMinValue.kt +++ b/compiler/testData/codegen/box/ranges/expression/progressionMinValueToMinValue.kt @@ -1,26 +1,15 @@ // TODO: muted automatically, investigate should it be ran for JS_IR or not // IGNORE_BACKEND: JS_IR -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - -// TODO: muted automatically, investigate should it be ran for NATIVE or not -// IGNORE_BACKEND: NATIVE - // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME -import java.lang.Integer.MAX_VALUE as MaxI -import java.lang.Integer.MIN_VALUE as MinI -import java.lang.Byte.MAX_VALUE as MaxB -import java.lang.Byte.MIN_VALUE as MinB -import java.lang.Short.MAX_VALUE as MaxS -import java.lang.Short.MIN_VALUE as MinS -import java.lang.Long.MAX_VALUE as MaxL -import java.lang.Long.MIN_VALUE as MinL -import java.lang.Character.MAX_VALUE as MaxC -import java.lang.Character.MIN_VALUE as MinC +const val MinI = Int.MIN_VALUE +const val MinB = Byte.MIN_VALUE +const val MinS = Short.MIN_VALUE +const val MinL = Long.MIN_VALUE +const val MinC = Char.MIN_VALUE fun box(): String { val list1 = ArrayList() diff --git a/compiler/testData/codegen/box/ranges/expression/reversedBackSequence.kt b/compiler/testData/codegen/box/ranges/expression/reversedBackSequence.kt index 3387ec34fd7..f8b4046a626 100644 --- a/compiler/testData/codegen/box/ranges/expression/reversedBackSequence.kt +++ b/compiler/testData/codegen/box/ranges/expression/reversedBackSequence.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() val range1 = (5 downTo 3).reversed() diff --git a/compiler/testData/codegen/box/ranges/expression/reversedEmptyBackSequence.kt b/compiler/testData/codegen/box/ranges/expression/reversedEmptyBackSequence.kt index 82db4a1e8d3..ce049bb6858 100644 --- a/compiler/testData/codegen/box/ranges/expression/reversedEmptyBackSequence.kt +++ b/compiler/testData/codegen/box/ranges/expression/reversedEmptyBackSequence.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() val range1 = (3 downTo 5).reversed() diff --git a/compiler/testData/codegen/box/ranges/expression/reversedEmptyRange.kt b/compiler/testData/codegen/box/ranges/expression/reversedEmptyRange.kt index c62a13f4bb5..bc875f7077e 100644 --- a/compiler/testData/codegen/box/ranges/expression/reversedEmptyRange.kt +++ b/compiler/testData/codegen/box/ranges/expression/reversedEmptyRange.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() val range1 = (5..3).reversed() diff --git a/compiler/testData/codegen/box/ranges/expression/reversedInexactSteppedDownTo.kt b/compiler/testData/codegen/box/ranges/expression/reversedInexactSteppedDownTo.kt index e04ac34b17d..9b1ec0d18bd 100644 --- a/compiler/testData/codegen/box/ranges/expression/reversedInexactSteppedDownTo.kt +++ b/compiler/testData/codegen/box/ranges/expression/reversedInexactSteppedDownTo.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() val range1 = (8 downTo 3 step 2).reversed() diff --git a/compiler/testData/codegen/box/ranges/expression/reversedRange.kt b/compiler/testData/codegen/box/ranges/expression/reversedRange.kt index a3174cd3722..d3769145a9f 100644 --- a/compiler/testData/codegen/box/ranges/expression/reversedRange.kt +++ b/compiler/testData/codegen/box/ranges/expression/reversedRange.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() val range1 = (3..5).reversed() diff --git a/compiler/testData/codegen/box/ranges/expression/reversedSimpleSteppedRange.kt b/compiler/testData/codegen/box/ranges/expression/reversedSimpleSteppedRange.kt index b2bf8399eca..1bd083140c1 100644 --- a/compiler/testData/codegen/box/ranges/expression/reversedSimpleSteppedRange.kt +++ b/compiler/testData/codegen/box/ranges/expression/reversedSimpleSteppedRange.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() val range1 = (3..9 step 2).reversed() diff --git a/compiler/testData/codegen/box/ranges/expression/simpleDownTo.kt b/compiler/testData/codegen/box/ranges/expression/simpleDownTo.kt index 5bcc780e846..a9d5af6fddb 100644 --- a/compiler/testData/codegen/box/ranges/expression/simpleDownTo.kt +++ b/compiler/testData/codegen/box/ranges/expression/simpleDownTo.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() val range1 = 9 downTo 3 diff --git a/compiler/testData/codegen/box/ranges/expression/simpleRange.kt b/compiler/testData/codegen/box/ranges/expression/simpleRange.kt index ab0c1a6357b..8963711c92c 100644 --- a/compiler/testData/codegen/box/ranges/expression/simpleRange.kt +++ b/compiler/testData/codegen/box/ranges/expression/simpleRange.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() val range1 = 3..9 diff --git a/compiler/testData/codegen/box/ranges/expression/simpleRangeWithNonConstantEnds.kt b/compiler/testData/codegen/box/ranges/expression/simpleRangeWithNonConstantEnds.kt index 0071936e665..ae4d4ede42f 100644 --- a/compiler/testData/codegen/box/ranges/expression/simpleRangeWithNonConstantEnds.kt +++ b/compiler/testData/codegen/box/ranges/expression/simpleRangeWithNonConstantEnds.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() val range1 = (1 + 2)..(10 - 1) diff --git a/compiler/testData/codegen/box/ranges/expression/simpleSteppedDownTo.kt b/compiler/testData/codegen/box/ranges/expression/simpleSteppedDownTo.kt index f837143796b..06b54d1d3e5 100644 --- a/compiler/testData/codegen/box/ranges/expression/simpleSteppedDownTo.kt +++ b/compiler/testData/codegen/box/ranges/expression/simpleSteppedDownTo.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() val range1 = 9 downTo 3 step 2 diff --git a/compiler/testData/codegen/box/ranges/expression/simpleSteppedRange.kt b/compiler/testData/codegen/box/ranges/expression/simpleSteppedRange.kt index 057daf28d5c..8c7706e4cce 100644 --- a/compiler/testData/codegen/box/ranges/expression/simpleSteppedRange.kt +++ b/compiler/testData/codegen/box/ranges/expression/simpleSteppedRange.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() val range1 = 3..9 step 2 diff --git a/compiler/testData/codegen/box/ranges/literal/emptyDownto.kt b/compiler/testData/codegen/box/ranges/literal/emptyDownto.kt index 450642d1a70..6599dcb1bf5 100644 --- a/compiler/testData/codegen/box/ranges/literal/emptyDownto.kt +++ b/compiler/testData/codegen/box/ranges/literal/emptyDownto.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() for (i in 5 downTo 10) { diff --git a/compiler/testData/codegen/box/ranges/literal/emptyRange.kt b/compiler/testData/codegen/box/ranges/literal/emptyRange.kt index 4a6492a25d6..d867f31ae97 100644 --- a/compiler/testData/codegen/box/ranges/literal/emptyRange.kt +++ b/compiler/testData/codegen/box/ranges/literal/emptyRange.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() for (i in 10..5) { diff --git a/compiler/testData/codegen/box/ranges/literal/inexactDownToMinValue.kt b/compiler/testData/codegen/box/ranges/literal/inexactDownToMinValue.kt index 76324817e51..b0398f00a44 100644 --- a/compiler/testData/codegen/box/ranges/literal/inexactDownToMinValue.kt +++ b/compiler/testData/codegen/box/ranges/literal/inexactDownToMinValue.kt @@ -1,26 +1,15 @@ // TODO: muted automatically, investigate should it be ran for JS_IR or not // IGNORE_BACKEND: JS_IR -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - -// TODO: muted automatically, investigate should it be ran for NATIVE or not -// IGNORE_BACKEND: NATIVE - // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME -import java.lang.Integer.MAX_VALUE as MaxI -import java.lang.Integer.MIN_VALUE as MinI -import java.lang.Byte.MAX_VALUE as MaxB -import java.lang.Byte.MIN_VALUE as MinB -import java.lang.Short.MAX_VALUE as MaxS -import java.lang.Short.MIN_VALUE as MinS -import java.lang.Long.MAX_VALUE as MaxL -import java.lang.Long.MIN_VALUE as MinL -import java.lang.Character.MAX_VALUE as MaxC -import java.lang.Character.MIN_VALUE as MinC +const val MinI = Int.MIN_VALUE +const val MinB = Byte.MIN_VALUE +const val MinS = Short.MIN_VALUE +const val MinL = Long.MIN_VALUE +const val MinC = Char.MIN_VALUE fun box(): String { val list1 = ArrayList() diff --git a/compiler/testData/codegen/box/ranges/literal/inexactSteppedDownTo.kt b/compiler/testData/codegen/box/ranges/literal/inexactSteppedDownTo.kt index f4876f395f1..a0075ff0102 100644 --- a/compiler/testData/codegen/box/ranges/literal/inexactSteppedDownTo.kt +++ b/compiler/testData/codegen/box/ranges/literal/inexactSteppedDownTo.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() for (i in 8 downTo 3 step 2) { diff --git a/compiler/testData/codegen/box/ranges/literal/inexactSteppedRange.kt b/compiler/testData/codegen/box/ranges/literal/inexactSteppedRange.kt index aa48f30db1b..e36ed099aeb 100644 --- a/compiler/testData/codegen/box/ranges/literal/inexactSteppedRange.kt +++ b/compiler/testData/codegen/box/ranges/literal/inexactSteppedRange.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() for (i in 3..8 step 2) { diff --git a/compiler/testData/codegen/box/ranges/literal/inexactToMaxValue.kt b/compiler/testData/codegen/box/ranges/literal/inexactToMaxValue.kt index a34b541aeeb..27c415850db 100644 --- a/compiler/testData/codegen/box/ranges/literal/inexactToMaxValue.kt +++ b/compiler/testData/codegen/box/ranges/literal/inexactToMaxValue.kt @@ -1,26 +1,15 @@ // TODO: muted automatically, investigate should it be ran for JS_IR or not // IGNORE_BACKEND: JS_IR -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - -// TODO: muted automatically, investigate should it be ran for NATIVE or not -// IGNORE_BACKEND: NATIVE - // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME -import java.lang.Integer.MAX_VALUE as MaxI -import java.lang.Integer.MIN_VALUE as MinI -import java.lang.Byte.MAX_VALUE as MaxB -import java.lang.Byte.MIN_VALUE as MinB -import java.lang.Short.MAX_VALUE as MaxS -import java.lang.Short.MIN_VALUE as MinS -import java.lang.Long.MAX_VALUE as MaxL -import java.lang.Long.MIN_VALUE as MinL -import java.lang.Character.MAX_VALUE as MaxC -import java.lang.Character.MIN_VALUE as MinC +const val MaxI = Int.MAX_VALUE +const val MaxB = Byte.MAX_VALUE +const val MaxS = Short.MAX_VALUE +const val MaxL = Long.MAX_VALUE +const val MaxC = Char.MAX_VALUE fun box(): String { val list1 = ArrayList() diff --git a/compiler/testData/codegen/box/ranges/literal/maxValueMinusTwoToMaxValue.kt b/compiler/testData/codegen/box/ranges/literal/maxValueMinusTwoToMaxValue.kt index 7d79b405feb..18a31e972d5 100644 --- a/compiler/testData/codegen/box/ranges/literal/maxValueMinusTwoToMaxValue.kt +++ b/compiler/testData/codegen/box/ranges/literal/maxValueMinusTwoToMaxValue.kt @@ -1,26 +1,15 @@ // TODO: muted automatically, investigate should it be ran for JS_IR or not // IGNORE_BACKEND: JS_IR -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - -// TODO: muted automatically, investigate should it be ran for NATIVE or not -// IGNORE_BACKEND: NATIVE - // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME -import java.lang.Integer.MAX_VALUE as MaxI -import java.lang.Integer.MIN_VALUE as MinI -import java.lang.Byte.MAX_VALUE as MaxB -import java.lang.Byte.MIN_VALUE as MinB -import java.lang.Short.MAX_VALUE as MaxS -import java.lang.Short.MIN_VALUE as MinS -import java.lang.Long.MAX_VALUE as MaxL -import java.lang.Long.MIN_VALUE as MinL -import java.lang.Character.MAX_VALUE as MaxC -import java.lang.Character.MIN_VALUE as MinC +const val MaxI = Int.MAX_VALUE +const val MaxB = Byte.MAX_VALUE +const val MaxS = Short.MAX_VALUE +const val MaxL = Long.MAX_VALUE +const val MaxC = Char.MAX_VALUE fun box(): String { val list1 = ArrayList() diff --git a/compiler/testData/codegen/box/ranges/literal/maxValueToMaxValue.kt b/compiler/testData/codegen/box/ranges/literal/maxValueToMaxValue.kt index a738edb5ee5..b1a35bd7907 100644 --- a/compiler/testData/codegen/box/ranges/literal/maxValueToMaxValue.kt +++ b/compiler/testData/codegen/box/ranges/literal/maxValueToMaxValue.kt @@ -1,26 +1,15 @@ // TODO: muted automatically, investigate should it be ran for JS_IR or not // IGNORE_BACKEND: JS_IR -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - -// TODO: muted automatically, investigate should it be ran for NATIVE or not -// IGNORE_BACKEND: NATIVE - // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME -import java.lang.Integer.MAX_VALUE as MaxI -import java.lang.Integer.MIN_VALUE as MinI -import java.lang.Byte.MAX_VALUE as MaxB -import java.lang.Byte.MIN_VALUE as MinB -import java.lang.Short.MAX_VALUE as MaxS -import java.lang.Short.MIN_VALUE as MinS -import java.lang.Long.MAX_VALUE as MaxL -import java.lang.Long.MIN_VALUE as MinL -import java.lang.Character.MAX_VALUE as MaxC -import java.lang.Character.MIN_VALUE as MinC +const val MaxI = Int.MAX_VALUE +const val MaxB = Byte.MAX_VALUE +const val MaxS = Short.MAX_VALUE +const val MaxL = Long.MAX_VALUE +const val MaxC = Char.MAX_VALUE fun box(): String { val list1 = ArrayList() diff --git a/compiler/testData/codegen/box/ranges/literal/maxValueToMinValue.kt b/compiler/testData/codegen/box/ranges/literal/maxValueToMinValue.kt index ac7785afa50..0ed777d3978 100644 --- a/compiler/testData/codegen/box/ranges/literal/maxValueToMinValue.kt +++ b/compiler/testData/codegen/box/ranges/literal/maxValueToMinValue.kt @@ -1,26 +1,20 @@ // TODO: muted automatically, investigate should it be ran for JS_IR or not // IGNORE_BACKEND: JS_IR -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - -// TODO: muted automatically, investigate should it be ran for NATIVE or not -// IGNORE_BACKEND: NATIVE - // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME -import java.lang.Integer.MAX_VALUE as MaxI -import java.lang.Integer.MIN_VALUE as MinI -import java.lang.Byte.MAX_VALUE as MaxB -import java.lang.Byte.MIN_VALUE as MinB -import java.lang.Short.MAX_VALUE as MaxS -import java.lang.Short.MIN_VALUE as MinS -import java.lang.Long.MAX_VALUE as MaxL -import java.lang.Long.MIN_VALUE as MinL -import java.lang.Character.MAX_VALUE as MaxC -import java.lang.Character.MIN_VALUE as MinC +const val MaxI = Int.MAX_VALUE +const val MinI = Int.MIN_VALUE +const val MaxB = Byte.MAX_VALUE +const val MinB = Byte.MIN_VALUE +const val MaxS = Short.MAX_VALUE +const val MinS = Short.MIN_VALUE +const val MaxL = Long.MAX_VALUE +const val MinL = Long.MIN_VALUE +const val MaxC = Char.MAX_VALUE +const val MinC = Char.MIN_VALUE fun box(): String { val list1 = ArrayList() diff --git a/compiler/testData/codegen/box/ranges/literal/oneElementDownTo.kt b/compiler/testData/codegen/box/ranges/literal/oneElementDownTo.kt index 38dc67612b3..9b4867a54f2 100644 --- a/compiler/testData/codegen/box/ranges/literal/oneElementDownTo.kt +++ b/compiler/testData/codegen/box/ranges/literal/oneElementDownTo.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() for (i in 5 downTo 5) { diff --git a/compiler/testData/codegen/box/ranges/literal/oneElementRange.kt b/compiler/testData/codegen/box/ranges/literal/oneElementRange.kt index 616626f6782..4560483f9d4 100644 --- a/compiler/testData/codegen/box/ranges/literal/oneElementRange.kt +++ b/compiler/testData/codegen/box/ranges/literal/oneElementRange.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() for (i in 5..5) { diff --git a/compiler/testData/codegen/box/ranges/literal/openRange.kt b/compiler/testData/codegen/box/ranges/literal/openRange.kt index b02b2e35889..62dfa7a0795 100644 --- a/compiler/testData/codegen/box/ranges/literal/openRange.kt +++ b/compiler/testData/codegen/box/ranges/literal/openRange.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() for (i in 1 until 5) { diff --git a/compiler/testData/codegen/box/ranges/literal/overflowZeroDownToMaxValue.kt b/compiler/testData/codegen/box/ranges/literal/overflowZeroDownToMaxValue.kt index 5c758aadf29..fd456b5a9a9 100644 --- a/compiler/testData/codegen/box/ranges/literal/overflowZeroDownToMaxValue.kt +++ b/compiler/testData/codegen/box/ranges/literal/overflowZeroDownToMaxValue.kt @@ -1,26 +1,12 @@ // TODO: muted automatically, investigate should it be ran for JS_IR or not // IGNORE_BACKEND: JS_IR -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - -// TODO: muted automatically, investigate should it be ran for NATIVE or not -// IGNORE_BACKEND: NATIVE - // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME -import java.lang.Integer.MAX_VALUE as MaxI -import java.lang.Integer.MIN_VALUE as MinI -import java.lang.Byte.MAX_VALUE as MaxB -import java.lang.Byte.MIN_VALUE as MinB -import java.lang.Short.MAX_VALUE as MaxS -import java.lang.Short.MIN_VALUE as MinS -import java.lang.Long.MAX_VALUE as MaxL -import java.lang.Long.MIN_VALUE as MinL -import java.lang.Character.MAX_VALUE as MaxC -import java.lang.Character.MIN_VALUE as MinC +const val MaxI = Int.MAX_VALUE +const val MaxL = Long.MAX_VALUE fun box(): String { val list1 = ArrayList() diff --git a/compiler/testData/codegen/box/ranges/literal/overflowZeroToMinValue.kt b/compiler/testData/codegen/box/ranges/literal/overflowZeroToMinValue.kt index b5e117f9e1e..d0cd08f075f 100644 --- a/compiler/testData/codegen/box/ranges/literal/overflowZeroToMinValue.kt +++ b/compiler/testData/codegen/box/ranges/literal/overflowZeroToMinValue.kt @@ -1,26 +1,12 @@ // TODO: muted automatically, investigate should it be ran for JS_IR or not // IGNORE_BACKEND: JS_IR -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - -// TODO: muted automatically, investigate should it be ran for NATIVE or not -// IGNORE_BACKEND: NATIVE - // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME -import java.lang.Integer.MAX_VALUE as MaxI -import java.lang.Integer.MIN_VALUE as MinI -import java.lang.Byte.MAX_VALUE as MaxB -import java.lang.Byte.MIN_VALUE as MinB -import java.lang.Short.MAX_VALUE as MaxS -import java.lang.Short.MIN_VALUE as MinS -import java.lang.Long.MAX_VALUE as MaxL -import java.lang.Long.MIN_VALUE as MinL -import java.lang.Character.MAX_VALUE as MaxC -import java.lang.Character.MIN_VALUE as MinC +const val MinI = Int.MIN_VALUE +const val MinL = Long.MIN_VALUE fun box(): String { val list1 = ArrayList() diff --git a/compiler/testData/codegen/box/ranges/literal/progressionDownToMinValue.kt b/compiler/testData/codegen/box/ranges/literal/progressionDownToMinValue.kt index 28e092d27dd..a0694e497b2 100644 --- a/compiler/testData/codegen/box/ranges/literal/progressionDownToMinValue.kt +++ b/compiler/testData/codegen/box/ranges/literal/progressionDownToMinValue.kt @@ -1,26 +1,15 @@ // TODO: muted automatically, investigate should it be ran for JS_IR or not // IGNORE_BACKEND: JS_IR -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - -// TODO: muted automatically, investigate should it be ran for NATIVE or not -// IGNORE_BACKEND: NATIVE - // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME -import java.lang.Integer.MAX_VALUE as MaxI -import java.lang.Integer.MIN_VALUE as MinI -import java.lang.Byte.MAX_VALUE as MaxB -import java.lang.Byte.MIN_VALUE as MinB -import java.lang.Short.MAX_VALUE as MaxS -import java.lang.Short.MIN_VALUE as MinS -import java.lang.Long.MAX_VALUE as MaxL -import java.lang.Long.MIN_VALUE as MinL -import java.lang.Character.MAX_VALUE as MaxC -import java.lang.Character.MIN_VALUE as MinC +const val MinI = Int.MIN_VALUE +const val MinB = Byte.MIN_VALUE +const val MinS = Short.MIN_VALUE +const val MinL = Long.MIN_VALUE +const val MinC = Char.MIN_VALUE fun box(): String { val list1 = ArrayList() diff --git a/compiler/testData/codegen/box/ranges/literal/progressionMaxValueMinusTwoToMaxValue.kt b/compiler/testData/codegen/box/ranges/literal/progressionMaxValueMinusTwoToMaxValue.kt index dcba36ab643..cffc943742b 100644 --- a/compiler/testData/codegen/box/ranges/literal/progressionMaxValueMinusTwoToMaxValue.kt +++ b/compiler/testData/codegen/box/ranges/literal/progressionMaxValueMinusTwoToMaxValue.kt @@ -1,26 +1,15 @@ // TODO: muted automatically, investigate should it be ran for JS_IR or not // IGNORE_BACKEND: JS_IR -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - -// TODO: muted automatically, investigate should it be ran for NATIVE or not -// IGNORE_BACKEND: NATIVE - // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME -import java.lang.Integer.MAX_VALUE as MaxI -import java.lang.Integer.MIN_VALUE as MinI -import java.lang.Byte.MAX_VALUE as MaxB -import java.lang.Byte.MIN_VALUE as MinB -import java.lang.Short.MAX_VALUE as MaxS -import java.lang.Short.MIN_VALUE as MinS -import java.lang.Long.MAX_VALUE as MaxL -import java.lang.Long.MIN_VALUE as MinL -import java.lang.Character.MAX_VALUE as MaxC -import java.lang.Character.MIN_VALUE as MinC +const val MaxI = Int.MAX_VALUE +const val MaxB = Byte.MAX_VALUE +const val MaxS = Short.MAX_VALUE +const val MaxL = Long.MAX_VALUE +const val MaxC = Char.MAX_VALUE fun box(): String { val list1 = ArrayList() diff --git a/compiler/testData/codegen/box/ranges/literal/progressionMaxValueToMaxValue.kt b/compiler/testData/codegen/box/ranges/literal/progressionMaxValueToMaxValue.kt index 06d4ccc37a9..edaed80b680 100644 --- a/compiler/testData/codegen/box/ranges/literal/progressionMaxValueToMaxValue.kt +++ b/compiler/testData/codegen/box/ranges/literal/progressionMaxValueToMaxValue.kt @@ -1,26 +1,15 @@ // TODO: muted automatically, investigate should it be ran for JS_IR or not // IGNORE_BACKEND: JS_IR -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - -// TODO: muted automatically, investigate should it be ran for NATIVE or not -// IGNORE_BACKEND: NATIVE - // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME -import java.lang.Integer.MAX_VALUE as MaxI -import java.lang.Integer.MIN_VALUE as MinI -import java.lang.Byte.MAX_VALUE as MaxB -import java.lang.Byte.MIN_VALUE as MinB -import java.lang.Short.MAX_VALUE as MaxS -import java.lang.Short.MIN_VALUE as MinS -import java.lang.Long.MAX_VALUE as MaxL -import java.lang.Long.MIN_VALUE as MinL -import java.lang.Character.MAX_VALUE as MaxC -import java.lang.Character.MIN_VALUE as MinC +const val MaxI = Int.MAX_VALUE +const val MaxB = Byte.MAX_VALUE +const val MaxS = Short.MAX_VALUE +const val MaxL = Long.MAX_VALUE +const val MaxC = Char.MAX_VALUE fun box(): String { val list1 = ArrayList() diff --git a/compiler/testData/codegen/box/ranges/literal/progressionMaxValueToMinValue.kt b/compiler/testData/codegen/box/ranges/literal/progressionMaxValueToMinValue.kt index 772f38150ad..c3d0fd6299a 100644 --- a/compiler/testData/codegen/box/ranges/literal/progressionMaxValueToMinValue.kt +++ b/compiler/testData/codegen/box/ranges/literal/progressionMaxValueToMinValue.kt @@ -1,26 +1,20 @@ // TODO: muted automatically, investigate should it be ran for JS_IR or not // IGNORE_BACKEND: JS_IR -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - -// TODO: muted automatically, investigate should it be ran for NATIVE or not -// IGNORE_BACKEND: NATIVE - // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME -import java.lang.Integer.MAX_VALUE as MaxI -import java.lang.Integer.MIN_VALUE as MinI -import java.lang.Byte.MAX_VALUE as MaxB -import java.lang.Byte.MIN_VALUE as MinB -import java.lang.Short.MAX_VALUE as MaxS -import java.lang.Short.MIN_VALUE as MinS -import java.lang.Long.MAX_VALUE as MaxL -import java.lang.Long.MIN_VALUE as MinL -import java.lang.Character.MAX_VALUE as MaxC -import java.lang.Character.MIN_VALUE as MinC +const val MaxI = Int.MAX_VALUE +const val MinI = Int.MIN_VALUE +const val MaxB = Byte.MAX_VALUE +const val MinB = Byte.MIN_VALUE +const val MaxS = Short.MAX_VALUE +const val MinS = Short.MIN_VALUE +const val MaxL = Long.MAX_VALUE +const val MinL = Long.MIN_VALUE +const val MaxC = Char.MAX_VALUE +const val MinC = Char.MIN_VALUE fun box(): String { val list1 = ArrayList() diff --git a/compiler/testData/codegen/box/ranges/literal/progressionMinValueToMinValue.kt b/compiler/testData/codegen/box/ranges/literal/progressionMinValueToMinValue.kt index 77762e90144..33d99174058 100644 --- a/compiler/testData/codegen/box/ranges/literal/progressionMinValueToMinValue.kt +++ b/compiler/testData/codegen/box/ranges/literal/progressionMinValueToMinValue.kt @@ -1,26 +1,15 @@ // TODO: muted automatically, investigate should it be ran for JS_IR or not // IGNORE_BACKEND: JS_IR -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - -// TODO: muted automatically, investigate should it be ran for NATIVE or not -// IGNORE_BACKEND: NATIVE - // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME -import java.lang.Integer.MAX_VALUE as MaxI -import java.lang.Integer.MIN_VALUE as MinI -import java.lang.Byte.MAX_VALUE as MaxB -import java.lang.Byte.MIN_VALUE as MinB -import java.lang.Short.MAX_VALUE as MaxS -import java.lang.Short.MIN_VALUE as MinS -import java.lang.Long.MAX_VALUE as MaxL -import java.lang.Long.MIN_VALUE as MinL -import java.lang.Character.MAX_VALUE as MaxC -import java.lang.Character.MIN_VALUE as MinC +const val MinI = Int.MIN_VALUE +const val MinB = Byte.MIN_VALUE +const val MinS = Short.MIN_VALUE +const val MinL = Long.MIN_VALUE +const val MinC = Char.MIN_VALUE fun box(): String { val list1 = ArrayList() diff --git a/compiler/testData/codegen/box/ranges/literal/reversedBackSequence.kt b/compiler/testData/codegen/box/ranges/literal/reversedBackSequence.kt index 6a261eaea9a..ad812b754b2 100644 --- a/compiler/testData/codegen/box/ranges/literal/reversedBackSequence.kt +++ b/compiler/testData/codegen/box/ranges/literal/reversedBackSequence.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() for (i in (5 downTo 3).reversed()) { diff --git a/compiler/testData/codegen/box/ranges/literal/reversedEmptyBackSequence.kt b/compiler/testData/codegen/box/ranges/literal/reversedEmptyBackSequence.kt index b1a5cff8433..4fbf2936165 100644 --- a/compiler/testData/codegen/box/ranges/literal/reversedEmptyBackSequence.kt +++ b/compiler/testData/codegen/box/ranges/literal/reversedEmptyBackSequence.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() for (i in (3 downTo 5).reversed()) { diff --git a/compiler/testData/codegen/box/ranges/literal/reversedEmptyRange.kt b/compiler/testData/codegen/box/ranges/literal/reversedEmptyRange.kt index 5538e8a5947..c681a373acd 100644 --- a/compiler/testData/codegen/box/ranges/literal/reversedEmptyRange.kt +++ b/compiler/testData/codegen/box/ranges/literal/reversedEmptyRange.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() for (i in (5..3).reversed()) { diff --git a/compiler/testData/codegen/box/ranges/literal/reversedInexactSteppedDownTo.kt b/compiler/testData/codegen/box/ranges/literal/reversedInexactSteppedDownTo.kt index b2f32252298..23e285692ee 100644 --- a/compiler/testData/codegen/box/ranges/literal/reversedInexactSteppedDownTo.kt +++ b/compiler/testData/codegen/box/ranges/literal/reversedInexactSteppedDownTo.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() for (i in (8 downTo 3 step 2).reversed()) { diff --git a/compiler/testData/codegen/box/ranges/literal/reversedRange.kt b/compiler/testData/codegen/box/ranges/literal/reversedRange.kt index db13553480f..7b8d7e43671 100644 --- a/compiler/testData/codegen/box/ranges/literal/reversedRange.kt +++ b/compiler/testData/codegen/box/ranges/literal/reversedRange.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() for (i in (3..5).reversed()) { diff --git a/compiler/testData/codegen/box/ranges/literal/reversedSimpleSteppedRange.kt b/compiler/testData/codegen/box/ranges/literal/reversedSimpleSteppedRange.kt index 4aa0ff7c60b..fe04e81cb6a 100644 --- a/compiler/testData/codegen/box/ranges/literal/reversedSimpleSteppedRange.kt +++ b/compiler/testData/codegen/box/ranges/literal/reversedSimpleSteppedRange.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() for (i in (3..9 step 2).reversed()) { diff --git a/compiler/testData/codegen/box/ranges/literal/simpleDownTo.kt b/compiler/testData/codegen/box/ranges/literal/simpleDownTo.kt index 63361c13e0a..f10c5779c00 100644 --- a/compiler/testData/codegen/box/ranges/literal/simpleDownTo.kt +++ b/compiler/testData/codegen/box/ranges/literal/simpleDownTo.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() for (i in 9 downTo 3) { diff --git a/compiler/testData/codegen/box/ranges/literal/simpleRange.kt b/compiler/testData/codegen/box/ranges/literal/simpleRange.kt index 00fdb9079c7..1c2e20a965c 100644 --- a/compiler/testData/codegen/box/ranges/literal/simpleRange.kt +++ b/compiler/testData/codegen/box/ranges/literal/simpleRange.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() for (i in 3..9) { diff --git a/compiler/testData/codegen/box/ranges/literal/simpleRangeWithNonConstantEnds.kt b/compiler/testData/codegen/box/ranges/literal/simpleRangeWithNonConstantEnds.kt index a1b9db60f89..bf1b9d734f4 100644 --- a/compiler/testData/codegen/box/ranges/literal/simpleRangeWithNonConstantEnds.kt +++ b/compiler/testData/codegen/box/ranges/literal/simpleRangeWithNonConstantEnds.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() for (i in (1 + 2)..(10 - 1)) { diff --git a/compiler/testData/codegen/box/ranges/literal/simpleSteppedDownTo.kt b/compiler/testData/codegen/box/ranges/literal/simpleSteppedDownTo.kt index 020c85709fc..9d22df17aac 100644 --- a/compiler/testData/codegen/box/ranges/literal/simpleSteppedDownTo.kt +++ b/compiler/testData/codegen/box/ranges/literal/simpleSteppedDownTo.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() for (i in 9 downTo 3 step 2) { diff --git a/compiler/testData/codegen/box/ranges/literal/simpleSteppedRange.kt b/compiler/testData/codegen/box/ranges/literal/simpleSteppedRange.kt index 9969d575e78..ffaf2bd5e8f 100644 --- a/compiler/testData/codegen/box/ranges/literal/simpleSteppedRange.kt +++ b/compiler/testData/codegen/box/ranges/literal/simpleSteppedRange.kt @@ -5,6 +5,7 @@ // WITH_RUNTIME + fun box(): String { val list1 = ArrayList() for (i in 3..9 step 2) { diff --git a/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateRangesCodegenTestData.java b/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateRangesCodegenTestData.java index 7f2bd14f642..7dc495a9eb3 100644 --- a/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateRangesCodegenTestData.java +++ b/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateRangesCodegenTestData.java @@ -37,7 +37,6 @@ public class GenerateRangesCodegenTestData { private static final File AS_EXPRESSION_DIR = new File(TEST_DATA_DIR, "expression"); private static final File[] SOURCE_TEST_FILES = { new File("libraries/stdlib/test/ranges/RangeIterationTest.kt"), - new File("libraries/stdlib/jvm/test/ranges/RangeIterationJVMTest.kt") }; private static final Pattern TEST_FUN_PATTERN = Pattern.compile("@Test fun (\\w+)\\(\\) \\{.+?}", Pattern.DOTALL); @@ -104,38 +103,11 @@ public class GenerateRangesCodegenTestData { .replace("\n", LineSeparator.getSystemLineSeparator().getSeparatorString()); } - private static final List INTEGER_PRIMITIVES = Arrays.asList("Integer", "Byte", "Short", "Long", "Character"); + private static final List INTEGER_PRIMITIVES = Arrays.asList("Int", "Byte", "Short", "Long", "Char"); - // TODO: Use common MIN_VALUE/MAX_VALUE constants and remove these exclusions - private static final List IGNORED_FOR_JS_BACKEND = Arrays.asList( - "inexactDownToMinValue.kt", - "inexactToMaxValue.kt", - "maxValueMinusTwoToMaxValue.kt", - "maxValueToMaxValue.kt", - "maxValueToMinValue.kt", - "progressionDownToMinValue.kt", - "progressionMaxValueMinusTwoToMaxValue.kt", - "progressionMaxValueToMaxValue.kt", - "progressionMaxValueToMinValue.kt", - "progressionMinValueToMinValue.kt", - "overflowZeroToMinValue.kt", - "overflowZeroDownToMaxValue.kt" - ); + private static final List IGNORED_FOR_JS_BACKEND = Collections.emptyList(); - private static final List IGNORED_FOR_NATIVE_BACKEND = Arrays.asList( - "inexactDownToMinValue.kt", - "inexactToMaxValue.kt", - "maxValueMinusTwoToMaxValue.kt", - "maxValueToMaxValue.kt", - "maxValueToMinValue.kt", - "progressionDownToMinValue.kt", - "progressionMaxValueMinusTwoToMaxValue.kt", - "progressionMaxValueToMaxValue.kt", - "progressionMaxValueToMinValue.kt", - "progressionMinValueToMinValue.kt", - "overflowZeroToMinValue.kt", - "overflowZeroDownToMaxValue.kt" - ); + private static final List IGNORED_FOR_NATIVE_BACKEND = Collections.emptyList(); private static void writeIgnoreBackendDirective(PrintWriter out, String backendName) { out.printf("// TODO: muted automatically, investigate should it be ran for %s or not%n", backendName); @@ -165,14 +137,17 @@ public class GenerateRangesCodegenTestData { out.println("// Auto-generated by " + GenerateRangesCodegenTestData.class.getName() + ". DO NOT EDIT!"); out.println("// WITH_RUNTIME"); out.println(); - if (generatedBody.contains("Max") || generatedBody.contains("Min")) { - // Import min/max values, but only in case when the generated test case actually uses them (not to clutter tests which don't) - out.println(); - for (String primitive : INTEGER_PRIMITIVES) { - out.println("import java.lang." + primitive + ".MAX_VALUE as Max" + primitive.charAt(0)); - out.println("import java.lang." + primitive + ".MIN_VALUE as Min" + primitive.charAt(0)); - } + // Import min/max values, but only in case when the generated test case actually uses them (not to clutter tests which don't) + out.println(); + for (String primitive : INTEGER_PRIMITIVES) { + String maxV = "Max" + primitive.charAt(0); + String minV = "Min" + primitive.charAt(0); + if (generatedBody.contains(maxV)) + out.printf("const val %s = %s.MAX_VALUE", maxV, primitive).println(); + if (generatedBody.contains(minV)) + out.printf("const val %s = %s.MIN_VALUE", minV, primitive).println(); } + out.println(); out.println("fun box(): String {"); out.print(generatedBody); diff --git a/libraries/stdlib/jvm/test/ranges/RangeIterationJVMTest.kt b/libraries/stdlib/jvm/test/ranges/RangeIterationJVMTest.kt deleted file mode 100644 index 08f4aa7ee94..00000000000 --- a/libraries/stdlib/jvm/test/ranges/RangeIterationJVMTest.kt +++ /dev/null @@ -1,123 +0,0 @@ -/* - * 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 test.ranges - -import java.lang.Integer.MAX_VALUE as MaxI -import java.lang.Integer.MIN_VALUE as MinI -import java.lang.Byte.MAX_VALUE as MaxB -import java.lang.Byte.MIN_VALUE as MinB -import java.lang.Short.MAX_VALUE as MaxS -import java.lang.Short.MIN_VALUE as MinS -import java.lang.Long.MAX_VALUE as MaxL -import java.lang.Long.MIN_VALUE as MinL -import java.lang.Character.MAX_VALUE as MaxC -import java.lang.Character.MIN_VALUE as MinC -import kotlin.test.* - -// Test data for codegen is generated from this class. If you change it, rerun GenerateTests -public class RangeIterationJVMTest : RangeIterationTestBase() { - - - @Test fun maxValueToMaxValue() { - doTest(MaxI..MaxI, MaxI, MaxI, 1, listOf(MaxI)) - doTest(MaxB..MaxB, MaxB.toInt(), MaxB.toInt(), 1, listOf(MaxB.toInt())) - doTest(MaxS..MaxS, MaxS.toInt(), MaxS.toInt(), 1, listOf(MaxS.toInt())) - doTest(MaxL..MaxL, MaxL, MaxL, 1.toLong(), listOf(MaxL)) - - doTest(MaxC..MaxC, MaxC, MaxC, 1, listOf(MaxC)) - } - - @Test fun maxValueMinusTwoToMaxValue() { - doTest((MaxI - 2)..MaxI, MaxI - 2, MaxI, 1, listOf(MaxI - 2, MaxI - 1, MaxI)) - doTest((MaxB - 2).toByte()..MaxB, (MaxB - 2).toInt(), MaxB.toInt(), 1, listOf((MaxB - 2).toInt(), (MaxB - 1).toInt(), MaxB.toInt())) - doTest((MaxS - 2).toShort()..MaxS, (MaxS - 2).toInt(), MaxS.toInt(), 1, listOf((MaxS - 2).toInt(), (MaxS - 1).toInt(), MaxS.toInt())) - doTest((MaxL - 2).toLong()..MaxL, (MaxL - 2).toLong(), MaxL, 1.toLong(), listOf((MaxL - 2).toLong(), (MaxL - 1).toLong(), MaxL)) - - doTest((MaxC - 2)..MaxC, (MaxC - 2), MaxC, 1, listOf((MaxC - 2), (MaxC - 1), MaxC)) - } - - @Test fun maxValueToMinValue() { - doTest(MaxI..MinI, MaxI, MinI, 1, listOf()) - doTest(MaxB..MinB, MaxB.toInt(), MinB.toInt(), 1, listOf()) - doTest(MaxS..MinS, MaxS.toInt(), MinS.toInt(), 1, listOf()) - doTest(MaxL..MinL, MaxL, MinL, 1.toLong(), listOf()) - - doTest(MaxC..MinC, MaxC, MinC, 1, listOf()) - } - - @Test fun progressionMaxValueToMaxValue() { - doTest(MaxI..MaxI step 1, MaxI, MaxI, 1, listOf(MaxI)) - doTest(MaxB..MaxB step 1, MaxB.toInt(), MaxB.toInt(), 1, listOf(MaxB.toInt())) - doTest(MaxS..MaxS step 1, MaxS.toInt(), MaxS.toInt(), 1, listOf(MaxS.toInt())) - doTest(MaxL..MaxL step 1, MaxL, MaxL, 1.toLong(), listOf(MaxL)) - - doTest(MaxC..MaxC step 1, MaxC, MaxC, 1, listOf(MaxC)) - } - - @Test fun progressionMaxValueMinusTwoToMaxValue() { - doTest((MaxI - 2)..MaxI step 2, MaxI - 2, MaxI, 2, listOf(MaxI - 2, MaxI)) - doTest((MaxB - 2).toByte()..MaxB step 2, (MaxB - 2).toInt(), MaxB.toInt(), 2, listOf((MaxB - 2).toInt(), MaxB.toInt())) - doTest((MaxS - 2).toShort()..MaxS step 2, (MaxS - 2).toInt(), MaxS.toInt(), 2, listOf((MaxS - 2).toInt(), MaxS.toInt())) - doTest((MaxL - 2).toLong()..MaxL step 2, (MaxL - 2).toLong(), MaxL, 2.toLong(), listOf((MaxL - 2).toLong(), MaxL)) - - doTest((MaxC - 2)..MaxC step 2, (MaxC - 2), MaxC, 2, listOf((MaxC - 2), MaxC)) - } - - @Test fun progressionMaxValueToMinValue() { - doTest(MaxI..MinI step 1, MaxI, MinI, 1, listOf()) - doTest(MaxB..MinB step 1, MaxB.toInt(), MinB.toInt(), 1, listOf()) - doTest(MaxS..MinS step 1, MaxS.toInt(), MinS.toInt(), 1, listOf()) - doTest(MaxL..MinL step 1, MaxL, MinL, 1.toLong(), listOf()) - - doTest(MaxC..MinC step 1, MaxC, MinC, 1, listOf()) - } - - @Test fun progressionMinValueToMinValue() { - doTest(MinI..MinI step 1, MinI, MinI, 1, listOf(MinI)) - doTest(MinB..MinB step 1, MinB.toInt(), MinB.toInt(), 1, listOf(MinB.toInt())) - doTest(MinS..MinS step 1, MinS.toInt(), MinS.toInt(), 1, listOf(MinS.toInt())) - doTest(MinL..MinL step 1, MinL, MinL, 1.toLong(), listOf(MinL)) - - doTest(MinC..MinC step 1, MinC, MinC, 1, listOf(MinC)) - } - - @Test fun inexactToMaxValue() { - doTest((MaxI - 5)..MaxI step 3, MaxI - 5, MaxI - 2, 3, listOf(MaxI - 5, MaxI - 2)) - doTest((MaxB - 5).toByte()..MaxB step 3, (MaxB - 5).toInt(), (MaxB - 2).toInt(), 3, listOf((MaxB - 5).toInt(), (MaxB - 2).toInt())) - doTest((MaxS - 5).toShort()..MaxS step 3, (MaxS - 5).toInt(), (MaxS - 2).toInt(), 3, listOf((MaxS - 5).toInt(), (MaxS - 2).toInt())) - doTest((MaxL - 5).toLong()..MaxL step 3, (MaxL - 5).toLong(), (MaxL - 2).toLong(), 3.toLong(), listOf((MaxL - 5).toLong(), (MaxL - 2).toLong())) - - doTest((MaxC - 5)..MaxC step 3, (MaxC - 5), (MaxC - 2), 3, listOf((MaxC - 5), (MaxC - 2))) - } - - @Test fun overflowZeroToMinValue() { - doTest(0..MinI step 3, 0, MinI, 3, listOf()) - doTest(0L..MinL step 3, 0, MinL, 3.toLong(), listOf()) - } - - @Test fun progressionDownToMinValue() { - doTest((MinI + 2) downTo MinI step 1, MinI + 2, MinI, -1, listOf(MinI + 2, MinI + 1, MinI)) - doTest((MinB + 2).toByte() downTo MinB step 1, (MinB + 2).toInt(), MinB.toInt(), -1, listOf((MinB + 2).toInt(), (MinB + 1).toInt(), MinB.toInt())) - doTest((MinS + 2).toShort() downTo MinS step 1, (MinS + 2).toInt(), MinS.toInt(), -1, listOf((MinS + 2).toInt(), (MinS + 1).toInt(), MinS.toInt())) - doTest((MinL + 2).toLong() downTo MinL step 1, (MinL + 2).toLong(), MinL, -1.toLong(), listOf((MinL + 2).toLong(), (MinL + 1).toLong(), MinL)) - - doTest((MinC + 2) downTo MinC step 1, (MinC + 2), MinC, -1, listOf((MinC + 2), (MinC + 1), MinC)) - } - - @Test fun inexactDownToMinValue() { - doTest((MinI + 5) downTo MinI step 3, MinI + 5, MinI + 2, -3, listOf(MinI + 5, MinI + 2)) - doTest((MinB + 5).toByte() downTo MinB step 3, (MinB + 5).toInt(), (MinB + 2).toInt(), -3, listOf((MinB + 5).toInt(), (MinB + 2).toInt())) - doTest((MinS + 5).toShort() downTo MinS step 3, (MinS + 5).toInt(), (MinS + 2).toInt(), -3, listOf((MinS + 5).toInt(), (MinS + 2).toInt())) - doTest((MinL + 5).toLong() downTo MinL step 3, (MinL + 5).toLong(), (MinL + 2).toLong(), -3.toLong(), listOf((MinL + 5).toLong(), (MinL + 2).toLong())) - - doTest((MinC + 5) downTo MinC step 3, (MinC + 5), (MinC + 2), -3, listOf((MinC + 5), (MinC + 2))) - } - - @Test fun overflowZeroDownToMaxValue() { - doTest(0 downTo MaxI step 3, 0, MaxI, -3, listOf()) - doTest(0 downTo MaxL step 3, 0, MaxL, -3.toLong(), listOf()) - } -} \ No newline at end of file diff --git a/libraries/stdlib/test/ranges/RangeIterationTest.kt b/libraries/stdlib/test/ranges/RangeIterationTest.kt index 08b3598d3e8..443cc4624e0 100644 --- a/libraries/stdlib/test/ranges/RangeIterationTest.kt +++ b/libraries/stdlib/test/ranges/RangeIterationTest.kt @@ -9,6 +9,18 @@ import test.collections.behaviors.iteratorBehavior import test.collections.compare import kotlin.test.* +const val MaxI = Int.MAX_VALUE +const val MinI = Int.MIN_VALUE +const val MaxB = Byte.MAX_VALUE +const val MinB = Byte.MIN_VALUE +const val MaxS = Short.MAX_VALUE +const val MinS = Short.MIN_VALUE +const val MaxL = Long.MAX_VALUE +const val MinL = Long.MIN_VALUE +const val MaxC = Char.MAX_VALUE +const val MinC = Char.MIN_VALUE + +// Test data for codegen is generated from this class. If you change it, rerun generateTests task public open class RangeIterationTestBase { public fun doTest( sequence: Iterable, @@ -235,4 +247,105 @@ public class RangeIterationTest : RangeIterationTestBase() { doTest(('d' downTo 'a' step 2).reversed(), 'b', 'd', 2, listOf('b', 'd')) } + + + @Test fun maxValueToMaxValue() { + doTest(MaxI..MaxI, MaxI, MaxI, 1, listOf(MaxI)) + doTest(MaxB..MaxB, MaxB.toInt(), MaxB.toInt(), 1, listOf(MaxB.toInt())) + doTest(MaxS..MaxS, MaxS.toInt(), MaxS.toInt(), 1, listOf(MaxS.toInt())) + doTest(MaxL..MaxL, MaxL, MaxL, 1.toLong(), listOf(MaxL)) + + doTest(MaxC..MaxC, MaxC, MaxC, 1, listOf(MaxC)) + } + + @Test fun maxValueMinusTwoToMaxValue() { + doTest((MaxI - 2)..MaxI, MaxI - 2, MaxI, 1, listOf(MaxI - 2, MaxI - 1, MaxI)) + doTest((MaxB - 2).toByte()..MaxB, (MaxB - 2).toInt(), MaxB.toInt(), 1, listOf((MaxB - 2).toInt(), (MaxB - 1).toInt(), MaxB.toInt())) + doTest((MaxS - 2).toShort()..MaxS, (MaxS - 2).toInt(), MaxS.toInt(), 1, listOf((MaxS - 2).toInt(), (MaxS - 1).toInt(), MaxS.toInt())) + doTest((MaxL - 2).toLong()..MaxL, (MaxL - 2).toLong(), MaxL, 1.toLong(), listOf((MaxL - 2).toLong(), (MaxL - 1).toLong(), MaxL)) + + doTest((MaxC - 2)..MaxC, (MaxC - 2), MaxC, 1, listOf((MaxC - 2), (MaxC - 1), MaxC)) + } + + @Test fun maxValueToMinValue() { + doTest(MaxI..MinI, MaxI, MinI, 1, listOf()) + doTest(MaxB..MinB, MaxB.toInt(), MinB.toInt(), 1, listOf()) + doTest(MaxS..MinS, MaxS.toInt(), MinS.toInt(), 1, listOf()) + doTest(MaxL..MinL, MaxL, MinL, 1.toLong(), listOf()) + + doTest(MaxC..MinC, MaxC, MinC, 1, listOf()) + } + + @Test fun progressionMaxValueToMaxValue() { + doTest(MaxI..MaxI step 1, MaxI, MaxI, 1, listOf(MaxI)) + doTest(MaxB..MaxB step 1, MaxB.toInt(), MaxB.toInt(), 1, listOf(MaxB.toInt())) + doTest(MaxS..MaxS step 1, MaxS.toInt(), MaxS.toInt(), 1, listOf(MaxS.toInt())) + doTest(MaxL..MaxL step 1, MaxL, MaxL, 1.toLong(), listOf(MaxL)) + + doTest(MaxC..MaxC step 1, MaxC, MaxC, 1, listOf(MaxC)) + } + + @Test fun progressionMaxValueMinusTwoToMaxValue() { + doTest((MaxI - 2)..MaxI step 2, MaxI - 2, MaxI, 2, listOf(MaxI - 2, MaxI)) + doTest((MaxB - 2).toByte()..MaxB step 2, (MaxB - 2).toInt(), MaxB.toInt(), 2, listOf((MaxB - 2).toInt(), MaxB.toInt())) + doTest((MaxS - 2).toShort()..MaxS step 2, (MaxS - 2).toInt(), MaxS.toInt(), 2, listOf((MaxS - 2).toInt(), MaxS.toInt())) + doTest((MaxL - 2).toLong()..MaxL step 2, (MaxL - 2).toLong(), MaxL, 2.toLong(), listOf((MaxL - 2).toLong(), MaxL)) + + doTest((MaxC - 2)..MaxC step 2, (MaxC - 2), MaxC, 2, listOf((MaxC - 2), MaxC)) + } + + @Test fun progressionMaxValueToMinValue() { + doTest(MaxI..MinI step 1, MaxI, MinI, 1, listOf()) + doTest(MaxB..MinB step 1, MaxB.toInt(), MinB.toInt(), 1, listOf()) + doTest(MaxS..MinS step 1, MaxS.toInt(), MinS.toInt(), 1, listOf()) + doTest(MaxL..MinL step 1, MaxL, MinL, 1.toLong(), listOf()) + + doTest(MaxC..MinC step 1, MaxC, MinC, 1, listOf()) + } + + @Test fun progressionMinValueToMinValue() { + doTest(MinI..MinI step 1, MinI, MinI, 1, listOf(MinI)) + doTest(MinB..MinB step 1, MinB.toInt(), MinB.toInt(), 1, listOf(MinB.toInt())) + doTest(MinS..MinS step 1, MinS.toInt(), MinS.toInt(), 1, listOf(MinS.toInt())) + doTest(MinL..MinL step 1, MinL, MinL, 1.toLong(), listOf(MinL)) + + doTest(MinC..MinC step 1, MinC, MinC, 1, listOf(MinC)) + } + + @Test fun inexactToMaxValue() { + doTest((MaxI - 5)..MaxI step 3, MaxI - 5, MaxI - 2, 3, listOf(MaxI - 5, MaxI - 2)) + doTest((MaxB - 5).toByte()..MaxB step 3, (MaxB - 5).toInt(), (MaxB - 2).toInt(), 3, listOf((MaxB - 5).toInt(), (MaxB - 2).toInt())) + doTest((MaxS - 5).toShort()..MaxS step 3, (MaxS - 5).toInt(), (MaxS - 2).toInt(), 3, listOf((MaxS - 5).toInt(), (MaxS - 2).toInt())) + doTest((MaxL - 5).toLong()..MaxL step 3, (MaxL - 5).toLong(), (MaxL - 2).toLong(), 3.toLong(), listOf((MaxL - 5).toLong(), (MaxL - 2).toLong())) + + doTest((MaxC - 5)..MaxC step 3, (MaxC - 5), (MaxC - 2), 3, listOf((MaxC - 5), (MaxC - 2))) + } + + @Test fun overflowZeroToMinValue() { + doTest(0..MinI step 3, 0, MinI, 3, listOf()) + doTest(0L..MinL step 3, 0, MinL, 3.toLong(), listOf()) + } + + @Test fun progressionDownToMinValue() { + doTest((MinI + 2) downTo MinI step 1, MinI + 2, MinI, -1, listOf(MinI + 2, MinI + 1, MinI)) + doTest((MinB + 2).toByte() downTo MinB step 1, (MinB + 2).toInt(), MinB.toInt(), -1, listOf((MinB + 2).toInt(), (MinB + 1).toInt(), MinB.toInt())) + doTest((MinS + 2).toShort() downTo MinS step 1, (MinS + 2).toInt(), MinS.toInt(), -1, listOf((MinS + 2).toInt(), (MinS + 1).toInt(), MinS.toInt())) + doTest((MinL + 2).toLong() downTo MinL step 1, (MinL + 2).toLong(), MinL, -1.toLong(), listOf((MinL + 2).toLong(), (MinL + 1).toLong(), MinL)) + + doTest((MinC + 2) downTo MinC step 1, (MinC + 2), MinC, -1, listOf((MinC + 2), (MinC + 1), MinC)) + } + + @Test fun inexactDownToMinValue() { + doTest((MinI + 5) downTo MinI step 3, MinI + 5, MinI + 2, -3, listOf(MinI + 5, MinI + 2)) + doTest((MinB + 5).toByte() downTo MinB step 3, (MinB + 5).toInt(), (MinB + 2).toInt(), -3, listOf((MinB + 5).toInt(), (MinB + 2).toInt())) + doTest((MinS + 5).toShort() downTo MinS step 3, (MinS + 5).toInt(), (MinS + 2).toInt(), -3, listOf((MinS + 5).toInt(), (MinS + 2).toInt())) + doTest((MinL + 5).toLong() downTo MinL step 3, (MinL + 5).toLong(), (MinL + 2).toLong(), -3.toLong(), listOf((MinL + 5).toLong(), (MinL + 2).toLong())) + + doTest((MinC + 5) downTo MinC step 3, (MinC + 5), (MinC + 2), -3, listOf((MinC + 5), (MinC + 2))) + } + + @Test fun overflowZeroDownToMaxValue() { + doTest(0 downTo MaxI step 3, 0, MaxI, -3, listOf()) + doTest(0 downTo MaxL step 3, 0, MaxL, -3.toLong(), listOf()) + } }