From f91ea4b4d9015762008f546068892f813a5ba8d2 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Tue, 2 Aug 2022 22:02:37 +0200 Subject: [PATCH] Add more tests for 'contains' in ranges #KT-52933 - ranges produced by 'rangeUntil' operator - ranges of unsigned values - more elements in ranges produced by `downTo` --- .../FirBlackBoxCodegenTestGenerated.java | 108 ++- .../ranges/contains/generated/arrayIndices.kt | 238 +++--- .../ranges/contains/generated/charDownTo.kt | 164 ++-- .../contains/generated/charRangeLiteral.kt | 159 ---- .../ranges/contains/generated/charRangeTo.kt | 159 ++++ .../contains/generated/charRangeUntil.kt | 162 ++++ .../contains/generated/charSequenceIndices.kt | 126 ++-- .../contains/generated/collectionIndices.kt | 126 ++-- .../contains/generated/doubleRangeLiteral.kt | 362 --------- .../contains/generated/doubleRangeTo.kt | 362 +++++++++ .../contains/generated/doubleRangeUntil.kt | 365 +++++++++ .../contains/generated/floatRangeLiteral.kt | 362 --------- .../ranges/contains/generated/floatRangeTo.kt | 362 +++++++++ .../contains/generated/floatRangeUntil.kt | 191 +++++ .../ranges/contains/generated/intDownTo.kt | 183 ++++- .../contains/generated/intRangeLiteral.kt | 710 ----------------- .../ranges/contains/generated/intRangeTo.kt | 710 +++++++++++++++++ .../contains/generated/intRangeUntil.kt | 713 ++++++++++++++++++ .../box/ranges/contains/generated/intUntil.kt | 126 ++-- .../ranges/contains/generated/longDownTo.kt | 183 ++++- .../contains/generated/longRangeLiteral.kt | 710 ----------------- .../ranges/contains/generated/longRangeTo.kt | 710 +++++++++++++++++ .../contains/generated/longRangeUntil.kt | 713 ++++++++++++++++++ .../ranges/contains/generated/longUntil.kt | 126 ++-- .../ranges/contains/generated/uintDownTo.kt | 159 ++++ .../ranges/contains/generated/uintRangeTo.kt | 159 ++++ .../contains/generated/uintRangeUntil.kt | 162 ++++ .../ranges/contains/generated/uintUntil.kt | 159 ++++ .../ranges/contains/generated/ulongDownTo.kt | 159 ++++ .../ranges/contains/generated/ulongRangeTo.kt | 159 ++++ .../contains/generated/ulongRangeUntil.kt | 162 ++++ .../ranges/contains/generated/ulongUntil.kt | 159 ++++ .../codegen/BlackBoxCodegenTestGenerated.java | 66 +- .../IrBlackBoxCodegenTestGenerated.java | 108 ++- .../LightAnalysisModeTestGenerated.java | 60 +- .../GenerateInRangeExpressionTestData.kt | 143 ++-- .../GenerateSteppedRangesCodegenTestData.kt | 2 +- .../js/test/JsCodegenBoxTestGenerated.java | 108 ++- .../test/ir/IrJsCodegenBoxTestGenerated.java | 108 ++- .../IrCodegenBoxWasmTestGenerated.java | 95 ++- .../NativeCodegenBoxTestGenerated.java | 108 ++- 41 files changed, 7197 insertions(+), 3009 deletions(-) delete mode 100644 compiler/testData/codegen/box/ranges/contains/generated/charRangeLiteral.kt create mode 100644 compiler/testData/codegen/box/ranges/contains/generated/charRangeTo.kt create mode 100644 compiler/testData/codegen/box/ranges/contains/generated/charRangeUntil.kt delete mode 100644 compiler/testData/codegen/box/ranges/contains/generated/doubleRangeLiteral.kt create mode 100644 compiler/testData/codegen/box/ranges/contains/generated/doubleRangeTo.kt create mode 100644 compiler/testData/codegen/box/ranges/contains/generated/doubleRangeUntil.kt delete mode 100644 compiler/testData/codegen/box/ranges/contains/generated/floatRangeLiteral.kt create mode 100644 compiler/testData/codegen/box/ranges/contains/generated/floatRangeTo.kt create mode 100644 compiler/testData/codegen/box/ranges/contains/generated/floatRangeUntil.kt delete mode 100644 compiler/testData/codegen/box/ranges/contains/generated/intRangeLiteral.kt create mode 100644 compiler/testData/codegen/box/ranges/contains/generated/intRangeTo.kt create mode 100644 compiler/testData/codegen/box/ranges/contains/generated/intRangeUntil.kt delete mode 100644 compiler/testData/codegen/box/ranges/contains/generated/longRangeLiteral.kt create mode 100644 compiler/testData/codegen/box/ranges/contains/generated/longRangeTo.kt create mode 100644 compiler/testData/codegen/box/ranges/contains/generated/longRangeUntil.kt create mode 100644 compiler/testData/codegen/box/ranges/contains/generated/uintDownTo.kt create mode 100644 compiler/testData/codegen/box/ranges/contains/generated/uintRangeTo.kt create mode 100644 compiler/testData/codegen/box/ranges/contains/generated/uintRangeUntil.kt create mode 100644 compiler/testData/codegen/box/ranges/contains/generated/uintUntil.kt create mode 100644 compiler/testData/codegen/box/ranges/contains/generated/ulongDownTo.kt create mode 100644 compiler/testData/codegen/box/ranges/contains/generated/ulongRangeTo.kt create mode 100644 compiler/testData/codegen/box/ranges/contains/generated/ulongRangeUntil.kt create mode 100644 compiler/testData/codegen/box/ranges/contains/generated/ulongUntil.kt 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 193e0eb7172..59d8097d678 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 @@ -35872,9 +35872,15 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT } @Test - @TestMetadata("charRangeLiteral.kt") - public void testCharRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/charRangeLiteral.kt"); + @TestMetadata("charRangeTo.kt") + public void testCharRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/charRangeTo.kt"); + } + + @Test + @TestMetadata("charRangeUntil.kt") + public void testCharRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/charRangeUntil.kt"); } @Test @@ -35896,15 +35902,27 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT } @Test - @TestMetadata("doubleRangeLiteral.kt") - public void testDoubleRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/doubleRangeLiteral.kt"); + @TestMetadata("doubleRangeTo.kt") + public void testDoubleRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/doubleRangeTo.kt"); } @Test - @TestMetadata("floatRangeLiteral.kt") - public void testFloatRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/floatRangeLiteral.kt"); + @TestMetadata("doubleRangeUntil.kt") + public void testDoubleRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/doubleRangeUntil.kt"); + } + + @Test + @TestMetadata("floatRangeTo.kt") + public void testFloatRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/floatRangeTo.kt"); + } + + @Test + @TestMetadata("floatRangeUntil.kt") + public void testFloatRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/floatRangeUntil.kt"); } @Test @@ -35914,9 +35932,15 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT } @Test - @TestMetadata("intRangeLiteral.kt") - public void testIntRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/intRangeLiteral.kt"); + @TestMetadata("intRangeTo.kt") + public void testIntRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/intRangeTo.kt"); + } + + @Test + @TestMetadata("intRangeUntil.kt") + public void testIntRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/intRangeUntil.kt"); } @Test @@ -35932,9 +35956,15 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT } @Test - @TestMetadata("longRangeLiteral.kt") - public void testLongRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/longRangeLiteral.kt"); + @TestMetadata("longRangeTo.kt") + public void testLongRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/longRangeTo.kt"); + } + + @Test + @TestMetadata("longRangeUntil.kt") + public void testLongRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/longRangeUntil.kt"); } @Test @@ -35942,6 +35972,54 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT public void testLongUntil() throws Exception { runTest("compiler/testData/codegen/box/ranges/contains/generated/longUntil.kt"); } + + @Test + @TestMetadata("uintDownTo.kt") + public void testUintDownTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/uintDownTo.kt"); + } + + @Test + @TestMetadata("uintRangeTo.kt") + public void testUintRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/uintRangeTo.kt"); + } + + @Test + @TestMetadata("uintRangeUntil.kt") + public void testUintRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/uintRangeUntil.kt"); + } + + @Test + @TestMetadata("uintUntil.kt") + public void testUintUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/uintUntil.kt"); + } + + @Test + @TestMetadata("ulongDownTo.kt") + public void testUlongDownTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/ulongDownTo.kt"); + } + + @Test + @TestMetadata("ulongRangeTo.kt") + public void testUlongRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/ulongRangeTo.kt"); + } + + @Test + @TestMetadata("ulongRangeUntil.kt") + public void testUlongRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/ulongRangeUntil.kt"); + } + + @Test + @TestMetadata("ulongUntil.kt") + public void testUlongUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/ulongUntil.kt"); + } } } diff --git a/compiler/testData/codegen/box/ranges/contains/generated/arrayIndices.kt b/compiler/testData/codegen/box/ranges/contains/generated/arrayIndices.kt index ae23ecfee7d..7f53fef7b4b 100644 --- a/compiler/testData/codegen/box/ranges/contains/generated/arrayIndices.kt +++ b/compiler/testData/codegen/box/ranges/contains/generated/arrayIndices.kt @@ -13,28 +13,28 @@ val range3 = emptyObjectArray.indices val element0 = (-1).toByte() val element1 = (-1).toShort() -val element2 = (-1) -val element3 = (-1).toLong() +val element2 = -1 +val element3 = -1L val element4 = 0.toByte() val element5 = 0.toShort() val element6 = 0 -val element7 = 0.toLong() +val element7 = 0L val element8 = 1.toByte() val element9 = 1.toShort() val element10 = 1 -val element11 = 1.toLong() +val element11 = 1L val element12 = 2.toByte() val element13 = 2.toShort() val element14 = 2 -val element15 = 2.toLong() +val element15 = 2L val element16 = 3.toByte() val element17 = 3.toShort() val element18 = 3 -val element19 = 3.toLong() +val element19 = 3L val element20 = 4.toByte() val element21 = 4.toShort() val element22 = 4 -val element23 = 4.toLong() +val element23 = 4L fun box(): String { testR0xE0() @@ -164,10 +164,10 @@ fun testR0xE1() { fun testR0xE2() { // with possible local optimizations - if ((-1) in intArray.indices != range0.contains((-1))) throw AssertionError() - if ((-1) !in intArray.indices != !range0.contains((-1))) throw AssertionError() - if (!((-1) in intArray.indices) != !range0.contains((-1))) throw AssertionError() - if (!((-1) !in intArray.indices) != range0.contains((-1))) throw AssertionError() + if (-1 in intArray.indices != range0.contains(-1)) throw AssertionError() + if (-1 !in intArray.indices != !range0.contains(-1)) throw AssertionError() + if (!(-1 in intArray.indices) != !range0.contains(-1)) throw AssertionError() + if (!(-1 !in intArray.indices) != range0.contains(-1)) throw AssertionError() // no local optimizations if (element2 in intArray.indices != range0.contains(element2)) throw AssertionError() if (element2 !in intArray.indices != !range0.contains(element2)) throw AssertionError() @@ -177,10 +177,10 @@ fun testR0xE2() { fun testR0xE3() { // with possible local optimizations - if ((-1).toLong() in intArray.indices != range0.contains((-1).toLong())) throw AssertionError() - if ((-1).toLong() !in intArray.indices != !range0.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() in intArray.indices) != !range0.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() !in intArray.indices) != range0.contains((-1).toLong())) throw AssertionError() + if (-1L in intArray.indices != range0.contains(-1L)) throw AssertionError() + if (-1L !in intArray.indices != !range0.contains(-1L)) throw AssertionError() + if (!(-1L in intArray.indices) != !range0.contains(-1L)) throw AssertionError() + if (!(-1L !in intArray.indices) != range0.contains(-1L)) throw AssertionError() // no local optimizations if (element3 in intArray.indices != range0.contains(element3)) throw AssertionError() if (element3 !in intArray.indices != !range0.contains(element3)) throw AssertionError() @@ -229,10 +229,10 @@ fun testR0xE6() { fun testR0xE7() { // with possible local optimizations - if (0.toLong() in intArray.indices != range0.contains(0.toLong())) throw AssertionError() - if (0.toLong() !in intArray.indices != !range0.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() in intArray.indices) != !range0.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() !in intArray.indices) != range0.contains(0.toLong())) throw AssertionError() + if (0L in intArray.indices != range0.contains(0L)) throw AssertionError() + if (0L !in intArray.indices != !range0.contains(0L)) throw AssertionError() + if (!(0L in intArray.indices) != !range0.contains(0L)) throw AssertionError() + if (!(0L !in intArray.indices) != range0.contains(0L)) throw AssertionError() // no local optimizations if (element7 in intArray.indices != range0.contains(element7)) throw AssertionError() if (element7 !in intArray.indices != !range0.contains(element7)) throw AssertionError() @@ -281,10 +281,10 @@ fun testR0xE10() { fun testR0xE11() { // with possible local optimizations - if (1.toLong() in intArray.indices != range0.contains(1.toLong())) throw AssertionError() - if (1.toLong() !in intArray.indices != !range0.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() in intArray.indices) != !range0.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() !in intArray.indices) != range0.contains(1.toLong())) throw AssertionError() + if (1L in intArray.indices != range0.contains(1L)) throw AssertionError() + if (1L !in intArray.indices != !range0.contains(1L)) throw AssertionError() + if (!(1L in intArray.indices) != !range0.contains(1L)) throw AssertionError() + if (!(1L !in intArray.indices) != range0.contains(1L)) throw AssertionError() // no local optimizations if (element11 in intArray.indices != range0.contains(element11)) throw AssertionError() if (element11 !in intArray.indices != !range0.contains(element11)) throw AssertionError() @@ -333,10 +333,10 @@ fun testR0xE14() { fun testR0xE15() { // with possible local optimizations - if (2.toLong() in intArray.indices != range0.contains(2.toLong())) throw AssertionError() - if (2.toLong() !in intArray.indices != !range0.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() in intArray.indices) != !range0.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() !in intArray.indices) != range0.contains(2.toLong())) throw AssertionError() + if (2L in intArray.indices != range0.contains(2L)) throw AssertionError() + if (2L !in intArray.indices != !range0.contains(2L)) throw AssertionError() + if (!(2L in intArray.indices) != !range0.contains(2L)) throw AssertionError() + if (!(2L !in intArray.indices) != range0.contains(2L)) throw AssertionError() // no local optimizations if (element15 in intArray.indices != range0.contains(element15)) throw AssertionError() if (element15 !in intArray.indices != !range0.contains(element15)) throw AssertionError() @@ -385,10 +385,10 @@ fun testR0xE18() { fun testR0xE19() { // with possible local optimizations - if (3.toLong() in intArray.indices != range0.contains(3.toLong())) throw AssertionError() - if (3.toLong() !in intArray.indices != !range0.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() in intArray.indices) != !range0.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() !in intArray.indices) != range0.contains(3.toLong())) throw AssertionError() + if (3L in intArray.indices != range0.contains(3L)) throw AssertionError() + if (3L !in intArray.indices != !range0.contains(3L)) throw AssertionError() + if (!(3L in intArray.indices) != !range0.contains(3L)) throw AssertionError() + if (!(3L !in intArray.indices) != range0.contains(3L)) throw AssertionError() // no local optimizations if (element19 in intArray.indices != range0.contains(element19)) throw AssertionError() if (element19 !in intArray.indices != !range0.contains(element19)) throw AssertionError() @@ -437,10 +437,10 @@ fun testR0xE22() { fun testR0xE23() { // with possible local optimizations - if (4.toLong() in intArray.indices != range0.contains(4.toLong())) throw AssertionError() - if (4.toLong() !in intArray.indices != !range0.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() in intArray.indices) != !range0.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() !in intArray.indices) != range0.contains(4.toLong())) throw AssertionError() + if (4L in intArray.indices != range0.contains(4L)) throw AssertionError() + if (4L !in intArray.indices != !range0.contains(4L)) throw AssertionError() + if (!(4L in intArray.indices) != !range0.contains(4L)) throw AssertionError() + if (!(4L !in intArray.indices) != range0.contains(4L)) throw AssertionError() // no local optimizations if (element23 in intArray.indices != range0.contains(element23)) throw AssertionError() if (element23 !in intArray.indices != !range0.contains(element23)) throw AssertionError() @@ -476,10 +476,10 @@ fun testR1xE1() { fun testR1xE2() { // with possible local optimizations - if ((-1) in objectArray.indices != range1.contains((-1))) throw AssertionError() - if ((-1) !in objectArray.indices != !range1.contains((-1))) throw AssertionError() - if (!((-1) in objectArray.indices) != !range1.contains((-1))) throw AssertionError() - if (!((-1) !in objectArray.indices) != range1.contains((-1))) throw AssertionError() + if (-1 in objectArray.indices != range1.contains(-1)) throw AssertionError() + if (-1 !in objectArray.indices != !range1.contains(-1)) throw AssertionError() + if (!(-1 in objectArray.indices) != !range1.contains(-1)) throw AssertionError() + if (!(-1 !in objectArray.indices) != range1.contains(-1)) throw AssertionError() // no local optimizations if (element2 in objectArray.indices != range1.contains(element2)) throw AssertionError() if (element2 !in objectArray.indices != !range1.contains(element2)) throw AssertionError() @@ -489,10 +489,10 @@ fun testR1xE2() { fun testR1xE3() { // with possible local optimizations - if ((-1).toLong() in objectArray.indices != range1.contains((-1).toLong())) throw AssertionError() - if ((-1).toLong() !in objectArray.indices != !range1.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() in objectArray.indices) != !range1.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() !in objectArray.indices) != range1.contains((-1).toLong())) throw AssertionError() + if (-1L in objectArray.indices != range1.contains(-1L)) throw AssertionError() + if (-1L !in objectArray.indices != !range1.contains(-1L)) throw AssertionError() + if (!(-1L in objectArray.indices) != !range1.contains(-1L)) throw AssertionError() + if (!(-1L !in objectArray.indices) != range1.contains(-1L)) throw AssertionError() // no local optimizations if (element3 in objectArray.indices != range1.contains(element3)) throw AssertionError() if (element3 !in objectArray.indices != !range1.contains(element3)) throw AssertionError() @@ -541,10 +541,10 @@ fun testR1xE6() { fun testR1xE7() { // with possible local optimizations - if (0.toLong() in objectArray.indices != range1.contains(0.toLong())) throw AssertionError() - if (0.toLong() !in objectArray.indices != !range1.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() in objectArray.indices) != !range1.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() !in objectArray.indices) != range1.contains(0.toLong())) throw AssertionError() + if (0L in objectArray.indices != range1.contains(0L)) throw AssertionError() + if (0L !in objectArray.indices != !range1.contains(0L)) throw AssertionError() + if (!(0L in objectArray.indices) != !range1.contains(0L)) throw AssertionError() + if (!(0L !in objectArray.indices) != range1.contains(0L)) throw AssertionError() // no local optimizations if (element7 in objectArray.indices != range1.contains(element7)) throw AssertionError() if (element7 !in objectArray.indices != !range1.contains(element7)) throw AssertionError() @@ -593,10 +593,10 @@ fun testR1xE10() { fun testR1xE11() { // with possible local optimizations - if (1.toLong() in objectArray.indices != range1.contains(1.toLong())) throw AssertionError() - if (1.toLong() !in objectArray.indices != !range1.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() in objectArray.indices) != !range1.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() !in objectArray.indices) != range1.contains(1.toLong())) throw AssertionError() + if (1L in objectArray.indices != range1.contains(1L)) throw AssertionError() + if (1L !in objectArray.indices != !range1.contains(1L)) throw AssertionError() + if (!(1L in objectArray.indices) != !range1.contains(1L)) throw AssertionError() + if (!(1L !in objectArray.indices) != range1.contains(1L)) throw AssertionError() // no local optimizations if (element11 in objectArray.indices != range1.contains(element11)) throw AssertionError() if (element11 !in objectArray.indices != !range1.contains(element11)) throw AssertionError() @@ -645,10 +645,10 @@ fun testR1xE14() { fun testR1xE15() { // with possible local optimizations - if (2.toLong() in objectArray.indices != range1.contains(2.toLong())) throw AssertionError() - if (2.toLong() !in objectArray.indices != !range1.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() in objectArray.indices) != !range1.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() !in objectArray.indices) != range1.contains(2.toLong())) throw AssertionError() + if (2L in objectArray.indices != range1.contains(2L)) throw AssertionError() + if (2L !in objectArray.indices != !range1.contains(2L)) throw AssertionError() + if (!(2L in objectArray.indices) != !range1.contains(2L)) throw AssertionError() + if (!(2L !in objectArray.indices) != range1.contains(2L)) throw AssertionError() // no local optimizations if (element15 in objectArray.indices != range1.contains(element15)) throw AssertionError() if (element15 !in objectArray.indices != !range1.contains(element15)) throw AssertionError() @@ -697,10 +697,10 @@ fun testR1xE18() { fun testR1xE19() { // with possible local optimizations - if (3.toLong() in objectArray.indices != range1.contains(3.toLong())) throw AssertionError() - if (3.toLong() !in objectArray.indices != !range1.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() in objectArray.indices) != !range1.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() !in objectArray.indices) != range1.contains(3.toLong())) throw AssertionError() + if (3L in objectArray.indices != range1.contains(3L)) throw AssertionError() + if (3L !in objectArray.indices != !range1.contains(3L)) throw AssertionError() + if (!(3L in objectArray.indices) != !range1.contains(3L)) throw AssertionError() + if (!(3L !in objectArray.indices) != range1.contains(3L)) throw AssertionError() // no local optimizations if (element19 in objectArray.indices != range1.contains(element19)) throw AssertionError() if (element19 !in objectArray.indices != !range1.contains(element19)) throw AssertionError() @@ -749,10 +749,10 @@ fun testR1xE22() { fun testR1xE23() { // with possible local optimizations - if (4.toLong() in objectArray.indices != range1.contains(4.toLong())) throw AssertionError() - if (4.toLong() !in objectArray.indices != !range1.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() in objectArray.indices) != !range1.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() !in objectArray.indices) != range1.contains(4.toLong())) throw AssertionError() + if (4L in objectArray.indices != range1.contains(4L)) throw AssertionError() + if (4L !in objectArray.indices != !range1.contains(4L)) throw AssertionError() + if (!(4L in objectArray.indices) != !range1.contains(4L)) throw AssertionError() + if (!(4L !in objectArray.indices) != range1.contains(4L)) throw AssertionError() // no local optimizations if (element23 in objectArray.indices != range1.contains(element23)) throw AssertionError() if (element23 !in objectArray.indices != !range1.contains(element23)) throw AssertionError() @@ -788,10 +788,10 @@ fun testR2xE1() { fun testR2xE2() { // with possible local optimizations - if ((-1) in emptyIntArray.indices != range2.contains((-1))) throw AssertionError() - if ((-1) !in emptyIntArray.indices != !range2.contains((-1))) throw AssertionError() - if (!((-1) in emptyIntArray.indices) != !range2.contains((-1))) throw AssertionError() - if (!((-1) !in emptyIntArray.indices) != range2.contains((-1))) throw AssertionError() + if (-1 in emptyIntArray.indices != range2.contains(-1)) throw AssertionError() + if (-1 !in emptyIntArray.indices != !range2.contains(-1)) throw AssertionError() + if (!(-1 in emptyIntArray.indices) != !range2.contains(-1)) throw AssertionError() + if (!(-1 !in emptyIntArray.indices) != range2.contains(-1)) throw AssertionError() // no local optimizations if (element2 in emptyIntArray.indices != range2.contains(element2)) throw AssertionError() if (element2 !in emptyIntArray.indices != !range2.contains(element2)) throw AssertionError() @@ -801,10 +801,10 @@ fun testR2xE2() { fun testR2xE3() { // with possible local optimizations - if ((-1).toLong() in emptyIntArray.indices != range2.contains((-1).toLong())) throw AssertionError() - if ((-1).toLong() !in emptyIntArray.indices != !range2.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() in emptyIntArray.indices) != !range2.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() !in emptyIntArray.indices) != range2.contains((-1).toLong())) throw AssertionError() + if (-1L in emptyIntArray.indices != range2.contains(-1L)) throw AssertionError() + if (-1L !in emptyIntArray.indices != !range2.contains(-1L)) throw AssertionError() + if (!(-1L in emptyIntArray.indices) != !range2.contains(-1L)) throw AssertionError() + if (!(-1L !in emptyIntArray.indices) != range2.contains(-1L)) throw AssertionError() // no local optimizations if (element3 in emptyIntArray.indices != range2.contains(element3)) throw AssertionError() if (element3 !in emptyIntArray.indices != !range2.contains(element3)) throw AssertionError() @@ -853,10 +853,10 @@ fun testR2xE6() { fun testR2xE7() { // with possible local optimizations - if (0.toLong() in emptyIntArray.indices != range2.contains(0.toLong())) throw AssertionError() - if (0.toLong() !in emptyIntArray.indices != !range2.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() in emptyIntArray.indices) != !range2.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() !in emptyIntArray.indices) != range2.contains(0.toLong())) throw AssertionError() + if (0L in emptyIntArray.indices != range2.contains(0L)) throw AssertionError() + if (0L !in emptyIntArray.indices != !range2.contains(0L)) throw AssertionError() + if (!(0L in emptyIntArray.indices) != !range2.contains(0L)) throw AssertionError() + if (!(0L !in emptyIntArray.indices) != range2.contains(0L)) throw AssertionError() // no local optimizations if (element7 in emptyIntArray.indices != range2.contains(element7)) throw AssertionError() if (element7 !in emptyIntArray.indices != !range2.contains(element7)) throw AssertionError() @@ -905,10 +905,10 @@ fun testR2xE10() { fun testR2xE11() { // with possible local optimizations - if (1.toLong() in emptyIntArray.indices != range2.contains(1.toLong())) throw AssertionError() - if (1.toLong() !in emptyIntArray.indices != !range2.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() in emptyIntArray.indices) != !range2.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() !in emptyIntArray.indices) != range2.contains(1.toLong())) throw AssertionError() + if (1L in emptyIntArray.indices != range2.contains(1L)) throw AssertionError() + if (1L !in emptyIntArray.indices != !range2.contains(1L)) throw AssertionError() + if (!(1L in emptyIntArray.indices) != !range2.contains(1L)) throw AssertionError() + if (!(1L !in emptyIntArray.indices) != range2.contains(1L)) throw AssertionError() // no local optimizations if (element11 in emptyIntArray.indices != range2.contains(element11)) throw AssertionError() if (element11 !in emptyIntArray.indices != !range2.contains(element11)) throw AssertionError() @@ -957,10 +957,10 @@ fun testR2xE14() { fun testR2xE15() { // with possible local optimizations - if (2.toLong() in emptyIntArray.indices != range2.contains(2.toLong())) throw AssertionError() - if (2.toLong() !in emptyIntArray.indices != !range2.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() in emptyIntArray.indices) != !range2.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() !in emptyIntArray.indices) != range2.contains(2.toLong())) throw AssertionError() + if (2L in emptyIntArray.indices != range2.contains(2L)) throw AssertionError() + if (2L !in emptyIntArray.indices != !range2.contains(2L)) throw AssertionError() + if (!(2L in emptyIntArray.indices) != !range2.contains(2L)) throw AssertionError() + if (!(2L !in emptyIntArray.indices) != range2.contains(2L)) throw AssertionError() // no local optimizations if (element15 in emptyIntArray.indices != range2.contains(element15)) throw AssertionError() if (element15 !in emptyIntArray.indices != !range2.contains(element15)) throw AssertionError() @@ -1009,10 +1009,10 @@ fun testR2xE18() { fun testR2xE19() { // with possible local optimizations - if (3.toLong() in emptyIntArray.indices != range2.contains(3.toLong())) throw AssertionError() - if (3.toLong() !in emptyIntArray.indices != !range2.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() in emptyIntArray.indices) != !range2.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() !in emptyIntArray.indices) != range2.contains(3.toLong())) throw AssertionError() + if (3L in emptyIntArray.indices != range2.contains(3L)) throw AssertionError() + if (3L !in emptyIntArray.indices != !range2.contains(3L)) throw AssertionError() + if (!(3L in emptyIntArray.indices) != !range2.contains(3L)) throw AssertionError() + if (!(3L !in emptyIntArray.indices) != range2.contains(3L)) throw AssertionError() // no local optimizations if (element19 in emptyIntArray.indices != range2.contains(element19)) throw AssertionError() if (element19 !in emptyIntArray.indices != !range2.contains(element19)) throw AssertionError() @@ -1061,10 +1061,10 @@ fun testR2xE22() { fun testR2xE23() { // with possible local optimizations - if (4.toLong() in emptyIntArray.indices != range2.contains(4.toLong())) throw AssertionError() - if (4.toLong() !in emptyIntArray.indices != !range2.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() in emptyIntArray.indices) != !range2.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() !in emptyIntArray.indices) != range2.contains(4.toLong())) throw AssertionError() + if (4L in emptyIntArray.indices != range2.contains(4L)) throw AssertionError() + if (4L !in emptyIntArray.indices != !range2.contains(4L)) throw AssertionError() + if (!(4L in emptyIntArray.indices) != !range2.contains(4L)) throw AssertionError() + if (!(4L !in emptyIntArray.indices) != range2.contains(4L)) throw AssertionError() // no local optimizations if (element23 in emptyIntArray.indices != range2.contains(element23)) throw AssertionError() if (element23 !in emptyIntArray.indices != !range2.contains(element23)) throw AssertionError() @@ -1100,10 +1100,10 @@ fun testR3xE1() { fun testR3xE2() { // with possible local optimizations - if ((-1) in emptyObjectArray.indices != range3.contains((-1))) throw AssertionError() - if ((-1) !in emptyObjectArray.indices != !range3.contains((-1))) throw AssertionError() - if (!((-1) in emptyObjectArray.indices) != !range3.contains((-1))) throw AssertionError() - if (!((-1) !in emptyObjectArray.indices) != range3.contains((-1))) throw AssertionError() + if (-1 in emptyObjectArray.indices != range3.contains(-1)) throw AssertionError() + if (-1 !in emptyObjectArray.indices != !range3.contains(-1)) throw AssertionError() + if (!(-1 in emptyObjectArray.indices) != !range3.contains(-1)) throw AssertionError() + if (!(-1 !in emptyObjectArray.indices) != range3.contains(-1)) throw AssertionError() // no local optimizations if (element2 in emptyObjectArray.indices != range3.contains(element2)) throw AssertionError() if (element2 !in emptyObjectArray.indices != !range3.contains(element2)) throw AssertionError() @@ -1113,10 +1113,10 @@ fun testR3xE2() { fun testR3xE3() { // with possible local optimizations - if ((-1).toLong() in emptyObjectArray.indices != range3.contains((-1).toLong())) throw AssertionError() - if ((-1).toLong() !in emptyObjectArray.indices != !range3.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() in emptyObjectArray.indices) != !range3.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() !in emptyObjectArray.indices) != range3.contains((-1).toLong())) throw AssertionError() + if (-1L in emptyObjectArray.indices != range3.contains(-1L)) throw AssertionError() + if (-1L !in emptyObjectArray.indices != !range3.contains(-1L)) throw AssertionError() + if (!(-1L in emptyObjectArray.indices) != !range3.contains(-1L)) throw AssertionError() + if (!(-1L !in emptyObjectArray.indices) != range3.contains(-1L)) throw AssertionError() // no local optimizations if (element3 in emptyObjectArray.indices != range3.contains(element3)) throw AssertionError() if (element3 !in emptyObjectArray.indices != !range3.contains(element3)) throw AssertionError() @@ -1165,10 +1165,10 @@ fun testR3xE6() { fun testR3xE7() { // with possible local optimizations - if (0.toLong() in emptyObjectArray.indices != range3.contains(0.toLong())) throw AssertionError() - if (0.toLong() !in emptyObjectArray.indices != !range3.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() in emptyObjectArray.indices) != !range3.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() !in emptyObjectArray.indices) != range3.contains(0.toLong())) throw AssertionError() + if (0L in emptyObjectArray.indices != range3.contains(0L)) throw AssertionError() + if (0L !in emptyObjectArray.indices != !range3.contains(0L)) throw AssertionError() + if (!(0L in emptyObjectArray.indices) != !range3.contains(0L)) throw AssertionError() + if (!(0L !in emptyObjectArray.indices) != range3.contains(0L)) throw AssertionError() // no local optimizations if (element7 in emptyObjectArray.indices != range3.contains(element7)) throw AssertionError() if (element7 !in emptyObjectArray.indices != !range3.contains(element7)) throw AssertionError() @@ -1217,10 +1217,10 @@ fun testR3xE10() { fun testR3xE11() { // with possible local optimizations - if (1.toLong() in emptyObjectArray.indices != range3.contains(1.toLong())) throw AssertionError() - if (1.toLong() !in emptyObjectArray.indices != !range3.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() in emptyObjectArray.indices) != !range3.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() !in emptyObjectArray.indices) != range3.contains(1.toLong())) throw AssertionError() + if (1L in emptyObjectArray.indices != range3.contains(1L)) throw AssertionError() + if (1L !in emptyObjectArray.indices != !range3.contains(1L)) throw AssertionError() + if (!(1L in emptyObjectArray.indices) != !range3.contains(1L)) throw AssertionError() + if (!(1L !in emptyObjectArray.indices) != range3.contains(1L)) throw AssertionError() // no local optimizations if (element11 in emptyObjectArray.indices != range3.contains(element11)) throw AssertionError() if (element11 !in emptyObjectArray.indices != !range3.contains(element11)) throw AssertionError() @@ -1269,10 +1269,10 @@ fun testR3xE14() { fun testR3xE15() { // with possible local optimizations - if (2.toLong() in emptyObjectArray.indices != range3.contains(2.toLong())) throw AssertionError() - if (2.toLong() !in emptyObjectArray.indices != !range3.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() in emptyObjectArray.indices) != !range3.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() !in emptyObjectArray.indices) != range3.contains(2.toLong())) throw AssertionError() + if (2L in emptyObjectArray.indices != range3.contains(2L)) throw AssertionError() + if (2L !in emptyObjectArray.indices != !range3.contains(2L)) throw AssertionError() + if (!(2L in emptyObjectArray.indices) != !range3.contains(2L)) throw AssertionError() + if (!(2L !in emptyObjectArray.indices) != range3.contains(2L)) throw AssertionError() // no local optimizations if (element15 in emptyObjectArray.indices != range3.contains(element15)) throw AssertionError() if (element15 !in emptyObjectArray.indices != !range3.contains(element15)) throw AssertionError() @@ -1321,10 +1321,10 @@ fun testR3xE18() { fun testR3xE19() { // with possible local optimizations - if (3.toLong() in emptyObjectArray.indices != range3.contains(3.toLong())) throw AssertionError() - if (3.toLong() !in emptyObjectArray.indices != !range3.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() in emptyObjectArray.indices) != !range3.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() !in emptyObjectArray.indices) != range3.contains(3.toLong())) throw AssertionError() + if (3L in emptyObjectArray.indices != range3.contains(3L)) throw AssertionError() + if (3L !in emptyObjectArray.indices != !range3.contains(3L)) throw AssertionError() + if (!(3L in emptyObjectArray.indices) != !range3.contains(3L)) throw AssertionError() + if (!(3L !in emptyObjectArray.indices) != range3.contains(3L)) throw AssertionError() // no local optimizations if (element19 in emptyObjectArray.indices != range3.contains(element19)) throw AssertionError() if (element19 !in emptyObjectArray.indices != !range3.contains(element19)) throw AssertionError() @@ -1373,10 +1373,10 @@ fun testR3xE22() { fun testR3xE23() { // with possible local optimizations - if (4.toLong() in emptyObjectArray.indices != range3.contains(4.toLong())) throw AssertionError() - if (4.toLong() !in emptyObjectArray.indices != !range3.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() in emptyObjectArray.indices) != !range3.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() !in emptyObjectArray.indices) != range3.contains(4.toLong())) throw AssertionError() + if (4L in emptyObjectArray.indices != range3.contains(4L)) throw AssertionError() + if (4L !in emptyObjectArray.indices != !range3.contains(4L)) throw AssertionError() + if (!(4L in emptyObjectArray.indices) != !range3.contains(4L)) throw AssertionError() + if (!(4L !in emptyObjectArray.indices) != range3.contains(4L)) throw AssertionError() // no local optimizations if (element23 in emptyObjectArray.indices != range3.contains(element23)) throw AssertionError() if (element23 !in emptyObjectArray.indices != !range3.contains(element23)) throw AssertionError() diff --git a/compiler/testData/codegen/box/ranges/contains/generated/charDownTo.kt b/compiler/testData/codegen/box/ranges/contains/generated/charDownTo.kt index cbc93f1b48a..54460188c48 100644 --- a/compiler/testData/codegen/box/ranges/contains/generated/charDownTo.kt +++ b/compiler/testData/codegen/box/ranges/contains/generated/charDownTo.kt @@ -3,8 +3,8 @@ -val range0 = '3' downTo '1' -val range1 = '1' downTo '3' +val range0 = '1' downTo '3' +val range1 = '3' downTo '1' val element0 = '0' val element1 = '1' @@ -28,132 +28,132 @@ fun box(): String { fun testR0xE0() { // with possible local optimizations - if ('0' in '3' downTo '1' != range0.contains('0')) throw AssertionError() - if ('0' !in '3' downTo '1' != !range0.contains('0')) throw AssertionError() - if (!('0' in '3' downTo '1') != !range0.contains('0')) throw AssertionError() - if (!('0' !in '3' downTo '1') != range0.contains('0')) throw AssertionError() + if ('0' in '1' downTo '3' != range0.contains('0')) throw AssertionError() + if ('0' !in '1' downTo '3' != !range0.contains('0')) throw AssertionError() + if (!('0' in '1' downTo '3') != !range0.contains('0')) throw AssertionError() + if (!('0' !in '1' downTo '3') != range0.contains('0')) throw AssertionError() // no local optimizations - if (element0 in '3' downTo '1' != range0.contains(element0)) throw AssertionError() - if (element0 !in '3' downTo '1' != !range0.contains(element0)) throw AssertionError() - if (!(element0 in '3' downTo '1') != !range0.contains(element0)) throw AssertionError() - if (!(element0 !in '3' downTo '1') != range0.contains(element0)) throw AssertionError() + if (element0 in '1' downTo '3' != range0.contains(element0)) throw AssertionError() + if (element0 !in '1' downTo '3' != !range0.contains(element0)) throw AssertionError() + if (!(element0 in '1' downTo '3') != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in '1' downTo '3') != range0.contains(element0)) throw AssertionError() } fun testR0xE1() { // with possible local optimizations - if ('1' in '3' downTo '1' != range0.contains('1')) throw AssertionError() - if ('1' !in '3' downTo '1' != !range0.contains('1')) throw AssertionError() - if (!('1' in '3' downTo '1') != !range0.contains('1')) throw AssertionError() - if (!('1' !in '3' downTo '1') != range0.contains('1')) throw AssertionError() + if ('1' in '1' downTo '3' != range0.contains('1')) throw AssertionError() + if ('1' !in '1' downTo '3' != !range0.contains('1')) throw AssertionError() + if (!('1' in '1' downTo '3') != !range0.contains('1')) throw AssertionError() + if (!('1' !in '1' downTo '3') != range0.contains('1')) throw AssertionError() // no local optimizations - if (element1 in '3' downTo '1' != range0.contains(element1)) throw AssertionError() - if (element1 !in '3' downTo '1' != !range0.contains(element1)) throw AssertionError() - if (!(element1 in '3' downTo '1') != !range0.contains(element1)) throw AssertionError() - if (!(element1 !in '3' downTo '1') != range0.contains(element1)) throw AssertionError() + if (element1 in '1' downTo '3' != range0.contains(element1)) throw AssertionError() + if (element1 !in '1' downTo '3' != !range0.contains(element1)) throw AssertionError() + if (!(element1 in '1' downTo '3') != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in '1' downTo '3') != range0.contains(element1)) throw AssertionError() } fun testR0xE2() { // with possible local optimizations - if ('2' in '3' downTo '1' != range0.contains('2')) throw AssertionError() - if ('2' !in '3' downTo '1' != !range0.contains('2')) throw AssertionError() - if (!('2' in '3' downTo '1') != !range0.contains('2')) throw AssertionError() - if (!('2' !in '3' downTo '1') != range0.contains('2')) throw AssertionError() + if ('2' in '1' downTo '3' != range0.contains('2')) throw AssertionError() + if ('2' !in '1' downTo '3' != !range0.contains('2')) throw AssertionError() + if (!('2' in '1' downTo '3') != !range0.contains('2')) throw AssertionError() + if (!('2' !in '1' downTo '3') != range0.contains('2')) throw AssertionError() // no local optimizations - if (element2 in '3' downTo '1' != range0.contains(element2)) throw AssertionError() - if (element2 !in '3' downTo '1' != !range0.contains(element2)) throw AssertionError() - if (!(element2 in '3' downTo '1') != !range0.contains(element2)) throw AssertionError() - if (!(element2 !in '3' downTo '1') != range0.contains(element2)) throw AssertionError() + if (element2 in '1' downTo '3' != range0.contains(element2)) throw AssertionError() + if (element2 !in '1' downTo '3' != !range0.contains(element2)) throw AssertionError() + if (!(element2 in '1' downTo '3') != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in '1' downTo '3') != range0.contains(element2)) throw AssertionError() } fun testR0xE3() { // with possible local optimizations - if ('3' in '3' downTo '1' != range0.contains('3')) throw AssertionError() - if ('3' !in '3' downTo '1' != !range0.contains('3')) throw AssertionError() - if (!('3' in '3' downTo '1') != !range0.contains('3')) throw AssertionError() - if (!('3' !in '3' downTo '1') != range0.contains('3')) throw AssertionError() + if ('3' in '1' downTo '3' != range0.contains('3')) throw AssertionError() + if ('3' !in '1' downTo '3' != !range0.contains('3')) throw AssertionError() + if (!('3' in '1' downTo '3') != !range0.contains('3')) throw AssertionError() + if (!('3' !in '1' downTo '3') != range0.contains('3')) throw AssertionError() // no local optimizations - if (element3 in '3' downTo '1' != range0.contains(element3)) throw AssertionError() - if (element3 !in '3' downTo '1' != !range0.contains(element3)) throw AssertionError() - if (!(element3 in '3' downTo '1') != !range0.contains(element3)) throw AssertionError() - if (!(element3 !in '3' downTo '1') != range0.contains(element3)) throw AssertionError() + if (element3 in '1' downTo '3' != range0.contains(element3)) throw AssertionError() + if (element3 !in '1' downTo '3' != !range0.contains(element3)) throw AssertionError() + if (!(element3 in '1' downTo '3') != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in '1' downTo '3') != range0.contains(element3)) throw AssertionError() } fun testR0xE4() { // with possible local optimizations - if ('4' in '3' downTo '1' != range0.contains('4')) throw AssertionError() - if ('4' !in '3' downTo '1' != !range0.contains('4')) throw AssertionError() - if (!('4' in '3' downTo '1') != !range0.contains('4')) throw AssertionError() - if (!('4' !in '3' downTo '1') != range0.contains('4')) throw AssertionError() + if ('4' in '1' downTo '3' != range0.contains('4')) throw AssertionError() + if ('4' !in '1' downTo '3' != !range0.contains('4')) throw AssertionError() + if (!('4' in '1' downTo '3') != !range0.contains('4')) throw AssertionError() + if (!('4' !in '1' downTo '3') != range0.contains('4')) throw AssertionError() // no local optimizations - if (element4 in '3' downTo '1' != range0.contains(element4)) throw AssertionError() - if (element4 !in '3' downTo '1' != !range0.contains(element4)) throw AssertionError() - if (!(element4 in '3' downTo '1') != !range0.contains(element4)) throw AssertionError() - if (!(element4 !in '3' downTo '1') != range0.contains(element4)) throw AssertionError() + if (element4 in '1' downTo '3' != range0.contains(element4)) throw AssertionError() + if (element4 !in '1' downTo '3' != !range0.contains(element4)) throw AssertionError() + if (!(element4 in '1' downTo '3') != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in '1' downTo '3') != range0.contains(element4)) throw AssertionError() } fun testR1xE0() { // with possible local optimizations - if ('0' in '1' downTo '3' != range1.contains('0')) throw AssertionError() - if ('0' !in '1' downTo '3' != !range1.contains('0')) throw AssertionError() - if (!('0' in '1' downTo '3') != !range1.contains('0')) throw AssertionError() - if (!('0' !in '1' downTo '3') != range1.contains('0')) throw AssertionError() + if ('0' in '3' downTo '1' != range1.contains('0')) throw AssertionError() + if ('0' !in '3' downTo '1' != !range1.contains('0')) throw AssertionError() + if (!('0' in '3' downTo '1') != !range1.contains('0')) throw AssertionError() + if (!('0' !in '3' downTo '1') != range1.contains('0')) throw AssertionError() // no local optimizations - if (element0 in '1' downTo '3' != range1.contains(element0)) throw AssertionError() - if (element0 !in '1' downTo '3' != !range1.contains(element0)) throw AssertionError() - if (!(element0 in '1' downTo '3') != !range1.contains(element0)) throw AssertionError() - if (!(element0 !in '1' downTo '3') != range1.contains(element0)) throw AssertionError() + if (element0 in '3' downTo '1' != range1.contains(element0)) throw AssertionError() + if (element0 !in '3' downTo '1' != !range1.contains(element0)) throw AssertionError() + if (!(element0 in '3' downTo '1') != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in '3' downTo '1') != range1.contains(element0)) throw AssertionError() } fun testR1xE1() { // with possible local optimizations - if ('1' in '1' downTo '3' != range1.contains('1')) throw AssertionError() - if ('1' !in '1' downTo '3' != !range1.contains('1')) throw AssertionError() - if (!('1' in '1' downTo '3') != !range1.contains('1')) throw AssertionError() - if (!('1' !in '1' downTo '3') != range1.contains('1')) throw AssertionError() + if ('1' in '3' downTo '1' != range1.contains('1')) throw AssertionError() + if ('1' !in '3' downTo '1' != !range1.contains('1')) throw AssertionError() + if (!('1' in '3' downTo '1') != !range1.contains('1')) throw AssertionError() + if (!('1' !in '3' downTo '1') != range1.contains('1')) throw AssertionError() // no local optimizations - if (element1 in '1' downTo '3' != range1.contains(element1)) throw AssertionError() - if (element1 !in '1' downTo '3' != !range1.contains(element1)) throw AssertionError() - if (!(element1 in '1' downTo '3') != !range1.contains(element1)) throw AssertionError() - if (!(element1 !in '1' downTo '3') != range1.contains(element1)) throw AssertionError() + if (element1 in '3' downTo '1' != range1.contains(element1)) throw AssertionError() + if (element1 !in '3' downTo '1' != !range1.contains(element1)) throw AssertionError() + if (!(element1 in '3' downTo '1') != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in '3' downTo '1') != range1.contains(element1)) throw AssertionError() } fun testR1xE2() { // with possible local optimizations - if ('2' in '1' downTo '3' != range1.contains('2')) throw AssertionError() - if ('2' !in '1' downTo '3' != !range1.contains('2')) throw AssertionError() - if (!('2' in '1' downTo '3') != !range1.contains('2')) throw AssertionError() - if (!('2' !in '1' downTo '3') != range1.contains('2')) throw AssertionError() + if ('2' in '3' downTo '1' != range1.contains('2')) throw AssertionError() + if ('2' !in '3' downTo '1' != !range1.contains('2')) throw AssertionError() + if (!('2' in '3' downTo '1') != !range1.contains('2')) throw AssertionError() + if (!('2' !in '3' downTo '1') != range1.contains('2')) throw AssertionError() // no local optimizations - if (element2 in '1' downTo '3' != range1.contains(element2)) throw AssertionError() - if (element2 !in '1' downTo '3' != !range1.contains(element2)) throw AssertionError() - if (!(element2 in '1' downTo '3') != !range1.contains(element2)) throw AssertionError() - if (!(element2 !in '1' downTo '3') != range1.contains(element2)) throw AssertionError() + if (element2 in '3' downTo '1' != range1.contains(element2)) throw AssertionError() + if (element2 !in '3' downTo '1' != !range1.contains(element2)) throw AssertionError() + if (!(element2 in '3' downTo '1') != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in '3' downTo '1') != range1.contains(element2)) throw AssertionError() } fun testR1xE3() { // with possible local optimizations - if ('3' in '1' downTo '3' != range1.contains('3')) throw AssertionError() - if ('3' !in '1' downTo '3' != !range1.contains('3')) throw AssertionError() - if (!('3' in '1' downTo '3') != !range1.contains('3')) throw AssertionError() - if (!('3' !in '1' downTo '3') != range1.contains('3')) throw AssertionError() + if ('3' in '3' downTo '1' != range1.contains('3')) throw AssertionError() + if ('3' !in '3' downTo '1' != !range1.contains('3')) throw AssertionError() + if (!('3' in '3' downTo '1') != !range1.contains('3')) throw AssertionError() + if (!('3' !in '3' downTo '1') != range1.contains('3')) throw AssertionError() // no local optimizations - if (element3 in '1' downTo '3' != range1.contains(element3)) throw AssertionError() - if (element3 !in '1' downTo '3' != !range1.contains(element3)) throw AssertionError() - if (!(element3 in '1' downTo '3') != !range1.contains(element3)) throw AssertionError() - if (!(element3 !in '1' downTo '3') != range1.contains(element3)) throw AssertionError() + if (element3 in '3' downTo '1' != range1.contains(element3)) throw AssertionError() + if (element3 !in '3' downTo '1' != !range1.contains(element3)) throw AssertionError() + if (!(element3 in '3' downTo '1') != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in '3' downTo '1') != range1.contains(element3)) throw AssertionError() } fun testR1xE4() { // with possible local optimizations - if ('4' in '1' downTo '3' != range1.contains('4')) throw AssertionError() - if ('4' !in '1' downTo '3' != !range1.contains('4')) throw AssertionError() - if (!('4' in '1' downTo '3') != !range1.contains('4')) throw AssertionError() - if (!('4' !in '1' downTo '3') != range1.contains('4')) throw AssertionError() + if ('4' in '3' downTo '1' != range1.contains('4')) throw AssertionError() + if ('4' !in '3' downTo '1' != !range1.contains('4')) throw AssertionError() + if (!('4' in '3' downTo '1') != !range1.contains('4')) throw AssertionError() + if (!('4' !in '3' downTo '1') != range1.contains('4')) throw AssertionError() // no local optimizations - if (element4 in '1' downTo '3' != range1.contains(element4)) throw AssertionError() - if (element4 !in '1' downTo '3' != !range1.contains(element4)) throw AssertionError() - if (!(element4 in '1' downTo '3') != !range1.contains(element4)) throw AssertionError() - if (!(element4 !in '1' downTo '3') != range1.contains(element4)) throw AssertionError() + if (element4 in '3' downTo '1' != range1.contains(element4)) throw AssertionError() + if (element4 !in '3' downTo '1' != !range1.contains(element4)) throw AssertionError() + if (!(element4 in '3' downTo '1') != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in '3' downTo '1') != range1.contains(element4)) throw AssertionError() } diff --git a/compiler/testData/codegen/box/ranges/contains/generated/charRangeLiteral.kt b/compiler/testData/codegen/box/ranges/contains/generated/charRangeLiteral.kt deleted file mode 100644 index d013ae0f94d..00000000000 --- a/compiler/testData/codegen/box/ranges/contains/generated/charRangeLiteral.kt +++ /dev/null @@ -1,159 +0,0 @@ -// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! -// WITH_STDLIB - - - -val range0 = '1' .. '3' -val range1 = '3' .. '1' - -val element0 = '0' -val element1 = '1' -val element2 = '2' -val element3 = '3' -val element4 = '4' - -fun box(): String { - testR0xE0() - testR0xE1() - testR0xE2() - testR0xE3() - testR0xE4() - testR1xE0() - testR1xE1() - testR1xE2() - testR1xE3() - testR1xE4() - return "OK" -} - -fun testR0xE0() { - // with possible local optimizations - if ('0' in '1' .. '3' != range0.contains('0')) throw AssertionError() - if ('0' !in '1' .. '3' != !range0.contains('0')) throw AssertionError() - if (!('0' in '1' .. '3') != !range0.contains('0')) throw AssertionError() - if (!('0' !in '1' .. '3') != range0.contains('0')) throw AssertionError() - // no local optimizations - if (element0 in '1' .. '3' != range0.contains(element0)) throw AssertionError() - if (element0 !in '1' .. '3' != !range0.contains(element0)) throw AssertionError() - if (!(element0 in '1' .. '3') != !range0.contains(element0)) throw AssertionError() - if (!(element0 !in '1' .. '3') != range0.contains(element0)) throw AssertionError() -} - -fun testR0xE1() { - // with possible local optimizations - if ('1' in '1' .. '3' != range0.contains('1')) throw AssertionError() - if ('1' !in '1' .. '3' != !range0.contains('1')) throw AssertionError() - if (!('1' in '1' .. '3') != !range0.contains('1')) throw AssertionError() - if (!('1' !in '1' .. '3') != range0.contains('1')) throw AssertionError() - // no local optimizations - if (element1 in '1' .. '3' != range0.contains(element1)) throw AssertionError() - if (element1 !in '1' .. '3' != !range0.contains(element1)) throw AssertionError() - if (!(element1 in '1' .. '3') != !range0.contains(element1)) throw AssertionError() - if (!(element1 !in '1' .. '3') != range0.contains(element1)) throw AssertionError() -} - -fun testR0xE2() { - // with possible local optimizations - if ('2' in '1' .. '3' != range0.contains('2')) throw AssertionError() - if ('2' !in '1' .. '3' != !range0.contains('2')) throw AssertionError() - if (!('2' in '1' .. '3') != !range0.contains('2')) throw AssertionError() - if (!('2' !in '1' .. '3') != range0.contains('2')) throw AssertionError() - // no local optimizations - if (element2 in '1' .. '3' != range0.contains(element2)) throw AssertionError() - if (element2 !in '1' .. '3' != !range0.contains(element2)) throw AssertionError() - if (!(element2 in '1' .. '3') != !range0.contains(element2)) throw AssertionError() - if (!(element2 !in '1' .. '3') != range0.contains(element2)) throw AssertionError() -} - -fun testR0xE3() { - // with possible local optimizations - if ('3' in '1' .. '3' != range0.contains('3')) throw AssertionError() - if ('3' !in '1' .. '3' != !range0.contains('3')) throw AssertionError() - if (!('3' in '1' .. '3') != !range0.contains('3')) throw AssertionError() - if (!('3' !in '1' .. '3') != range0.contains('3')) throw AssertionError() - // no local optimizations - if (element3 in '1' .. '3' != range0.contains(element3)) throw AssertionError() - if (element3 !in '1' .. '3' != !range0.contains(element3)) throw AssertionError() - if (!(element3 in '1' .. '3') != !range0.contains(element3)) throw AssertionError() - if (!(element3 !in '1' .. '3') != range0.contains(element3)) throw AssertionError() -} - -fun testR0xE4() { - // with possible local optimizations - if ('4' in '1' .. '3' != range0.contains('4')) throw AssertionError() - if ('4' !in '1' .. '3' != !range0.contains('4')) throw AssertionError() - if (!('4' in '1' .. '3') != !range0.contains('4')) throw AssertionError() - if (!('4' !in '1' .. '3') != range0.contains('4')) throw AssertionError() - // no local optimizations - if (element4 in '1' .. '3' != range0.contains(element4)) throw AssertionError() - if (element4 !in '1' .. '3' != !range0.contains(element4)) throw AssertionError() - if (!(element4 in '1' .. '3') != !range0.contains(element4)) throw AssertionError() - if (!(element4 !in '1' .. '3') != range0.contains(element4)) throw AssertionError() -} - -fun testR1xE0() { - // with possible local optimizations - if ('0' in '3' .. '1' != range1.contains('0')) throw AssertionError() - if ('0' !in '3' .. '1' != !range1.contains('0')) throw AssertionError() - if (!('0' in '3' .. '1') != !range1.contains('0')) throw AssertionError() - if (!('0' !in '3' .. '1') != range1.contains('0')) throw AssertionError() - // no local optimizations - if (element0 in '3' .. '1' != range1.contains(element0)) throw AssertionError() - if (element0 !in '3' .. '1' != !range1.contains(element0)) throw AssertionError() - if (!(element0 in '3' .. '1') != !range1.contains(element0)) throw AssertionError() - if (!(element0 !in '3' .. '1') != range1.contains(element0)) throw AssertionError() -} - -fun testR1xE1() { - // with possible local optimizations - if ('1' in '3' .. '1' != range1.contains('1')) throw AssertionError() - if ('1' !in '3' .. '1' != !range1.contains('1')) throw AssertionError() - if (!('1' in '3' .. '1') != !range1.contains('1')) throw AssertionError() - if (!('1' !in '3' .. '1') != range1.contains('1')) throw AssertionError() - // no local optimizations - if (element1 in '3' .. '1' != range1.contains(element1)) throw AssertionError() - if (element1 !in '3' .. '1' != !range1.contains(element1)) throw AssertionError() - if (!(element1 in '3' .. '1') != !range1.contains(element1)) throw AssertionError() - if (!(element1 !in '3' .. '1') != range1.contains(element1)) throw AssertionError() -} - -fun testR1xE2() { - // with possible local optimizations - if ('2' in '3' .. '1' != range1.contains('2')) throw AssertionError() - if ('2' !in '3' .. '1' != !range1.contains('2')) throw AssertionError() - if (!('2' in '3' .. '1') != !range1.contains('2')) throw AssertionError() - if (!('2' !in '3' .. '1') != range1.contains('2')) throw AssertionError() - // no local optimizations - if (element2 in '3' .. '1' != range1.contains(element2)) throw AssertionError() - if (element2 !in '3' .. '1' != !range1.contains(element2)) throw AssertionError() - if (!(element2 in '3' .. '1') != !range1.contains(element2)) throw AssertionError() - if (!(element2 !in '3' .. '1') != range1.contains(element2)) throw AssertionError() -} - -fun testR1xE3() { - // with possible local optimizations - if ('3' in '3' .. '1' != range1.contains('3')) throw AssertionError() - if ('3' !in '3' .. '1' != !range1.contains('3')) throw AssertionError() - if (!('3' in '3' .. '1') != !range1.contains('3')) throw AssertionError() - if (!('3' !in '3' .. '1') != range1.contains('3')) throw AssertionError() - // no local optimizations - if (element3 in '3' .. '1' != range1.contains(element3)) throw AssertionError() - if (element3 !in '3' .. '1' != !range1.contains(element3)) throw AssertionError() - if (!(element3 in '3' .. '1') != !range1.contains(element3)) throw AssertionError() - if (!(element3 !in '3' .. '1') != range1.contains(element3)) throw AssertionError() -} - -fun testR1xE4() { - // with possible local optimizations - if ('4' in '3' .. '1' != range1.contains('4')) throw AssertionError() - if ('4' !in '3' .. '1' != !range1.contains('4')) throw AssertionError() - if (!('4' in '3' .. '1') != !range1.contains('4')) throw AssertionError() - if (!('4' !in '3' .. '1') != range1.contains('4')) throw AssertionError() - // no local optimizations - if (element4 in '3' .. '1' != range1.contains(element4)) throw AssertionError() - if (element4 !in '3' .. '1' != !range1.contains(element4)) throw AssertionError() - if (!(element4 in '3' .. '1') != !range1.contains(element4)) throw AssertionError() - if (!(element4 !in '3' .. '1') != range1.contains(element4)) throw AssertionError() -} - - diff --git a/compiler/testData/codegen/box/ranges/contains/generated/charRangeTo.kt b/compiler/testData/codegen/box/ranges/contains/generated/charRangeTo.kt new file mode 100644 index 00000000000..0be7a4ff586 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/contains/generated/charRangeTo.kt @@ -0,0 +1,159 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_STDLIB + + + +val range0 = '1'..'3' +val range1 = '3'..'1' + +val element0 = '0' +val element1 = '1' +val element2 = '2' +val element3 = '3' +val element4 = '4' + +fun box(): String { + testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if ('0' in '1'..'3' != range0.contains('0')) throw AssertionError() + if ('0' !in '1'..'3' != !range0.contains('0')) throw AssertionError() + if (!('0' in '1'..'3') != !range0.contains('0')) throw AssertionError() + if (!('0' !in '1'..'3') != range0.contains('0')) throw AssertionError() + // no local optimizations + if (element0 in '1'..'3' != range0.contains(element0)) throw AssertionError() + if (element0 !in '1'..'3' != !range0.contains(element0)) throw AssertionError() + if (!(element0 in '1'..'3') != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in '1'..'3') != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if ('1' in '1'..'3' != range0.contains('1')) throw AssertionError() + if ('1' !in '1'..'3' != !range0.contains('1')) throw AssertionError() + if (!('1' in '1'..'3') != !range0.contains('1')) throw AssertionError() + if (!('1' !in '1'..'3') != range0.contains('1')) throw AssertionError() + // no local optimizations + if (element1 in '1'..'3' != range0.contains(element1)) throw AssertionError() + if (element1 !in '1'..'3' != !range0.contains(element1)) throw AssertionError() + if (!(element1 in '1'..'3') != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in '1'..'3') != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if ('2' in '1'..'3' != range0.contains('2')) throw AssertionError() + if ('2' !in '1'..'3' != !range0.contains('2')) throw AssertionError() + if (!('2' in '1'..'3') != !range0.contains('2')) throw AssertionError() + if (!('2' !in '1'..'3') != range0.contains('2')) throw AssertionError() + // no local optimizations + if (element2 in '1'..'3' != range0.contains(element2)) throw AssertionError() + if (element2 !in '1'..'3' != !range0.contains(element2)) throw AssertionError() + if (!(element2 in '1'..'3') != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in '1'..'3') != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if ('3' in '1'..'3' != range0.contains('3')) throw AssertionError() + if ('3' !in '1'..'3' != !range0.contains('3')) throw AssertionError() + if (!('3' in '1'..'3') != !range0.contains('3')) throw AssertionError() + if (!('3' !in '1'..'3') != range0.contains('3')) throw AssertionError() + // no local optimizations + if (element3 in '1'..'3' != range0.contains(element3)) throw AssertionError() + if (element3 !in '1'..'3' != !range0.contains(element3)) throw AssertionError() + if (!(element3 in '1'..'3') != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in '1'..'3') != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if ('4' in '1'..'3' != range0.contains('4')) throw AssertionError() + if ('4' !in '1'..'3' != !range0.contains('4')) throw AssertionError() + if (!('4' in '1'..'3') != !range0.contains('4')) throw AssertionError() + if (!('4' !in '1'..'3') != range0.contains('4')) throw AssertionError() + // no local optimizations + if (element4 in '1'..'3' != range0.contains(element4)) throw AssertionError() + if (element4 !in '1'..'3' != !range0.contains(element4)) throw AssertionError() + if (!(element4 in '1'..'3') != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in '1'..'3') != range0.contains(element4)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if ('0' in '3'..'1' != range1.contains('0')) throw AssertionError() + if ('0' !in '3'..'1' != !range1.contains('0')) throw AssertionError() + if (!('0' in '3'..'1') != !range1.contains('0')) throw AssertionError() + if (!('0' !in '3'..'1') != range1.contains('0')) throw AssertionError() + // no local optimizations + if (element0 in '3'..'1' != range1.contains(element0)) throw AssertionError() + if (element0 !in '3'..'1' != !range1.contains(element0)) throw AssertionError() + if (!(element0 in '3'..'1') != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in '3'..'1') != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if ('1' in '3'..'1' != range1.contains('1')) throw AssertionError() + if ('1' !in '3'..'1' != !range1.contains('1')) throw AssertionError() + if (!('1' in '3'..'1') != !range1.contains('1')) throw AssertionError() + if (!('1' !in '3'..'1') != range1.contains('1')) throw AssertionError() + // no local optimizations + if (element1 in '3'..'1' != range1.contains(element1)) throw AssertionError() + if (element1 !in '3'..'1' != !range1.contains(element1)) throw AssertionError() + if (!(element1 in '3'..'1') != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in '3'..'1') != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if ('2' in '3'..'1' != range1.contains('2')) throw AssertionError() + if ('2' !in '3'..'1' != !range1.contains('2')) throw AssertionError() + if (!('2' in '3'..'1') != !range1.contains('2')) throw AssertionError() + if (!('2' !in '3'..'1') != range1.contains('2')) throw AssertionError() + // no local optimizations + if (element2 in '3'..'1' != range1.contains(element2)) throw AssertionError() + if (element2 !in '3'..'1' != !range1.contains(element2)) throw AssertionError() + if (!(element2 in '3'..'1') != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in '3'..'1') != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if ('3' in '3'..'1' != range1.contains('3')) throw AssertionError() + if ('3' !in '3'..'1' != !range1.contains('3')) throw AssertionError() + if (!('3' in '3'..'1') != !range1.contains('3')) throw AssertionError() + if (!('3' !in '3'..'1') != range1.contains('3')) throw AssertionError() + // no local optimizations + if (element3 in '3'..'1' != range1.contains(element3)) throw AssertionError() + if (element3 !in '3'..'1' != !range1.contains(element3)) throw AssertionError() + if (!(element3 in '3'..'1') != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in '3'..'1') != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if ('4' in '3'..'1' != range1.contains('4')) throw AssertionError() + if ('4' !in '3'..'1' != !range1.contains('4')) throw AssertionError() + if (!('4' in '3'..'1') != !range1.contains('4')) throw AssertionError() + if (!('4' !in '3'..'1') != range1.contains('4')) throw AssertionError() + // no local optimizations + if (element4 in '3'..'1' != range1.contains(element4)) throw AssertionError() + if (element4 !in '3'..'1' != !range1.contains(element4)) throw AssertionError() + if (!(element4 in '3'..'1') != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in '3'..'1') != range1.contains(element4)) throw AssertionError() +} + + diff --git a/compiler/testData/codegen/box/ranges/contains/generated/charRangeUntil.kt b/compiler/testData/codegen/box/ranges/contains/generated/charRangeUntil.kt new file mode 100644 index 00000000000..fc498dbf2e3 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/contains/generated/charRangeUntil.kt @@ -0,0 +1,162 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_STDLIB +// DONT_TARGET_EXACT_BACKEND: JVM +// !LANGUAGE: +RangeUntilOperator +@file:OptIn(ExperimentalStdlibApi::class) + + + +val range0 = '1'..<'3' +val range1 = '3'..<'1' + +val element0 = '0' +val element1 = '1' +val element2 = '2' +val element3 = '3' +val element4 = '4' + +fun box(): String { + testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if ('0' in '1'..<'3' != range0.contains('0')) throw AssertionError() + if ('0' !in '1'..<'3' != !range0.contains('0')) throw AssertionError() + if (!('0' in '1'..<'3') != !range0.contains('0')) throw AssertionError() + if (!('0' !in '1'..<'3') != range0.contains('0')) throw AssertionError() + // no local optimizations + if (element0 in '1'..<'3' != range0.contains(element0)) throw AssertionError() + if (element0 !in '1'..<'3' != !range0.contains(element0)) throw AssertionError() + if (!(element0 in '1'..<'3') != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in '1'..<'3') != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if ('1' in '1'..<'3' != range0.contains('1')) throw AssertionError() + if ('1' !in '1'..<'3' != !range0.contains('1')) throw AssertionError() + if (!('1' in '1'..<'3') != !range0.contains('1')) throw AssertionError() + if (!('1' !in '1'..<'3') != range0.contains('1')) throw AssertionError() + // no local optimizations + if (element1 in '1'..<'3' != range0.contains(element1)) throw AssertionError() + if (element1 !in '1'..<'3' != !range0.contains(element1)) throw AssertionError() + if (!(element1 in '1'..<'3') != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in '1'..<'3') != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if ('2' in '1'..<'3' != range0.contains('2')) throw AssertionError() + if ('2' !in '1'..<'3' != !range0.contains('2')) throw AssertionError() + if (!('2' in '1'..<'3') != !range0.contains('2')) throw AssertionError() + if (!('2' !in '1'..<'3') != range0.contains('2')) throw AssertionError() + // no local optimizations + if (element2 in '1'..<'3' != range0.contains(element2)) throw AssertionError() + if (element2 !in '1'..<'3' != !range0.contains(element2)) throw AssertionError() + if (!(element2 in '1'..<'3') != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in '1'..<'3') != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if ('3' in '1'..<'3' != range0.contains('3')) throw AssertionError() + if ('3' !in '1'..<'3' != !range0.contains('3')) throw AssertionError() + if (!('3' in '1'..<'3') != !range0.contains('3')) throw AssertionError() + if (!('3' !in '1'..<'3') != range0.contains('3')) throw AssertionError() + // no local optimizations + if (element3 in '1'..<'3' != range0.contains(element3)) throw AssertionError() + if (element3 !in '1'..<'3' != !range0.contains(element3)) throw AssertionError() + if (!(element3 in '1'..<'3') != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in '1'..<'3') != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if ('4' in '1'..<'3' != range0.contains('4')) throw AssertionError() + if ('4' !in '1'..<'3' != !range0.contains('4')) throw AssertionError() + if (!('4' in '1'..<'3') != !range0.contains('4')) throw AssertionError() + if (!('4' !in '1'..<'3') != range0.contains('4')) throw AssertionError() + // no local optimizations + if (element4 in '1'..<'3' != range0.contains(element4)) throw AssertionError() + if (element4 !in '1'..<'3' != !range0.contains(element4)) throw AssertionError() + if (!(element4 in '1'..<'3') != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in '1'..<'3') != range0.contains(element4)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if ('0' in '3'..<'1' != range1.contains('0')) throw AssertionError() + if ('0' !in '3'..<'1' != !range1.contains('0')) throw AssertionError() + if (!('0' in '3'..<'1') != !range1.contains('0')) throw AssertionError() + if (!('0' !in '3'..<'1') != range1.contains('0')) throw AssertionError() + // no local optimizations + if (element0 in '3'..<'1' != range1.contains(element0)) throw AssertionError() + if (element0 !in '3'..<'1' != !range1.contains(element0)) throw AssertionError() + if (!(element0 in '3'..<'1') != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in '3'..<'1') != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if ('1' in '3'..<'1' != range1.contains('1')) throw AssertionError() + if ('1' !in '3'..<'1' != !range1.contains('1')) throw AssertionError() + if (!('1' in '3'..<'1') != !range1.contains('1')) throw AssertionError() + if (!('1' !in '3'..<'1') != range1.contains('1')) throw AssertionError() + // no local optimizations + if (element1 in '3'..<'1' != range1.contains(element1)) throw AssertionError() + if (element1 !in '3'..<'1' != !range1.contains(element1)) throw AssertionError() + if (!(element1 in '3'..<'1') != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in '3'..<'1') != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if ('2' in '3'..<'1' != range1.contains('2')) throw AssertionError() + if ('2' !in '3'..<'1' != !range1.contains('2')) throw AssertionError() + if (!('2' in '3'..<'1') != !range1.contains('2')) throw AssertionError() + if (!('2' !in '3'..<'1') != range1.contains('2')) throw AssertionError() + // no local optimizations + if (element2 in '3'..<'1' != range1.contains(element2)) throw AssertionError() + if (element2 !in '3'..<'1' != !range1.contains(element2)) throw AssertionError() + if (!(element2 in '3'..<'1') != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in '3'..<'1') != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if ('3' in '3'..<'1' != range1.contains('3')) throw AssertionError() + if ('3' !in '3'..<'1' != !range1.contains('3')) throw AssertionError() + if (!('3' in '3'..<'1') != !range1.contains('3')) throw AssertionError() + if (!('3' !in '3'..<'1') != range1.contains('3')) throw AssertionError() + // no local optimizations + if (element3 in '3'..<'1' != range1.contains(element3)) throw AssertionError() + if (element3 !in '3'..<'1' != !range1.contains(element3)) throw AssertionError() + if (!(element3 in '3'..<'1') != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in '3'..<'1') != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if ('4' in '3'..<'1' != range1.contains('4')) throw AssertionError() + if ('4' !in '3'..<'1' != !range1.contains('4')) throw AssertionError() + if (!('4' in '3'..<'1') != !range1.contains('4')) throw AssertionError() + if (!('4' !in '3'..<'1') != range1.contains('4')) throw AssertionError() + // no local optimizations + if (element4 in '3'..<'1' != range1.contains(element4)) throw AssertionError() + if (element4 !in '3'..<'1' != !range1.contains(element4)) throw AssertionError() + if (!(element4 in '3'..<'1') != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in '3'..<'1') != range1.contains(element4)) throw AssertionError() +} + + diff --git a/compiler/testData/codegen/box/ranges/contains/generated/charSequenceIndices.kt b/compiler/testData/codegen/box/ranges/contains/generated/charSequenceIndices.kt index 165d72d76e6..110ba139add 100644 --- a/compiler/testData/codegen/box/ranges/contains/generated/charSequenceIndices.kt +++ b/compiler/testData/codegen/box/ranges/contains/generated/charSequenceIndices.kt @@ -9,28 +9,28 @@ val range1 = emptyCharSequence.indices val element0 = (-1).toByte() val element1 = (-1).toShort() -val element2 = (-1) -val element3 = (-1).toLong() +val element2 = -1 +val element3 = -1L val element4 = 0.toByte() val element5 = 0.toShort() val element6 = 0 -val element7 = 0.toLong() +val element7 = 0L val element8 = 1.toByte() val element9 = 1.toShort() val element10 = 1 -val element11 = 1.toLong() +val element11 = 1L val element12 = 2.toByte() val element13 = 2.toShort() val element14 = 2 -val element15 = 2.toLong() +val element15 = 2L val element16 = 3.toByte() val element17 = 3.toShort() val element18 = 3 -val element19 = 3.toLong() +val element19 = 3L val element20 = 4.toByte() val element21 = 4.toShort() val element22 = 4 -val element23 = 4.toLong() +val element23 = 4L fun box(): String { testR0xE0() @@ -112,10 +112,10 @@ fun testR0xE1() { fun testR0xE2() { // with possible local optimizations - if ((-1) in charSequence.indices != range0.contains((-1))) throw AssertionError() - if ((-1) !in charSequence.indices != !range0.contains((-1))) throw AssertionError() - if (!((-1) in charSequence.indices) != !range0.contains((-1))) throw AssertionError() - if (!((-1) !in charSequence.indices) != range0.contains((-1))) throw AssertionError() + if (-1 in charSequence.indices != range0.contains(-1)) throw AssertionError() + if (-1 !in charSequence.indices != !range0.contains(-1)) throw AssertionError() + if (!(-1 in charSequence.indices) != !range0.contains(-1)) throw AssertionError() + if (!(-1 !in charSequence.indices) != range0.contains(-1)) throw AssertionError() // no local optimizations if (element2 in charSequence.indices != range0.contains(element2)) throw AssertionError() if (element2 !in charSequence.indices != !range0.contains(element2)) throw AssertionError() @@ -125,10 +125,10 @@ fun testR0xE2() { fun testR0xE3() { // with possible local optimizations - if ((-1).toLong() in charSequence.indices != range0.contains((-1).toLong())) throw AssertionError() - if ((-1).toLong() !in charSequence.indices != !range0.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() in charSequence.indices) != !range0.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() !in charSequence.indices) != range0.contains((-1).toLong())) throw AssertionError() + if (-1L in charSequence.indices != range0.contains(-1L)) throw AssertionError() + if (-1L !in charSequence.indices != !range0.contains(-1L)) throw AssertionError() + if (!(-1L in charSequence.indices) != !range0.contains(-1L)) throw AssertionError() + if (!(-1L !in charSequence.indices) != range0.contains(-1L)) throw AssertionError() // no local optimizations if (element3 in charSequence.indices != range0.contains(element3)) throw AssertionError() if (element3 !in charSequence.indices != !range0.contains(element3)) throw AssertionError() @@ -177,10 +177,10 @@ fun testR0xE6() { fun testR0xE7() { // with possible local optimizations - if (0.toLong() in charSequence.indices != range0.contains(0.toLong())) throw AssertionError() - if (0.toLong() !in charSequence.indices != !range0.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() in charSequence.indices) != !range0.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() !in charSequence.indices) != range0.contains(0.toLong())) throw AssertionError() + if (0L in charSequence.indices != range0.contains(0L)) throw AssertionError() + if (0L !in charSequence.indices != !range0.contains(0L)) throw AssertionError() + if (!(0L in charSequence.indices) != !range0.contains(0L)) throw AssertionError() + if (!(0L !in charSequence.indices) != range0.contains(0L)) throw AssertionError() // no local optimizations if (element7 in charSequence.indices != range0.contains(element7)) throw AssertionError() if (element7 !in charSequence.indices != !range0.contains(element7)) throw AssertionError() @@ -229,10 +229,10 @@ fun testR0xE10() { fun testR0xE11() { // with possible local optimizations - if (1.toLong() in charSequence.indices != range0.contains(1.toLong())) throw AssertionError() - if (1.toLong() !in charSequence.indices != !range0.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() in charSequence.indices) != !range0.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() !in charSequence.indices) != range0.contains(1.toLong())) throw AssertionError() + if (1L in charSequence.indices != range0.contains(1L)) throw AssertionError() + if (1L !in charSequence.indices != !range0.contains(1L)) throw AssertionError() + if (!(1L in charSequence.indices) != !range0.contains(1L)) throw AssertionError() + if (!(1L !in charSequence.indices) != range0.contains(1L)) throw AssertionError() // no local optimizations if (element11 in charSequence.indices != range0.contains(element11)) throw AssertionError() if (element11 !in charSequence.indices != !range0.contains(element11)) throw AssertionError() @@ -281,10 +281,10 @@ fun testR0xE14() { fun testR0xE15() { // with possible local optimizations - if (2.toLong() in charSequence.indices != range0.contains(2.toLong())) throw AssertionError() - if (2.toLong() !in charSequence.indices != !range0.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() in charSequence.indices) != !range0.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() !in charSequence.indices) != range0.contains(2.toLong())) throw AssertionError() + if (2L in charSequence.indices != range0.contains(2L)) throw AssertionError() + if (2L !in charSequence.indices != !range0.contains(2L)) throw AssertionError() + if (!(2L in charSequence.indices) != !range0.contains(2L)) throw AssertionError() + if (!(2L !in charSequence.indices) != range0.contains(2L)) throw AssertionError() // no local optimizations if (element15 in charSequence.indices != range0.contains(element15)) throw AssertionError() if (element15 !in charSequence.indices != !range0.contains(element15)) throw AssertionError() @@ -333,10 +333,10 @@ fun testR0xE18() { fun testR0xE19() { // with possible local optimizations - if (3.toLong() in charSequence.indices != range0.contains(3.toLong())) throw AssertionError() - if (3.toLong() !in charSequence.indices != !range0.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() in charSequence.indices) != !range0.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() !in charSequence.indices) != range0.contains(3.toLong())) throw AssertionError() + if (3L in charSequence.indices != range0.contains(3L)) throw AssertionError() + if (3L !in charSequence.indices != !range0.contains(3L)) throw AssertionError() + if (!(3L in charSequence.indices) != !range0.contains(3L)) throw AssertionError() + if (!(3L !in charSequence.indices) != range0.contains(3L)) throw AssertionError() // no local optimizations if (element19 in charSequence.indices != range0.contains(element19)) throw AssertionError() if (element19 !in charSequence.indices != !range0.contains(element19)) throw AssertionError() @@ -385,10 +385,10 @@ fun testR0xE22() { fun testR0xE23() { // with possible local optimizations - if (4.toLong() in charSequence.indices != range0.contains(4.toLong())) throw AssertionError() - if (4.toLong() !in charSequence.indices != !range0.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() in charSequence.indices) != !range0.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() !in charSequence.indices) != range0.contains(4.toLong())) throw AssertionError() + if (4L in charSequence.indices != range0.contains(4L)) throw AssertionError() + if (4L !in charSequence.indices != !range0.contains(4L)) throw AssertionError() + if (!(4L in charSequence.indices) != !range0.contains(4L)) throw AssertionError() + if (!(4L !in charSequence.indices) != range0.contains(4L)) throw AssertionError() // no local optimizations if (element23 in charSequence.indices != range0.contains(element23)) throw AssertionError() if (element23 !in charSequence.indices != !range0.contains(element23)) throw AssertionError() @@ -424,10 +424,10 @@ fun testR1xE1() { fun testR1xE2() { // with possible local optimizations - if ((-1) in emptyCharSequence.indices != range1.contains((-1))) throw AssertionError() - if ((-1) !in emptyCharSequence.indices != !range1.contains((-1))) throw AssertionError() - if (!((-1) in emptyCharSequence.indices) != !range1.contains((-1))) throw AssertionError() - if (!((-1) !in emptyCharSequence.indices) != range1.contains((-1))) throw AssertionError() + if (-1 in emptyCharSequence.indices != range1.contains(-1)) throw AssertionError() + if (-1 !in emptyCharSequence.indices != !range1.contains(-1)) throw AssertionError() + if (!(-1 in emptyCharSequence.indices) != !range1.contains(-1)) throw AssertionError() + if (!(-1 !in emptyCharSequence.indices) != range1.contains(-1)) throw AssertionError() // no local optimizations if (element2 in emptyCharSequence.indices != range1.contains(element2)) throw AssertionError() if (element2 !in emptyCharSequence.indices != !range1.contains(element2)) throw AssertionError() @@ -437,10 +437,10 @@ fun testR1xE2() { fun testR1xE3() { // with possible local optimizations - if ((-1).toLong() in emptyCharSequence.indices != range1.contains((-1).toLong())) throw AssertionError() - if ((-1).toLong() !in emptyCharSequence.indices != !range1.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() in emptyCharSequence.indices) != !range1.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() !in emptyCharSequence.indices) != range1.contains((-1).toLong())) throw AssertionError() + if (-1L in emptyCharSequence.indices != range1.contains(-1L)) throw AssertionError() + if (-1L !in emptyCharSequence.indices != !range1.contains(-1L)) throw AssertionError() + if (!(-1L in emptyCharSequence.indices) != !range1.contains(-1L)) throw AssertionError() + if (!(-1L !in emptyCharSequence.indices) != range1.contains(-1L)) throw AssertionError() // no local optimizations if (element3 in emptyCharSequence.indices != range1.contains(element3)) throw AssertionError() if (element3 !in emptyCharSequence.indices != !range1.contains(element3)) throw AssertionError() @@ -489,10 +489,10 @@ fun testR1xE6() { fun testR1xE7() { // with possible local optimizations - if (0.toLong() in emptyCharSequence.indices != range1.contains(0.toLong())) throw AssertionError() - if (0.toLong() !in emptyCharSequence.indices != !range1.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() in emptyCharSequence.indices) != !range1.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() !in emptyCharSequence.indices) != range1.contains(0.toLong())) throw AssertionError() + if (0L in emptyCharSequence.indices != range1.contains(0L)) throw AssertionError() + if (0L !in emptyCharSequence.indices != !range1.contains(0L)) throw AssertionError() + if (!(0L in emptyCharSequence.indices) != !range1.contains(0L)) throw AssertionError() + if (!(0L !in emptyCharSequence.indices) != range1.contains(0L)) throw AssertionError() // no local optimizations if (element7 in emptyCharSequence.indices != range1.contains(element7)) throw AssertionError() if (element7 !in emptyCharSequence.indices != !range1.contains(element7)) throw AssertionError() @@ -541,10 +541,10 @@ fun testR1xE10() { fun testR1xE11() { // with possible local optimizations - if (1.toLong() in emptyCharSequence.indices != range1.contains(1.toLong())) throw AssertionError() - if (1.toLong() !in emptyCharSequence.indices != !range1.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() in emptyCharSequence.indices) != !range1.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() !in emptyCharSequence.indices) != range1.contains(1.toLong())) throw AssertionError() + if (1L in emptyCharSequence.indices != range1.contains(1L)) throw AssertionError() + if (1L !in emptyCharSequence.indices != !range1.contains(1L)) throw AssertionError() + if (!(1L in emptyCharSequence.indices) != !range1.contains(1L)) throw AssertionError() + if (!(1L !in emptyCharSequence.indices) != range1.contains(1L)) throw AssertionError() // no local optimizations if (element11 in emptyCharSequence.indices != range1.contains(element11)) throw AssertionError() if (element11 !in emptyCharSequence.indices != !range1.contains(element11)) throw AssertionError() @@ -593,10 +593,10 @@ fun testR1xE14() { fun testR1xE15() { // with possible local optimizations - if (2.toLong() in emptyCharSequence.indices != range1.contains(2.toLong())) throw AssertionError() - if (2.toLong() !in emptyCharSequence.indices != !range1.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() in emptyCharSequence.indices) != !range1.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() !in emptyCharSequence.indices) != range1.contains(2.toLong())) throw AssertionError() + if (2L in emptyCharSequence.indices != range1.contains(2L)) throw AssertionError() + if (2L !in emptyCharSequence.indices != !range1.contains(2L)) throw AssertionError() + if (!(2L in emptyCharSequence.indices) != !range1.contains(2L)) throw AssertionError() + if (!(2L !in emptyCharSequence.indices) != range1.contains(2L)) throw AssertionError() // no local optimizations if (element15 in emptyCharSequence.indices != range1.contains(element15)) throw AssertionError() if (element15 !in emptyCharSequence.indices != !range1.contains(element15)) throw AssertionError() @@ -645,10 +645,10 @@ fun testR1xE18() { fun testR1xE19() { // with possible local optimizations - if (3.toLong() in emptyCharSequence.indices != range1.contains(3.toLong())) throw AssertionError() - if (3.toLong() !in emptyCharSequence.indices != !range1.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() in emptyCharSequence.indices) != !range1.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() !in emptyCharSequence.indices) != range1.contains(3.toLong())) throw AssertionError() + if (3L in emptyCharSequence.indices != range1.contains(3L)) throw AssertionError() + if (3L !in emptyCharSequence.indices != !range1.contains(3L)) throw AssertionError() + if (!(3L in emptyCharSequence.indices) != !range1.contains(3L)) throw AssertionError() + if (!(3L !in emptyCharSequence.indices) != range1.contains(3L)) throw AssertionError() // no local optimizations if (element19 in emptyCharSequence.indices != range1.contains(element19)) throw AssertionError() if (element19 !in emptyCharSequence.indices != !range1.contains(element19)) throw AssertionError() @@ -697,10 +697,10 @@ fun testR1xE22() { fun testR1xE23() { // with possible local optimizations - if (4.toLong() in emptyCharSequence.indices != range1.contains(4.toLong())) throw AssertionError() - if (4.toLong() !in emptyCharSequence.indices != !range1.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() in emptyCharSequence.indices) != !range1.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() !in emptyCharSequence.indices) != range1.contains(4.toLong())) throw AssertionError() + if (4L in emptyCharSequence.indices != range1.contains(4L)) throw AssertionError() + if (4L !in emptyCharSequence.indices != !range1.contains(4L)) throw AssertionError() + if (!(4L in emptyCharSequence.indices) != !range1.contains(4L)) throw AssertionError() + if (!(4L !in emptyCharSequence.indices) != range1.contains(4L)) throw AssertionError() // no local optimizations if (element23 in emptyCharSequence.indices != range1.contains(element23)) throw AssertionError() if (element23 !in emptyCharSequence.indices != !range1.contains(element23)) throw AssertionError() diff --git a/compiler/testData/codegen/box/ranges/contains/generated/collectionIndices.kt b/compiler/testData/codegen/box/ranges/contains/generated/collectionIndices.kt index 90607d126db..60a1b381e6e 100644 --- a/compiler/testData/codegen/box/ranges/contains/generated/collectionIndices.kt +++ b/compiler/testData/codegen/box/ranges/contains/generated/collectionIndices.kt @@ -9,28 +9,28 @@ val range1 = emptyCollection.indices val element0 = (-1).toByte() val element1 = (-1).toShort() -val element2 = (-1) -val element3 = (-1).toLong() +val element2 = -1 +val element3 = -1L val element4 = 0.toByte() val element5 = 0.toShort() val element6 = 0 -val element7 = 0.toLong() +val element7 = 0L val element8 = 1.toByte() val element9 = 1.toShort() val element10 = 1 -val element11 = 1.toLong() +val element11 = 1L val element12 = 2.toByte() val element13 = 2.toShort() val element14 = 2 -val element15 = 2.toLong() +val element15 = 2L val element16 = 3.toByte() val element17 = 3.toShort() val element18 = 3 -val element19 = 3.toLong() +val element19 = 3L val element20 = 4.toByte() val element21 = 4.toShort() val element22 = 4 -val element23 = 4.toLong() +val element23 = 4L fun box(): String { testR0xE0() @@ -112,10 +112,10 @@ fun testR0xE1() { fun testR0xE2() { // with possible local optimizations - if ((-1) in collection.indices != range0.contains((-1))) throw AssertionError() - if ((-1) !in collection.indices != !range0.contains((-1))) throw AssertionError() - if (!((-1) in collection.indices) != !range0.contains((-1))) throw AssertionError() - if (!((-1) !in collection.indices) != range0.contains((-1))) throw AssertionError() + if (-1 in collection.indices != range0.contains(-1)) throw AssertionError() + if (-1 !in collection.indices != !range0.contains(-1)) throw AssertionError() + if (!(-1 in collection.indices) != !range0.contains(-1)) throw AssertionError() + if (!(-1 !in collection.indices) != range0.contains(-1)) throw AssertionError() // no local optimizations if (element2 in collection.indices != range0.contains(element2)) throw AssertionError() if (element2 !in collection.indices != !range0.contains(element2)) throw AssertionError() @@ -125,10 +125,10 @@ fun testR0xE2() { fun testR0xE3() { // with possible local optimizations - if ((-1).toLong() in collection.indices != range0.contains((-1).toLong())) throw AssertionError() - if ((-1).toLong() !in collection.indices != !range0.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() in collection.indices) != !range0.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() !in collection.indices) != range0.contains((-1).toLong())) throw AssertionError() + if (-1L in collection.indices != range0.contains(-1L)) throw AssertionError() + if (-1L !in collection.indices != !range0.contains(-1L)) throw AssertionError() + if (!(-1L in collection.indices) != !range0.contains(-1L)) throw AssertionError() + if (!(-1L !in collection.indices) != range0.contains(-1L)) throw AssertionError() // no local optimizations if (element3 in collection.indices != range0.contains(element3)) throw AssertionError() if (element3 !in collection.indices != !range0.contains(element3)) throw AssertionError() @@ -177,10 +177,10 @@ fun testR0xE6() { fun testR0xE7() { // with possible local optimizations - if (0.toLong() in collection.indices != range0.contains(0.toLong())) throw AssertionError() - if (0.toLong() !in collection.indices != !range0.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() in collection.indices) != !range0.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() !in collection.indices) != range0.contains(0.toLong())) throw AssertionError() + if (0L in collection.indices != range0.contains(0L)) throw AssertionError() + if (0L !in collection.indices != !range0.contains(0L)) throw AssertionError() + if (!(0L in collection.indices) != !range0.contains(0L)) throw AssertionError() + if (!(0L !in collection.indices) != range0.contains(0L)) throw AssertionError() // no local optimizations if (element7 in collection.indices != range0.contains(element7)) throw AssertionError() if (element7 !in collection.indices != !range0.contains(element7)) throw AssertionError() @@ -229,10 +229,10 @@ fun testR0xE10() { fun testR0xE11() { // with possible local optimizations - if (1.toLong() in collection.indices != range0.contains(1.toLong())) throw AssertionError() - if (1.toLong() !in collection.indices != !range0.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() in collection.indices) != !range0.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() !in collection.indices) != range0.contains(1.toLong())) throw AssertionError() + if (1L in collection.indices != range0.contains(1L)) throw AssertionError() + if (1L !in collection.indices != !range0.contains(1L)) throw AssertionError() + if (!(1L in collection.indices) != !range0.contains(1L)) throw AssertionError() + if (!(1L !in collection.indices) != range0.contains(1L)) throw AssertionError() // no local optimizations if (element11 in collection.indices != range0.contains(element11)) throw AssertionError() if (element11 !in collection.indices != !range0.contains(element11)) throw AssertionError() @@ -281,10 +281,10 @@ fun testR0xE14() { fun testR0xE15() { // with possible local optimizations - if (2.toLong() in collection.indices != range0.contains(2.toLong())) throw AssertionError() - if (2.toLong() !in collection.indices != !range0.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() in collection.indices) != !range0.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() !in collection.indices) != range0.contains(2.toLong())) throw AssertionError() + if (2L in collection.indices != range0.contains(2L)) throw AssertionError() + if (2L !in collection.indices != !range0.contains(2L)) throw AssertionError() + if (!(2L in collection.indices) != !range0.contains(2L)) throw AssertionError() + if (!(2L !in collection.indices) != range0.contains(2L)) throw AssertionError() // no local optimizations if (element15 in collection.indices != range0.contains(element15)) throw AssertionError() if (element15 !in collection.indices != !range0.contains(element15)) throw AssertionError() @@ -333,10 +333,10 @@ fun testR0xE18() { fun testR0xE19() { // with possible local optimizations - if (3.toLong() in collection.indices != range0.contains(3.toLong())) throw AssertionError() - if (3.toLong() !in collection.indices != !range0.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() in collection.indices) != !range0.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() !in collection.indices) != range0.contains(3.toLong())) throw AssertionError() + if (3L in collection.indices != range0.contains(3L)) throw AssertionError() + if (3L !in collection.indices != !range0.contains(3L)) throw AssertionError() + if (!(3L in collection.indices) != !range0.contains(3L)) throw AssertionError() + if (!(3L !in collection.indices) != range0.contains(3L)) throw AssertionError() // no local optimizations if (element19 in collection.indices != range0.contains(element19)) throw AssertionError() if (element19 !in collection.indices != !range0.contains(element19)) throw AssertionError() @@ -385,10 +385,10 @@ fun testR0xE22() { fun testR0xE23() { // with possible local optimizations - if (4.toLong() in collection.indices != range0.contains(4.toLong())) throw AssertionError() - if (4.toLong() !in collection.indices != !range0.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() in collection.indices) != !range0.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() !in collection.indices) != range0.contains(4.toLong())) throw AssertionError() + if (4L in collection.indices != range0.contains(4L)) throw AssertionError() + if (4L !in collection.indices != !range0.contains(4L)) throw AssertionError() + if (!(4L in collection.indices) != !range0.contains(4L)) throw AssertionError() + if (!(4L !in collection.indices) != range0.contains(4L)) throw AssertionError() // no local optimizations if (element23 in collection.indices != range0.contains(element23)) throw AssertionError() if (element23 !in collection.indices != !range0.contains(element23)) throw AssertionError() @@ -424,10 +424,10 @@ fun testR1xE1() { fun testR1xE2() { // with possible local optimizations - if ((-1) in emptyCollection.indices != range1.contains((-1))) throw AssertionError() - if ((-1) !in emptyCollection.indices != !range1.contains((-1))) throw AssertionError() - if (!((-1) in emptyCollection.indices) != !range1.contains((-1))) throw AssertionError() - if (!((-1) !in emptyCollection.indices) != range1.contains((-1))) throw AssertionError() + if (-1 in emptyCollection.indices != range1.contains(-1)) throw AssertionError() + if (-1 !in emptyCollection.indices != !range1.contains(-1)) throw AssertionError() + if (!(-1 in emptyCollection.indices) != !range1.contains(-1)) throw AssertionError() + if (!(-1 !in emptyCollection.indices) != range1.contains(-1)) throw AssertionError() // no local optimizations if (element2 in emptyCollection.indices != range1.contains(element2)) throw AssertionError() if (element2 !in emptyCollection.indices != !range1.contains(element2)) throw AssertionError() @@ -437,10 +437,10 @@ fun testR1xE2() { fun testR1xE3() { // with possible local optimizations - if ((-1).toLong() in emptyCollection.indices != range1.contains((-1).toLong())) throw AssertionError() - if ((-1).toLong() !in emptyCollection.indices != !range1.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() in emptyCollection.indices) != !range1.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() !in emptyCollection.indices) != range1.contains((-1).toLong())) throw AssertionError() + if (-1L in emptyCollection.indices != range1.contains(-1L)) throw AssertionError() + if (-1L !in emptyCollection.indices != !range1.contains(-1L)) throw AssertionError() + if (!(-1L in emptyCollection.indices) != !range1.contains(-1L)) throw AssertionError() + if (!(-1L !in emptyCollection.indices) != range1.contains(-1L)) throw AssertionError() // no local optimizations if (element3 in emptyCollection.indices != range1.contains(element3)) throw AssertionError() if (element3 !in emptyCollection.indices != !range1.contains(element3)) throw AssertionError() @@ -489,10 +489,10 @@ fun testR1xE6() { fun testR1xE7() { // with possible local optimizations - if (0.toLong() in emptyCollection.indices != range1.contains(0.toLong())) throw AssertionError() - if (0.toLong() !in emptyCollection.indices != !range1.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() in emptyCollection.indices) != !range1.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() !in emptyCollection.indices) != range1.contains(0.toLong())) throw AssertionError() + if (0L in emptyCollection.indices != range1.contains(0L)) throw AssertionError() + if (0L !in emptyCollection.indices != !range1.contains(0L)) throw AssertionError() + if (!(0L in emptyCollection.indices) != !range1.contains(0L)) throw AssertionError() + if (!(0L !in emptyCollection.indices) != range1.contains(0L)) throw AssertionError() // no local optimizations if (element7 in emptyCollection.indices != range1.contains(element7)) throw AssertionError() if (element7 !in emptyCollection.indices != !range1.contains(element7)) throw AssertionError() @@ -541,10 +541,10 @@ fun testR1xE10() { fun testR1xE11() { // with possible local optimizations - if (1.toLong() in emptyCollection.indices != range1.contains(1.toLong())) throw AssertionError() - if (1.toLong() !in emptyCollection.indices != !range1.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() in emptyCollection.indices) != !range1.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() !in emptyCollection.indices) != range1.contains(1.toLong())) throw AssertionError() + if (1L in emptyCollection.indices != range1.contains(1L)) throw AssertionError() + if (1L !in emptyCollection.indices != !range1.contains(1L)) throw AssertionError() + if (!(1L in emptyCollection.indices) != !range1.contains(1L)) throw AssertionError() + if (!(1L !in emptyCollection.indices) != range1.contains(1L)) throw AssertionError() // no local optimizations if (element11 in emptyCollection.indices != range1.contains(element11)) throw AssertionError() if (element11 !in emptyCollection.indices != !range1.contains(element11)) throw AssertionError() @@ -593,10 +593,10 @@ fun testR1xE14() { fun testR1xE15() { // with possible local optimizations - if (2.toLong() in emptyCollection.indices != range1.contains(2.toLong())) throw AssertionError() - if (2.toLong() !in emptyCollection.indices != !range1.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() in emptyCollection.indices) != !range1.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() !in emptyCollection.indices) != range1.contains(2.toLong())) throw AssertionError() + if (2L in emptyCollection.indices != range1.contains(2L)) throw AssertionError() + if (2L !in emptyCollection.indices != !range1.contains(2L)) throw AssertionError() + if (!(2L in emptyCollection.indices) != !range1.contains(2L)) throw AssertionError() + if (!(2L !in emptyCollection.indices) != range1.contains(2L)) throw AssertionError() // no local optimizations if (element15 in emptyCollection.indices != range1.contains(element15)) throw AssertionError() if (element15 !in emptyCollection.indices != !range1.contains(element15)) throw AssertionError() @@ -645,10 +645,10 @@ fun testR1xE18() { fun testR1xE19() { // with possible local optimizations - if (3.toLong() in emptyCollection.indices != range1.contains(3.toLong())) throw AssertionError() - if (3.toLong() !in emptyCollection.indices != !range1.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() in emptyCollection.indices) != !range1.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() !in emptyCollection.indices) != range1.contains(3.toLong())) throw AssertionError() + if (3L in emptyCollection.indices != range1.contains(3L)) throw AssertionError() + if (3L !in emptyCollection.indices != !range1.contains(3L)) throw AssertionError() + if (!(3L in emptyCollection.indices) != !range1.contains(3L)) throw AssertionError() + if (!(3L !in emptyCollection.indices) != range1.contains(3L)) throw AssertionError() // no local optimizations if (element19 in emptyCollection.indices != range1.contains(element19)) throw AssertionError() if (element19 !in emptyCollection.indices != !range1.contains(element19)) throw AssertionError() @@ -697,10 +697,10 @@ fun testR1xE22() { fun testR1xE23() { // with possible local optimizations - if (4.toLong() in emptyCollection.indices != range1.contains(4.toLong())) throw AssertionError() - if (4.toLong() !in emptyCollection.indices != !range1.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() in emptyCollection.indices) != !range1.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() !in emptyCollection.indices) != range1.contains(4.toLong())) throw AssertionError() + if (4L in emptyCollection.indices != range1.contains(4L)) throw AssertionError() + if (4L !in emptyCollection.indices != !range1.contains(4L)) throw AssertionError() + if (!(4L in emptyCollection.indices) != !range1.contains(4L)) throw AssertionError() + if (!(4L !in emptyCollection.indices) != range1.contains(4L)) throw AssertionError() // no local optimizations if (element23 in emptyCollection.indices != range1.contains(element23)) throw AssertionError() if (element23 !in emptyCollection.indices != !range1.contains(element23)) throw AssertionError() diff --git a/compiler/testData/codegen/box/ranges/contains/generated/doubleRangeLiteral.kt b/compiler/testData/codegen/box/ranges/contains/generated/doubleRangeLiteral.kt deleted file mode 100644 index 656e401aa42..00000000000 --- a/compiler/testData/codegen/box/ranges/contains/generated/doubleRangeLiteral.kt +++ /dev/null @@ -1,362 +0,0 @@ -// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! -// WITH_STDLIB - - - -val range0 = 1.0 .. 3.0 -val range1 = 3.0 .. 1.0 - -val element0 = (-1).toFloat() -val element1 = (-1).toDouble() -val element2 = 0.toFloat() -val element3 = 0.toDouble() -val element4 = 1.toFloat() -val element5 = 1.toDouble() -val element6 = 2.toFloat() -val element7 = 2.toDouble() -val element8 = 3.toFloat() -val element9 = 3.toDouble() -val element10 = 4.toFloat() -val element11 = 4.toDouble() - -fun box(): String { - testR0xE0() - testR0xE1() - testR0xE2() - testR0xE3() - testR0xE4() - testR0xE5() - testR0xE6() - testR0xE7() - testR0xE8() - testR0xE9() - testR0xE10() - testR0xE11() - testR1xE0() - testR1xE1() - testR1xE2() - testR1xE3() - testR1xE4() - testR1xE5() - testR1xE6() - testR1xE7() - testR1xE8() - testR1xE9() - testR1xE10() - testR1xE11() - return "OK" -} - -fun testR0xE0() { - // with possible local optimizations - if ((-1).toFloat() in 1.0 .. 3.0 != range0.contains((-1).toFloat())) throw AssertionError() - if ((-1).toFloat() !in 1.0 .. 3.0 != !range0.contains((-1).toFloat())) throw AssertionError() - if (!((-1).toFloat() in 1.0 .. 3.0) != !range0.contains((-1).toFloat())) throw AssertionError() - if (!((-1).toFloat() !in 1.0 .. 3.0) != range0.contains((-1).toFloat())) throw AssertionError() - // no local optimizations - if (element0 in 1.0 .. 3.0 != range0.contains(element0)) throw AssertionError() - if (element0 !in 1.0 .. 3.0 != !range0.contains(element0)) throw AssertionError() - if (!(element0 in 1.0 .. 3.0) != !range0.contains(element0)) throw AssertionError() - if (!(element0 !in 1.0 .. 3.0) != range0.contains(element0)) throw AssertionError() -} - -fun testR0xE1() { - // with possible local optimizations - if ((-1).toDouble() in 1.0 .. 3.0 != range0.contains((-1).toDouble())) throw AssertionError() - if ((-1).toDouble() !in 1.0 .. 3.0 != !range0.contains((-1).toDouble())) throw AssertionError() - if (!((-1).toDouble() in 1.0 .. 3.0) != !range0.contains((-1).toDouble())) throw AssertionError() - if (!((-1).toDouble() !in 1.0 .. 3.0) != range0.contains((-1).toDouble())) throw AssertionError() - // no local optimizations - if (element1 in 1.0 .. 3.0 != range0.contains(element1)) throw AssertionError() - if (element1 !in 1.0 .. 3.0 != !range0.contains(element1)) throw AssertionError() - if (!(element1 in 1.0 .. 3.0) != !range0.contains(element1)) throw AssertionError() - if (!(element1 !in 1.0 .. 3.0) != range0.contains(element1)) throw AssertionError() -} - -fun testR0xE2() { - // with possible local optimizations - if (0.toFloat() in 1.0 .. 3.0 != range0.contains(0.toFloat())) throw AssertionError() - if (0.toFloat() !in 1.0 .. 3.0 != !range0.contains(0.toFloat())) throw AssertionError() - if (!(0.toFloat() in 1.0 .. 3.0) != !range0.contains(0.toFloat())) throw AssertionError() - if (!(0.toFloat() !in 1.0 .. 3.0) != range0.contains(0.toFloat())) throw AssertionError() - // no local optimizations - if (element2 in 1.0 .. 3.0 != range0.contains(element2)) throw AssertionError() - if (element2 !in 1.0 .. 3.0 != !range0.contains(element2)) throw AssertionError() - if (!(element2 in 1.0 .. 3.0) != !range0.contains(element2)) throw AssertionError() - if (!(element2 !in 1.0 .. 3.0) != range0.contains(element2)) throw AssertionError() -} - -fun testR0xE3() { - // with possible local optimizations - if (0.toDouble() in 1.0 .. 3.0 != range0.contains(0.toDouble())) throw AssertionError() - if (0.toDouble() !in 1.0 .. 3.0 != !range0.contains(0.toDouble())) throw AssertionError() - if (!(0.toDouble() in 1.0 .. 3.0) != !range0.contains(0.toDouble())) throw AssertionError() - if (!(0.toDouble() !in 1.0 .. 3.0) != range0.contains(0.toDouble())) throw AssertionError() - // no local optimizations - if (element3 in 1.0 .. 3.0 != range0.contains(element3)) throw AssertionError() - if (element3 !in 1.0 .. 3.0 != !range0.contains(element3)) throw AssertionError() - if (!(element3 in 1.0 .. 3.0) != !range0.contains(element3)) throw AssertionError() - if (!(element3 !in 1.0 .. 3.0) != range0.contains(element3)) throw AssertionError() -} - -fun testR0xE4() { - // with possible local optimizations - if (1.toFloat() in 1.0 .. 3.0 != range0.contains(1.toFloat())) throw AssertionError() - if (1.toFloat() !in 1.0 .. 3.0 != !range0.contains(1.toFloat())) throw AssertionError() - if (!(1.toFloat() in 1.0 .. 3.0) != !range0.contains(1.toFloat())) throw AssertionError() - if (!(1.toFloat() !in 1.0 .. 3.0) != range0.contains(1.toFloat())) throw AssertionError() - // no local optimizations - if (element4 in 1.0 .. 3.0 != range0.contains(element4)) throw AssertionError() - if (element4 !in 1.0 .. 3.0 != !range0.contains(element4)) throw AssertionError() - if (!(element4 in 1.0 .. 3.0) != !range0.contains(element4)) throw AssertionError() - if (!(element4 !in 1.0 .. 3.0) != range0.contains(element4)) throw AssertionError() -} - -fun testR0xE5() { - // with possible local optimizations - if (1.toDouble() in 1.0 .. 3.0 != range0.contains(1.toDouble())) throw AssertionError() - if (1.toDouble() !in 1.0 .. 3.0 != !range0.contains(1.toDouble())) throw AssertionError() - if (!(1.toDouble() in 1.0 .. 3.0) != !range0.contains(1.toDouble())) throw AssertionError() - if (!(1.toDouble() !in 1.0 .. 3.0) != range0.contains(1.toDouble())) throw AssertionError() - // no local optimizations - if (element5 in 1.0 .. 3.0 != range0.contains(element5)) throw AssertionError() - if (element5 !in 1.0 .. 3.0 != !range0.contains(element5)) throw AssertionError() - if (!(element5 in 1.0 .. 3.0) != !range0.contains(element5)) throw AssertionError() - if (!(element5 !in 1.0 .. 3.0) != range0.contains(element5)) throw AssertionError() -} - -fun testR0xE6() { - // with possible local optimizations - if (2.toFloat() in 1.0 .. 3.0 != range0.contains(2.toFloat())) throw AssertionError() - if (2.toFloat() !in 1.0 .. 3.0 != !range0.contains(2.toFloat())) throw AssertionError() - if (!(2.toFloat() in 1.0 .. 3.0) != !range0.contains(2.toFloat())) throw AssertionError() - if (!(2.toFloat() !in 1.0 .. 3.0) != range0.contains(2.toFloat())) throw AssertionError() - // no local optimizations - if (element6 in 1.0 .. 3.0 != range0.contains(element6)) throw AssertionError() - if (element6 !in 1.0 .. 3.0 != !range0.contains(element6)) throw AssertionError() - if (!(element6 in 1.0 .. 3.0) != !range0.contains(element6)) throw AssertionError() - if (!(element6 !in 1.0 .. 3.0) != range0.contains(element6)) throw AssertionError() -} - -fun testR0xE7() { - // with possible local optimizations - if (2.toDouble() in 1.0 .. 3.0 != range0.contains(2.toDouble())) throw AssertionError() - if (2.toDouble() !in 1.0 .. 3.0 != !range0.contains(2.toDouble())) throw AssertionError() - if (!(2.toDouble() in 1.0 .. 3.0) != !range0.contains(2.toDouble())) throw AssertionError() - if (!(2.toDouble() !in 1.0 .. 3.0) != range0.contains(2.toDouble())) throw AssertionError() - // no local optimizations - if (element7 in 1.0 .. 3.0 != range0.contains(element7)) throw AssertionError() - if (element7 !in 1.0 .. 3.0 != !range0.contains(element7)) throw AssertionError() - if (!(element7 in 1.0 .. 3.0) != !range0.contains(element7)) throw AssertionError() - if (!(element7 !in 1.0 .. 3.0) != range0.contains(element7)) throw AssertionError() -} - -fun testR0xE8() { - // with possible local optimizations - if (3.toFloat() in 1.0 .. 3.0 != range0.contains(3.toFloat())) throw AssertionError() - if (3.toFloat() !in 1.0 .. 3.0 != !range0.contains(3.toFloat())) throw AssertionError() - if (!(3.toFloat() in 1.0 .. 3.0) != !range0.contains(3.toFloat())) throw AssertionError() - if (!(3.toFloat() !in 1.0 .. 3.0) != range0.contains(3.toFloat())) throw AssertionError() - // no local optimizations - if (element8 in 1.0 .. 3.0 != range0.contains(element8)) throw AssertionError() - if (element8 !in 1.0 .. 3.0 != !range0.contains(element8)) throw AssertionError() - if (!(element8 in 1.0 .. 3.0) != !range0.contains(element8)) throw AssertionError() - if (!(element8 !in 1.0 .. 3.0) != range0.contains(element8)) throw AssertionError() -} - -fun testR0xE9() { - // with possible local optimizations - if (3.toDouble() in 1.0 .. 3.0 != range0.contains(3.toDouble())) throw AssertionError() - if (3.toDouble() !in 1.0 .. 3.0 != !range0.contains(3.toDouble())) throw AssertionError() - if (!(3.toDouble() in 1.0 .. 3.0) != !range0.contains(3.toDouble())) throw AssertionError() - if (!(3.toDouble() !in 1.0 .. 3.0) != range0.contains(3.toDouble())) throw AssertionError() - // no local optimizations - if (element9 in 1.0 .. 3.0 != range0.contains(element9)) throw AssertionError() - if (element9 !in 1.0 .. 3.0 != !range0.contains(element9)) throw AssertionError() - if (!(element9 in 1.0 .. 3.0) != !range0.contains(element9)) throw AssertionError() - if (!(element9 !in 1.0 .. 3.0) != range0.contains(element9)) throw AssertionError() -} - -fun testR0xE10() { - // with possible local optimizations - if (4.toFloat() in 1.0 .. 3.0 != range0.contains(4.toFloat())) throw AssertionError() - if (4.toFloat() !in 1.0 .. 3.0 != !range0.contains(4.toFloat())) throw AssertionError() - if (!(4.toFloat() in 1.0 .. 3.0) != !range0.contains(4.toFloat())) throw AssertionError() - if (!(4.toFloat() !in 1.0 .. 3.0) != range0.contains(4.toFloat())) throw AssertionError() - // no local optimizations - if (element10 in 1.0 .. 3.0 != range0.contains(element10)) throw AssertionError() - if (element10 !in 1.0 .. 3.0 != !range0.contains(element10)) throw AssertionError() - if (!(element10 in 1.0 .. 3.0) != !range0.contains(element10)) throw AssertionError() - if (!(element10 !in 1.0 .. 3.0) != range0.contains(element10)) throw AssertionError() -} - -fun testR0xE11() { - // with possible local optimizations - if (4.toDouble() in 1.0 .. 3.0 != range0.contains(4.toDouble())) throw AssertionError() - if (4.toDouble() !in 1.0 .. 3.0 != !range0.contains(4.toDouble())) throw AssertionError() - if (!(4.toDouble() in 1.0 .. 3.0) != !range0.contains(4.toDouble())) throw AssertionError() - if (!(4.toDouble() !in 1.0 .. 3.0) != range0.contains(4.toDouble())) throw AssertionError() - // no local optimizations - if (element11 in 1.0 .. 3.0 != range0.contains(element11)) throw AssertionError() - if (element11 !in 1.0 .. 3.0 != !range0.contains(element11)) throw AssertionError() - if (!(element11 in 1.0 .. 3.0) != !range0.contains(element11)) throw AssertionError() - if (!(element11 !in 1.0 .. 3.0) != range0.contains(element11)) throw AssertionError() -} - -fun testR1xE0() { - // with possible local optimizations - if ((-1).toFloat() in 3.0 .. 1.0 != range1.contains((-1).toFloat())) throw AssertionError() - if ((-1).toFloat() !in 3.0 .. 1.0 != !range1.contains((-1).toFloat())) throw AssertionError() - if (!((-1).toFloat() in 3.0 .. 1.0) != !range1.contains((-1).toFloat())) throw AssertionError() - if (!((-1).toFloat() !in 3.0 .. 1.0) != range1.contains((-1).toFloat())) throw AssertionError() - // no local optimizations - if (element0 in 3.0 .. 1.0 != range1.contains(element0)) throw AssertionError() - if (element0 !in 3.0 .. 1.0 != !range1.contains(element0)) throw AssertionError() - if (!(element0 in 3.0 .. 1.0) != !range1.contains(element0)) throw AssertionError() - if (!(element0 !in 3.0 .. 1.0) != range1.contains(element0)) throw AssertionError() -} - -fun testR1xE1() { - // with possible local optimizations - if ((-1).toDouble() in 3.0 .. 1.0 != range1.contains((-1).toDouble())) throw AssertionError() - if ((-1).toDouble() !in 3.0 .. 1.0 != !range1.contains((-1).toDouble())) throw AssertionError() - if (!((-1).toDouble() in 3.0 .. 1.0) != !range1.contains((-1).toDouble())) throw AssertionError() - if (!((-1).toDouble() !in 3.0 .. 1.0) != range1.contains((-1).toDouble())) throw AssertionError() - // no local optimizations - if (element1 in 3.0 .. 1.0 != range1.contains(element1)) throw AssertionError() - if (element1 !in 3.0 .. 1.0 != !range1.contains(element1)) throw AssertionError() - if (!(element1 in 3.0 .. 1.0) != !range1.contains(element1)) throw AssertionError() - if (!(element1 !in 3.0 .. 1.0) != range1.contains(element1)) throw AssertionError() -} - -fun testR1xE2() { - // with possible local optimizations - if (0.toFloat() in 3.0 .. 1.0 != range1.contains(0.toFloat())) throw AssertionError() - if (0.toFloat() !in 3.0 .. 1.0 != !range1.contains(0.toFloat())) throw AssertionError() - if (!(0.toFloat() in 3.0 .. 1.0) != !range1.contains(0.toFloat())) throw AssertionError() - if (!(0.toFloat() !in 3.0 .. 1.0) != range1.contains(0.toFloat())) throw AssertionError() - // no local optimizations - if (element2 in 3.0 .. 1.0 != range1.contains(element2)) throw AssertionError() - if (element2 !in 3.0 .. 1.0 != !range1.contains(element2)) throw AssertionError() - if (!(element2 in 3.0 .. 1.0) != !range1.contains(element2)) throw AssertionError() - if (!(element2 !in 3.0 .. 1.0) != range1.contains(element2)) throw AssertionError() -} - -fun testR1xE3() { - // with possible local optimizations - if (0.toDouble() in 3.0 .. 1.0 != range1.contains(0.toDouble())) throw AssertionError() - if (0.toDouble() !in 3.0 .. 1.0 != !range1.contains(0.toDouble())) throw AssertionError() - if (!(0.toDouble() in 3.0 .. 1.0) != !range1.contains(0.toDouble())) throw AssertionError() - if (!(0.toDouble() !in 3.0 .. 1.0) != range1.contains(0.toDouble())) throw AssertionError() - // no local optimizations - if (element3 in 3.0 .. 1.0 != range1.contains(element3)) throw AssertionError() - if (element3 !in 3.0 .. 1.0 != !range1.contains(element3)) throw AssertionError() - if (!(element3 in 3.0 .. 1.0) != !range1.contains(element3)) throw AssertionError() - if (!(element3 !in 3.0 .. 1.0) != range1.contains(element3)) throw AssertionError() -} - -fun testR1xE4() { - // with possible local optimizations - if (1.toFloat() in 3.0 .. 1.0 != range1.contains(1.toFloat())) throw AssertionError() - if (1.toFloat() !in 3.0 .. 1.0 != !range1.contains(1.toFloat())) throw AssertionError() - if (!(1.toFloat() in 3.0 .. 1.0) != !range1.contains(1.toFloat())) throw AssertionError() - if (!(1.toFloat() !in 3.0 .. 1.0) != range1.contains(1.toFloat())) throw AssertionError() - // no local optimizations - if (element4 in 3.0 .. 1.0 != range1.contains(element4)) throw AssertionError() - if (element4 !in 3.0 .. 1.0 != !range1.contains(element4)) throw AssertionError() - if (!(element4 in 3.0 .. 1.0) != !range1.contains(element4)) throw AssertionError() - if (!(element4 !in 3.0 .. 1.0) != range1.contains(element4)) throw AssertionError() -} - -fun testR1xE5() { - // with possible local optimizations - if (1.toDouble() in 3.0 .. 1.0 != range1.contains(1.toDouble())) throw AssertionError() - if (1.toDouble() !in 3.0 .. 1.0 != !range1.contains(1.toDouble())) throw AssertionError() - if (!(1.toDouble() in 3.0 .. 1.0) != !range1.contains(1.toDouble())) throw AssertionError() - if (!(1.toDouble() !in 3.0 .. 1.0) != range1.contains(1.toDouble())) throw AssertionError() - // no local optimizations - if (element5 in 3.0 .. 1.0 != range1.contains(element5)) throw AssertionError() - if (element5 !in 3.0 .. 1.0 != !range1.contains(element5)) throw AssertionError() - if (!(element5 in 3.0 .. 1.0) != !range1.contains(element5)) throw AssertionError() - if (!(element5 !in 3.0 .. 1.0) != range1.contains(element5)) throw AssertionError() -} - -fun testR1xE6() { - // with possible local optimizations - if (2.toFloat() in 3.0 .. 1.0 != range1.contains(2.toFloat())) throw AssertionError() - if (2.toFloat() !in 3.0 .. 1.0 != !range1.contains(2.toFloat())) throw AssertionError() - if (!(2.toFloat() in 3.0 .. 1.0) != !range1.contains(2.toFloat())) throw AssertionError() - if (!(2.toFloat() !in 3.0 .. 1.0) != range1.contains(2.toFloat())) throw AssertionError() - // no local optimizations - if (element6 in 3.0 .. 1.0 != range1.contains(element6)) throw AssertionError() - if (element6 !in 3.0 .. 1.0 != !range1.contains(element6)) throw AssertionError() - if (!(element6 in 3.0 .. 1.0) != !range1.contains(element6)) throw AssertionError() - if (!(element6 !in 3.0 .. 1.0) != range1.contains(element6)) throw AssertionError() -} - -fun testR1xE7() { - // with possible local optimizations - if (2.toDouble() in 3.0 .. 1.0 != range1.contains(2.toDouble())) throw AssertionError() - if (2.toDouble() !in 3.0 .. 1.0 != !range1.contains(2.toDouble())) throw AssertionError() - if (!(2.toDouble() in 3.0 .. 1.0) != !range1.contains(2.toDouble())) throw AssertionError() - if (!(2.toDouble() !in 3.0 .. 1.0) != range1.contains(2.toDouble())) throw AssertionError() - // no local optimizations - if (element7 in 3.0 .. 1.0 != range1.contains(element7)) throw AssertionError() - if (element7 !in 3.0 .. 1.0 != !range1.contains(element7)) throw AssertionError() - if (!(element7 in 3.0 .. 1.0) != !range1.contains(element7)) throw AssertionError() - if (!(element7 !in 3.0 .. 1.0) != range1.contains(element7)) throw AssertionError() -} - -fun testR1xE8() { - // with possible local optimizations - if (3.toFloat() in 3.0 .. 1.0 != range1.contains(3.toFloat())) throw AssertionError() - if (3.toFloat() !in 3.0 .. 1.0 != !range1.contains(3.toFloat())) throw AssertionError() - if (!(3.toFloat() in 3.0 .. 1.0) != !range1.contains(3.toFloat())) throw AssertionError() - if (!(3.toFloat() !in 3.0 .. 1.0) != range1.contains(3.toFloat())) throw AssertionError() - // no local optimizations - if (element8 in 3.0 .. 1.0 != range1.contains(element8)) throw AssertionError() - if (element8 !in 3.0 .. 1.0 != !range1.contains(element8)) throw AssertionError() - if (!(element8 in 3.0 .. 1.0) != !range1.contains(element8)) throw AssertionError() - if (!(element8 !in 3.0 .. 1.0) != range1.contains(element8)) throw AssertionError() -} - -fun testR1xE9() { - // with possible local optimizations - if (3.toDouble() in 3.0 .. 1.0 != range1.contains(3.toDouble())) throw AssertionError() - if (3.toDouble() !in 3.0 .. 1.0 != !range1.contains(3.toDouble())) throw AssertionError() - if (!(3.toDouble() in 3.0 .. 1.0) != !range1.contains(3.toDouble())) throw AssertionError() - if (!(3.toDouble() !in 3.0 .. 1.0) != range1.contains(3.toDouble())) throw AssertionError() - // no local optimizations - if (element9 in 3.0 .. 1.0 != range1.contains(element9)) throw AssertionError() - if (element9 !in 3.0 .. 1.0 != !range1.contains(element9)) throw AssertionError() - if (!(element9 in 3.0 .. 1.0) != !range1.contains(element9)) throw AssertionError() - if (!(element9 !in 3.0 .. 1.0) != range1.contains(element9)) throw AssertionError() -} - -fun testR1xE10() { - // with possible local optimizations - if (4.toFloat() in 3.0 .. 1.0 != range1.contains(4.toFloat())) throw AssertionError() - if (4.toFloat() !in 3.0 .. 1.0 != !range1.contains(4.toFloat())) throw AssertionError() - if (!(4.toFloat() in 3.0 .. 1.0) != !range1.contains(4.toFloat())) throw AssertionError() - if (!(4.toFloat() !in 3.0 .. 1.0) != range1.contains(4.toFloat())) throw AssertionError() - // no local optimizations - if (element10 in 3.0 .. 1.0 != range1.contains(element10)) throw AssertionError() - if (element10 !in 3.0 .. 1.0 != !range1.contains(element10)) throw AssertionError() - if (!(element10 in 3.0 .. 1.0) != !range1.contains(element10)) throw AssertionError() - if (!(element10 !in 3.0 .. 1.0) != range1.contains(element10)) throw AssertionError() -} - -fun testR1xE11() { - // with possible local optimizations - if (4.toDouble() in 3.0 .. 1.0 != range1.contains(4.toDouble())) throw AssertionError() - if (4.toDouble() !in 3.0 .. 1.0 != !range1.contains(4.toDouble())) throw AssertionError() - if (!(4.toDouble() in 3.0 .. 1.0) != !range1.contains(4.toDouble())) throw AssertionError() - if (!(4.toDouble() !in 3.0 .. 1.0) != range1.contains(4.toDouble())) throw AssertionError() - // no local optimizations - if (element11 in 3.0 .. 1.0 != range1.contains(element11)) throw AssertionError() - if (element11 !in 3.0 .. 1.0 != !range1.contains(element11)) throw AssertionError() - if (!(element11 in 3.0 .. 1.0) != !range1.contains(element11)) throw AssertionError() - if (!(element11 !in 3.0 .. 1.0) != range1.contains(element11)) throw AssertionError() -} - - diff --git a/compiler/testData/codegen/box/ranges/contains/generated/doubleRangeTo.kt b/compiler/testData/codegen/box/ranges/contains/generated/doubleRangeTo.kt new file mode 100644 index 00000000000..d89c6e634c7 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/contains/generated/doubleRangeTo.kt @@ -0,0 +1,362 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_STDLIB + + + +val range0 = 1.0..3.0 +val range1 = 3.0..1.0 + +val element0 = -1F +val element1 = -1.0 +val element2 = 0F +val element3 = 0.0 +val element4 = 1F +val element5 = 1.0 +val element6 = 2F +val element7 = 2.0 +val element8 = 3F +val element9 = 3.0 +val element10 = 4F +val element11 = 4.0 + +fun box(): String { + testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR0xE5() + testR0xE6() + testR0xE7() + testR0xE8() + testR0xE9() + testR0xE10() + testR0xE11() + testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + testR1xE5() + testR1xE6() + testR1xE7() + testR1xE8() + testR1xE9() + testR1xE10() + testR1xE11() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if (-1F in 1.0..3.0 != range0.contains(-1F)) throw AssertionError() + if (-1F !in 1.0..3.0 != !range0.contains(-1F)) throw AssertionError() + if (!(-1F in 1.0..3.0) != !range0.contains(-1F)) throw AssertionError() + if (!(-1F !in 1.0..3.0) != range0.contains(-1F)) throw AssertionError() + // no local optimizations + if (element0 in 1.0..3.0 != range0.contains(element0)) throw AssertionError() + if (element0 !in 1.0..3.0 != !range0.contains(element0)) throw AssertionError() + if (!(element0 in 1.0..3.0) != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in 1.0..3.0) != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if (-1.0 in 1.0..3.0 != range0.contains(-1.0)) throw AssertionError() + if (-1.0 !in 1.0..3.0 != !range0.contains(-1.0)) throw AssertionError() + if (!(-1.0 in 1.0..3.0) != !range0.contains(-1.0)) throw AssertionError() + if (!(-1.0 !in 1.0..3.0) != range0.contains(-1.0)) throw AssertionError() + // no local optimizations + if (element1 in 1.0..3.0 != range0.contains(element1)) throw AssertionError() + if (element1 !in 1.0..3.0 != !range0.contains(element1)) throw AssertionError() + if (!(element1 in 1.0..3.0) != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in 1.0..3.0) != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if (0F in 1.0..3.0 != range0.contains(0F)) throw AssertionError() + if (0F !in 1.0..3.0 != !range0.contains(0F)) throw AssertionError() + if (!(0F in 1.0..3.0) != !range0.contains(0F)) throw AssertionError() + if (!(0F !in 1.0..3.0) != range0.contains(0F)) throw AssertionError() + // no local optimizations + if (element2 in 1.0..3.0 != range0.contains(element2)) throw AssertionError() + if (element2 !in 1.0..3.0 != !range0.contains(element2)) throw AssertionError() + if (!(element2 in 1.0..3.0) != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in 1.0..3.0) != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if (0.0 in 1.0..3.0 != range0.contains(0.0)) throw AssertionError() + if (0.0 !in 1.0..3.0 != !range0.contains(0.0)) throw AssertionError() + if (!(0.0 in 1.0..3.0) != !range0.contains(0.0)) throw AssertionError() + if (!(0.0 !in 1.0..3.0) != range0.contains(0.0)) throw AssertionError() + // no local optimizations + if (element3 in 1.0..3.0 != range0.contains(element3)) throw AssertionError() + if (element3 !in 1.0..3.0 != !range0.contains(element3)) throw AssertionError() + if (!(element3 in 1.0..3.0) != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in 1.0..3.0) != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if (1F in 1.0..3.0 != range0.contains(1F)) throw AssertionError() + if (1F !in 1.0..3.0 != !range0.contains(1F)) throw AssertionError() + if (!(1F in 1.0..3.0) != !range0.contains(1F)) throw AssertionError() + if (!(1F !in 1.0..3.0) != range0.contains(1F)) throw AssertionError() + // no local optimizations + if (element4 in 1.0..3.0 != range0.contains(element4)) throw AssertionError() + if (element4 !in 1.0..3.0 != !range0.contains(element4)) throw AssertionError() + if (!(element4 in 1.0..3.0) != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in 1.0..3.0) != range0.contains(element4)) throw AssertionError() +} + +fun testR0xE5() { + // with possible local optimizations + if (1.0 in 1.0..3.0 != range0.contains(1.0)) throw AssertionError() + if (1.0 !in 1.0..3.0 != !range0.contains(1.0)) throw AssertionError() + if (!(1.0 in 1.0..3.0) != !range0.contains(1.0)) throw AssertionError() + if (!(1.0 !in 1.0..3.0) != range0.contains(1.0)) throw AssertionError() + // no local optimizations + if (element5 in 1.0..3.0 != range0.contains(element5)) throw AssertionError() + if (element5 !in 1.0..3.0 != !range0.contains(element5)) throw AssertionError() + if (!(element5 in 1.0..3.0) != !range0.contains(element5)) throw AssertionError() + if (!(element5 !in 1.0..3.0) != range0.contains(element5)) throw AssertionError() +} + +fun testR0xE6() { + // with possible local optimizations + if (2F in 1.0..3.0 != range0.contains(2F)) throw AssertionError() + if (2F !in 1.0..3.0 != !range0.contains(2F)) throw AssertionError() + if (!(2F in 1.0..3.0) != !range0.contains(2F)) throw AssertionError() + if (!(2F !in 1.0..3.0) != range0.contains(2F)) throw AssertionError() + // no local optimizations + if (element6 in 1.0..3.0 != range0.contains(element6)) throw AssertionError() + if (element6 !in 1.0..3.0 != !range0.contains(element6)) throw AssertionError() + if (!(element6 in 1.0..3.0) != !range0.contains(element6)) throw AssertionError() + if (!(element6 !in 1.0..3.0) != range0.contains(element6)) throw AssertionError() +} + +fun testR0xE7() { + // with possible local optimizations + if (2.0 in 1.0..3.0 != range0.contains(2.0)) throw AssertionError() + if (2.0 !in 1.0..3.0 != !range0.contains(2.0)) throw AssertionError() + if (!(2.0 in 1.0..3.0) != !range0.contains(2.0)) throw AssertionError() + if (!(2.0 !in 1.0..3.0) != range0.contains(2.0)) throw AssertionError() + // no local optimizations + if (element7 in 1.0..3.0 != range0.contains(element7)) throw AssertionError() + if (element7 !in 1.0..3.0 != !range0.contains(element7)) throw AssertionError() + if (!(element7 in 1.0..3.0) != !range0.contains(element7)) throw AssertionError() + if (!(element7 !in 1.0..3.0) != range0.contains(element7)) throw AssertionError() +} + +fun testR0xE8() { + // with possible local optimizations + if (3F in 1.0..3.0 != range0.contains(3F)) throw AssertionError() + if (3F !in 1.0..3.0 != !range0.contains(3F)) throw AssertionError() + if (!(3F in 1.0..3.0) != !range0.contains(3F)) throw AssertionError() + if (!(3F !in 1.0..3.0) != range0.contains(3F)) throw AssertionError() + // no local optimizations + if (element8 in 1.0..3.0 != range0.contains(element8)) throw AssertionError() + if (element8 !in 1.0..3.0 != !range0.contains(element8)) throw AssertionError() + if (!(element8 in 1.0..3.0) != !range0.contains(element8)) throw AssertionError() + if (!(element8 !in 1.0..3.0) != range0.contains(element8)) throw AssertionError() +} + +fun testR0xE9() { + // with possible local optimizations + if (3.0 in 1.0..3.0 != range0.contains(3.0)) throw AssertionError() + if (3.0 !in 1.0..3.0 != !range0.contains(3.0)) throw AssertionError() + if (!(3.0 in 1.0..3.0) != !range0.contains(3.0)) throw AssertionError() + if (!(3.0 !in 1.0..3.0) != range0.contains(3.0)) throw AssertionError() + // no local optimizations + if (element9 in 1.0..3.0 != range0.contains(element9)) throw AssertionError() + if (element9 !in 1.0..3.0 != !range0.contains(element9)) throw AssertionError() + if (!(element9 in 1.0..3.0) != !range0.contains(element9)) throw AssertionError() + if (!(element9 !in 1.0..3.0) != range0.contains(element9)) throw AssertionError() +} + +fun testR0xE10() { + // with possible local optimizations + if (4F in 1.0..3.0 != range0.contains(4F)) throw AssertionError() + if (4F !in 1.0..3.0 != !range0.contains(4F)) throw AssertionError() + if (!(4F in 1.0..3.0) != !range0.contains(4F)) throw AssertionError() + if (!(4F !in 1.0..3.0) != range0.contains(4F)) throw AssertionError() + // no local optimizations + if (element10 in 1.0..3.0 != range0.contains(element10)) throw AssertionError() + if (element10 !in 1.0..3.0 != !range0.contains(element10)) throw AssertionError() + if (!(element10 in 1.0..3.0) != !range0.contains(element10)) throw AssertionError() + if (!(element10 !in 1.0..3.0) != range0.contains(element10)) throw AssertionError() +} + +fun testR0xE11() { + // with possible local optimizations + if (4.0 in 1.0..3.0 != range0.contains(4.0)) throw AssertionError() + if (4.0 !in 1.0..3.0 != !range0.contains(4.0)) throw AssertionError() + if (!(4.0 in 1.0..3.0) != !range0.contains(4.0)) throw AssertionError() + if (!(4.0 !in 1.0..3.0) != range0.contains(4.0)) throw AssertionError() + // no local optimizations + if (element11 in 1.0..3.0 != range0.contains(element11)) throw AssertionError() + if (element11 !in 1.0..3.0 != !range0.contains(element11)) throw AssertionError() + if (!(element11 in 1.0..3.0) != !range0.contains(element11)) throw AssertionError() + if (!(element11 !in 1.0..3.0) != range0.contains(element11)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if (-1F in 3.0..1.0 != range1.contains(-1F)) throw AssertionError() + if (-1F !in 3.0..1.0 != !range1.contains(-1F)) throw AssertionError() + if (!(-1F in 3.0..1.0) != !range1.contains(-1F)) throw AssertionError() + if (!(-1F !in 3.0..1.0) != range1.contains(-1F)) throw AssertionError() + // no local optimizations + if (element0 in 3.0..1.0 != range1.contains(element0)) throw AssertionError() + if (element0 !in 3.0..1.0 != !range1.contains(element0)) throw AssertionError() + if (!(element0 in 3.0..1.0) != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in 3.0..1.0) != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if (-1.0 in 3.0..1.0 != range1.contains(-1.0)) throw AssertionError() + if (-1.0 !in 3.0..1.0 != !range1.contains(-1.0)) throw AssertionError() + if (!(-1.0 in 3.0..1.0) != !range1.contains(-1.0)) throw AssertionError() + if (!(-1.0 !in 3.0..1.0) != range1.contains(-1.0)) throw AssertionError() + // no local optimizations + if (element1 in 3.0..1.0 != range1.contains(element1)) throw AssertionError() + if (element1 !in 3.0..1.0 != !range1.contains(element1)) throw AssertionError() + if (!(element1 in 3.0..1.0) != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in 3.0..1.0) != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if (0F in 3.0..1.0 != range1.contains(0F)) throw AssertionError() + if (0F !in 3.0..1.0 != !range1.contains(0F)) throw AssertionError() + if (!(0F in 3.0..1.0) != !range1.contains(0F)) throw AssertionError() + if (!(0F !in 3.0..1.0) != range1.contains(0F)) throw AssertionError() + // no local optimizations + if (element2 in 3.0..1.0 != range1.contains(element2)) throw AssertionError() + if (element2 !in 3.0..1.0 != !range1.contains(element2)) throw AssertionError() + if (!(element2 in 3.0..1.0) != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in 3.0..1.0) != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if (0.0 in 3.0..1.0 != range1.contains(0.0)) throw AssertionError() + if (0.0 !in 3.0..1.0 != !range1.contains(0.0)) throw AssertionError() + if (!(0.0 in 3.0..1.0) != !range1.contains(0.0)) throw AssertionError() + if (!(0.0 !in 3.0..1.0) != range1.contains(0.0)) throw AssertionError() + // no local optimizations + if (element3 in 3.0..1.0 != range1.contains(element3)) throw AssertionError() + if (element3 !in 3.0..1.0 != !range1.contains(element3)) throw AssertionError() + if (!(element3 in 3.0..1.0) != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in 3.0..1.0) != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if (1F in 3.0..1.0 != range1.contains(1F)) throw AssertionError() + if (1F !in 3.0..1.0 != !range1.contains(1F)) throw AssertionError() + if (!(1F in 3.0..1.0) != !range1.contains(1F)) throw AssertionError() + if (!(1F !in 3.0..1.0) != range1.contains(1F)) throw AssertionError() + // no local optimizations + if (element4 in 3.0..1.0 != range1.contains(element4)) throw AssertionError() + if (element4 !in 3.0..1.0 != !range1.contains(element4)) throw AssertionError() + if (!(element4 in 3.0..1.0) != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in 3.0..1.0) != range1.contains(element4)) throw AssertionError() +} + +fun testR1xE5() { + // with possible local optimizations + if (1.0 in 3.0..1.0 != range1.contains(1.0)) throw AssertionError() + if (1.0 !in 3.0..1.0 != !range1.contains(1.0)) throw AssertionError() + if (!(1.0 in 3.0..1.0) != !range1.contains(1.0)) throw AssertionError() + if (!(1.0 !in 3.0..1.0) != range1.contains(1.0)) throw AssertionError() + // no local optimizations + if (element5 in 3.0..1.0 != range1.contains(element5)) throw AssertionError() + if (element5 !in 3.0..1.0 != !range1.contains(element5)) throw AssertionError() + if (!(element5 in 3.0..1.0) != !range1.contains(element5)) throw AssertionError() + if (!(element5 !in 3.0..1.0) != range1.contains(element5)) throw AssertionError() +} + +fun testR1xE6() { + // with possible local optimizations + if (2F in 3.0..1.0 != range1.contains(2F)) throw AssertionError() + if (2F !in 3.0..1.0 != !range1.contains(2F)) throw AssertionError() + if (!(2F in 3.0..1.0) != !range1.contains(2F)) throw AssertionError() + if (!(2F !in 3.0..1.0) != range1.contains(2F)) throw AssertionError() + // no local optimizations + if (element6 in 3.0..1.0 != range1.contains(element6)) throw AssertionError() + if (element6 !in 3.0..1.0 != !range1.contains(element6)) throw AssertionError() + if (!(element6 in 3.0..1.0) != !range1.contains(element6)) throw AssertionError() + if (!(element6 !in 3.0..1.0) != range1.contains(element6)) throw AssertionError() +} + +fun testR1xE7() { + // with possible local optimizations + if (2.0 in 3.0..1.0 != range1.contains(2.0)) throw AssertionError() + if (2.0 !in 3.0..1.0 != !range1.contains(2.0)) throw AssertionError() + if (!(2.0 in 3.0..1.0) != !range1.contains(2.0)) throw AssertionError() + if (!(2.0 !in 3.0..1.0) != range1.contains(2.0)) throw AssertionError() + // no local optimizations + if (element7 in 3.0..1.0 != range1.contains(element7)) throw AssertionError() + if (element7 !in 3.0..1.0 != !range1.contains(element7)) throw AssertionError() + if (!(element7 in 3.0..1.0) != !range1.contains(element7)) throw AssertionError() + if (!(element7 !in 3.0..1.0) != range1.contains(element7)) throw AssertionError() +} + +fun testR1xE8() { + // with possible local optimizations + if (3F in 3.0..1.0 != range1.contains(3F)) throw AssertionError() + if (3F !in 3.0..1.0 != !range1.contains(3F)) throw AssertionError() + if (!(3F in 3.0..1.0) != !range1.contains(3F)) throw AssertionError() + if (!(3F !in 3.0..1.0) != range1.contains(3F)) throw AssertionError() + // no local optimizations + if (element8 in 3.0..1.0 != range1.contains(element8)) throw AssertionError() + if (element8 !in 3.0..1.0 != !range1.contains(element8)) throw AssertionError() + if (!(element8 in 3.0..1.0) != !range1.contains(element8)) throw AssertionError() + if (!(element8 !in 3.0..1.0) != range1.contains(element8)) throw AssertionError() +} + +fun testR1xE9() { + // with possible local optimizations + if (3.0 in 3.0..1.0 != range1.contains(3.0)) throw AssertionError() + if (3.0 !in 3.0..1.0 != !range1.contains(3.0)) throw AssertionError() + if (!(3.0 in 3.0..1.0) != !range1.contains(3.0)) throw AssertionError() + if (!(3.0 !in 3.0..1.0) != range1.contains(3.0)) throw AssertionError() + // no local optimizations + if (element9 in 3.0..1.0 != range1.contains(element9)) throw AssertionError() + if (element9 !in 3.0..1.0 != !range1.contains(element9)) throw AssertionError() + if (!(element9 in 3.0..1.0) != !range1.contains(element9)) throw AssertionError() + if (!(element9 !in 3.0..1.0) != range1.contains(element9)) throw AssertionError() +} + +fun testR1xE10() { + // with possible local optimizations + if (4F in 3.0..1.0 != range1.contains(4F)) throw AssertionError() + if (4F !in 3.0..1.0 != !range1.contains(4F)) throw AssertionError() + if (!(4F in 3.0..1.0) != !range1.contains(4F)) throw AssertionError() + if (!(4F !in 3.0..1.0) != range1.contains(4F)) throw AssertionError() + // no local optimizations + if (element10 in 3.0..1.0 != range1.contains(element10)) throw AssertionError() + if (element10 !in 3.0..1.0 != !range1.contains(element10)) throw AssertionError() + if (!(element10 in 3.0..1.0) != !range1.contains(element10)) throw AssertionError() + if (!(element10 !in 3.0..1.0) != range1.contains(element10)) throw AssertionError() +} + +fun testR1xE11() { + // with possible local optimizations + if (4.0 in 3.0..1.0 != range1.contains(4.0)) throw AssertionError() + if (4.0 !in 3.0..1.0 != !range1.contains(4.0)) throw AssertionError() + if (!(4.0 in 3.0..1.0) != !range1.contains(4.0)) throw AssertionError() + if (!(4.0 !in 3.0..1.0) != range1.contains(4.0)) throw AssertionError() + // no local optimizations + if (element11 in 3.0..1.0 != range1.contains(element11)) throw AssertionError() + if (element11 !in 3.0..1.0 != !range1.contains(element11)) throw AssertionError() + if (!(element11 in 3.0..1.0) != !range1.contains(element11)) throw AssertionError() + if (!(element11 !in 3.0..1.0) != range1.contains(element11)) throw AssertionError() +} + + diff --git a/compiler/testData/codegen/box/ranges/contains/generated/doubleRangeUntil.kt b/compiler/testData/codegen/box/ranges/contains/generated/doubleRangeUntil.kt new file mode 100644 index 00000000000..3acdbb8bf48 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/contains/generated/doubleRangeUntil.kt @@ -0,0 +1,365 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_STDLIB +// DONT_TARGET_EXACT_BACKEND: JVM +// !LANGUAGE: +RangeUntilOperator +@file:OptIn(ExperimentalStdlibApi::class) + + + +val range0 = 1.0..<3.0 +val range1 = 3.0..<1.0 + +val element0 = -1F +val element1 = -1.0 +val element2 = 0F +val element3 = 0.0 +val element4 = 1F +val element5 = 1.0 +val element6 = 2F +val element7 = 2.0 +val element8 = 3F +val element9 = 3.0 +val element10 = 4F +val element11 = 4.0 + +fun box(): String { + testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR0xE5() + testR0xE6() + testR0xE7() + testR0xE8() + testR0xE9() + testR0xE10() + testR0xE11() + testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + testR1xE5() + testR1xE6() + testR1xE7() + testR1xE8() + testR1xE9() + testR1xE10() + testR1xE11() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if (-1F in 1.0..<3.0 != range0.contains(-1F)) throw AssertionError() + if (-1F !in 1.0..<3.0 != !range0.contains(-1F)) throw AssertionError() + if (!(-1F in 1.0..<3.0) != !range0.contains(-1F)) throw AssertionError() + if (!(-1F !in 1.0..<3.0) != range0.contains(-1F)) throw AssertionError() + // no local optimizations + if (element0 in 1.0..<3.0 != range0.contains(element0)) throw AssertionError() + if (element0 !in 1.0..<3.0 != !range0.contains(element0)) throw AssertionError() + if (!(element0 in 1.0..<3.0) != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in 1.0..<3.0) != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if (-1.0 in 1.0..<3.0 != range0.contains(-1.0)) throw AssertionError() + if (-1.0 !in 1.0..<3.0 != !range0.contains(-1.0)) throw AssertionError() + if (!(-1.0 in 1.0..<3.0) != !range0.contains(-1.0)) throw AssertionError() + if (!(-1.0 !in 1.0..<3.0) != range0.contains(-1.0)) throw AssertionError() + // no local optimizations + if (element1 in 1.0..<3.0 != range0.contains(element1)) throw AssertionError() + if (element1 !in 1.0..<3.0 != !range0.contains(element1)) throw AssertionError() + if (!(element1 in 1.0..<3.0) != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in 1.0..<3.0) != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if (0F in 1.0..<3.0 != range0.contains(0F)) throw AssertionError() + if (0F !in 1.0..<3.0 != !range0.contains(0F)) throw AssertionError() + if (!(0F in 1.0..<3.0) != !range0.contains(0F)) throw AssertionError() + if (!(0F !in 1.0..<3.0) != range0.contains(0F)) throw AssertionError() + // no local optimizations + if (element2 in 1.0..<3.0 != range0.contains(element2)) throw AssertionError() + if (element2 !in 1.0..<3.0 != !range0.contains(element2)) throw AssertionError() + if (!(element2 in 1.0..<3.0) != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in 1.0..<3.0) != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if (0.0 in 1.0..<3.0 != range0.contains(0.0)) throw AssertionError() + if (0.0 !in 1.0..<3.0 != !range0.contains(0.0)) throw AssertionError() + if (!(0.0 in 1.0..<3.0) != !range0.contains(0.0)) throw AssertionError() + if (!(0.0 !in 1.0..<3.0) != range0.contains(0.0)) throw AssertionError() + // no local optimizations + if (element3 in 1.0..<3.0 != range0.contains(element3)) throw AssertionError() + if (element3 !in 1.0..<3.0 != !range0.contains(element3)) throw AssertionError() + if (!(element3 in 1.0..<3.0) != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in 1.0..<3.0) != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if (1F in 1.0..<3.0 != range0.contains(1F)) throw AssertionError() + if (1F !in 1.0..<3.0 != !range0.contains(1F)) throw AssertionError() + if (!(1F in 1.0..<3.0) != !range0.contains(1F)) throw AssertionError() + if (!(1F !in 1.0..<3.0) != range0.contains(1F)) throw AssertionError() + // no local optimizations + if (element4 in 1.0..<3.0 != range0.contains(element4)) throw AssertionError() + if (element4 !in 1.0..<3.0 != !range0.contains(element4)) throw AssertionError() + if (!(element4 in 1.0..<3.0) != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in 1.0..<3.0) != range0.contains(element4)) throw AssertionError() +} + +fun testR0xE5() { + // with possible local optimizations + if (1.0 in 1.0..<3.0 != range0.contains(1.0)) throw AssertionError() + if (1.0 !in 1.0..<3.0 != !range0.contains(1.0)) throw AssertionError() + if (!(1.0 in 1.0..<3.0) != !range0.contains(1.0)) throw AssertionError() + if (!(1.0 !in 1.0..<3.0) != range0.contains(1.0)) throw AssertionError() + // no local optimizations + if (element5 in 1.0..<3.0 != range0.contains(element5)) throw AssertionError() + if (element5 !in 1.0..<3.0 != !range0.contains(element5)) throw AssertionError() + if (!(element5 in 1.0..<3.0) != !range0.contains(element5)) throw AssertionError() + if (!(element5 !in 1.0..<3.0) != range0.contains(element5)) throw AssertionError() +} + +fun testR0xE6() { + // with possible local optimizations + if (2F in 1.0..<3.0 != range0.contains(2F)) throw AssertionError() + if (2F !in 1.0..<3.0 != !range0.contains(2F)) throw AssertionError() + if (!(2F in 1.0..<3.0) != !range0.contains(2F)) throw AssertionError() + if (!(2F !in 1.0..<3.0) != range0.contains(2F)) throw AssertionError() + // no local optimizations + if (element6 in 1.0..<3.0 != range0.contains(element6)) throw AssertionError() + if (element6 !in 1.0..<3.0 != !range0.contains(element6)) throw AssertionError() + if (!(element6 in 1.0..<3.0) != !range0.contains(element6)) throw AssertionError() + if (!(element6 !in 1.0..<3.0) != range0.contains(element6)) throw AssertionError() +} + +fun testR0xE7() { + // with possible local optimizations + if (2.0 in 1.0..<3.0 != range0.contains(2.0)) throw AssertionError() + if (2.0 !in 1.0..<3.0 != !range0.contains(2.0)) throw AssertionError() + if (!(2.0 in 1.0..<3.0) != !range0.contains(2.0)) throw AssertionError() + if (!(2.0 !in 1.0..<3.0) != range0.contains(2.0)) throw AssertionError() + // no local optimizations + if (element7 in 1.0..<3.0 != range0.contains(element7)) throw AssertionError() + if (element7 !in 1.0..<3.0 != !range0.contains(element7)) throw AssertionError() + if (!(element7 in 1.0..<3.0) != !range0.contains(element7)) throw AssertionError() + if (!(element7 !in 1.0..<3.0) != range0.contains(element7)) throw AssertionError() +} + +fun testR0xE8() { + // with possible local optimizations + if (3F in 1.0..<3.0 != range0.contains(3F)) throw AssertionError() + if (3F !in 1.0..<3.0 != !range0.contains(3F)) throw AssertionError() + if (!(3F in 1.0..<3.0) != !range0.contains(3F)) throw AssertionError() + if (!(3F !in 1.0..<3.0) != range0.contains(3F)) throw AssertionError() + // no local optimizations + if (element8 in 1.0..<3.0 != range0.contains(element8)) throw AssertionError() + if (element8 !in 1.0..<3.0 != !range0.contains(element8)) throw AssertionError() + if (!(element8 in 1.0..<3.0) != !range0.contains(element8)) throw AssertionError() + if (!(element8 !in 1.0..<3.0) != range0.contains(element8)) throw AssertionError() +} + +fun testR0xE9() { + // with possible local optimizations + if (3.0 in 1.0..<3.0 != range0.contains(3.0)) throw AssertionError() + if (3.0 !in 1.0..<3.0 != !range0.contains(3.0)) throw AssertionError() + if (!(3.0 in 1.0..<3.0) != !range0.contains(3.0)) throw AssertionError() + if (!(3.0 !in 1.0..<3.0) != range0.contains(3.0)) throw AssertionError() + // no local optimizations + if (element9 in 1.0..<3.0 != range0.contains(element9)) throw AssertionError() + if (element9 !in 1.0..<3.0 != !range0.contains(element9)) throw AssertionError() + if (!(element9 in 1.0..<3.0) != !range0.contains(element9)) throw AssertionError() + if (!(element9 !in 1.0..<3.0) != range0.contains(element9)) throw AssertionError() +} + +fun testR0xE10() { + // with possible local optimizations + if (4F in 1.0..<3.0 != range0.contains(4F)) throw AssertionError() + if (4F !in 1.0..<3.0 != !range0.contains(4F)) throw AssertionError() + if (!(4F in 1.0..<3.0) != !range0.contains(4F)) throw AssertionError() + if (!(4F !in 1.0..<3.0) != range0.contains(4F)) throw AssertionError() + // no local optimizations + if (element10 in 1.0..<3.0 != range0.contains(element10)) throw AssertionError() + if (element10 !in 1.0..<3.0 != !range0.contains(element10)) throw AssertionError() + if (!(element10 in 1.0..<3.0) != !range0.contains(element10)) throw AssertionError() + if (!(element10 !in 1.0..<3.0) != range0.contains(element10)) throw AssertionError() +} + +fun testR0xE11() { + // with possible local optimizations + if (4.0 in 1.0..<3.0 != range0.contains(4.0)) throw AssertionError() + if (4.0 !in 1.0..<3.0 != !range0.contains(4.0)) throw AssertionError() + if (!(4.0 in 1.0..<3.0) != !range0.contains(4.0)) throw AssertionError() + if (!(4.0 !in 1.0..<3.0) != range0.contains(4.0)) throw AssertionError() + // no local optimizations + if (element11 in 1.0..<3.0 != range0.contains(element11)) throw AssertionError() + if (element11 !in 1.0..<3.0 != !range0.contains(element11)) throw AssertionError() + if (!(element11 in 1.0..<3.0) != !range0.contains(element11)) throw AssertionError() + if (!(element11 !in 1.0..<3.0) != range0.contains(element11)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if (-1F in 3.0..<1.0 != range1.contains(-1F)) throw AssertionError() + if (-1F !in 3.0..<1.0 != !range1.contains(-1F)) throw AssertionError() + if (!(-1F in 3.0..<1.0) != !range1.contains(-1F)) throw AssertionError() + if (!(-1F !in 3.0..<1.0) != range1.contains(-1F)) throw AssertionError() + // no local optimizations + if (element0 in 3.0..<1.0 != range1.contains(element0)) throw AssertionError() + if (element0 !in 3.0..<1.0 != !range1.contains(element0)) throw AssertionError() + if (!(element0 in 3.0..<1.0) != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in 3.0..<1.0) != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if (-1.0 in 3.0..<1.0 != range1.contains(-1.0)) throw AssertionError() + if (-1.0 !in 3.0..<1.0 != !range1.contains(-1.0)) throw AssertionError() + if (!(-1.0 in 3.0..<1.0) != !range1.contains(-1.0)) throw AssertionError() + if (!(-1.0 !in 3.0..<1.0) != range1.contains(-1.0)) throw AssertionError() + // no local optimizations + if (element1 in 3.0..<1.0 != range1.contains(element1)) throw AssertionError() + if (element1 !in 3.0..<1.0 != !range1.contains(element1)) throw AssertionError() + if (!(element1 in 3.0..<1.0) != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in 3.0..<1.0) != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if (0F in 3.0..<1.0 != range1.contains(0F)) throw AssertionError() + if (0F !in 3.0..<1.0 != !range1.contains(0F)) throw AssertionError() + if (!(0F in 3.0..<1.0) != !range1.contains(0F)) throw AssertionError() + if (!(0F !in 3.0..<1.0) != range1.contains(0F)) throw AssertionError() + // no local optimizations + if (element2 in 3.0..<1.0 != range1.contains(element2)) throw AssertionError() + if (element2 !in 3.0..<1.0 != !range1.contains(element2)) throw AssertionError() + if (!(element2 in 3.0..<1.0) != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in 3.0..<1.0) != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if (0.0 in 3.0..<1.0 != range1.contains(0.0)) throw AssertionError() + if (0.0 !in 3.0..<1.0 != !range1.contains(0.0)) throw AssertionError() + if (!(0.0 in 3.0..<1.0) != !range1.contains(0.0)) throw AssertionError() + if (!(0.0 !in 3.0..<1.0) != range1.contains(0.0)) throw AssertionError() + // no local optimizations + if (element3 in 3.0..<1.0 != range1.contains(element3)) throw AssertionError() + if (element3 !in 3.0..<1.0 != !range1.contains(element3)) throw AssertionError() + if (!(element3 in 3.0..<1.0) != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in 3.0..<1.0) != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if (1F in 3.0..<1.0 != range1.contains(1F)) throw AssertionError() + if (1F !in 3.0..<1.0 != !range1.contains(1F)) throw AssertionError() + if (!(1F in 3.0..<1.0) != !range1.contains(1F)) throw AssertionError() + if (!(1F !in 3.0..<1.0) != range1.contains(1F)) throw AssertionError() + // no local optimizations + if (element4 in 3.0..<1.0 != range1.contains(element4)) throw AssertionError() + if (element4 !in 3.0..<1.0 != !range1.contains(element4)) throw AssertionError() + if (!(element4 in 3.0..<1.0) != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in 3.0..<1.0) != range1.contains(element4)) throw AssertionError() +} + +fun testR1xE5() { + // with possible local optimizations + if (1.0 in 3.0..<1.0 != range1.contains(1.0)) throw AssertionError() + if (1.0 !in 3.0..<1.0 != !range1.contains(1.0)) throw AssertionError() + if (!(1.0 in 3.0..<1.0) != !range1.contains(1.0)) throw AssertionError() + if (!(1.0 !in 3.0..<1.0) != range1.contains(1.0)) throw AssertionError() + // no local optimizations + if (element5 in 3.0..<1.0 != range1.contains(element5)) throw AssertionError() + if (element5 !in 3.0..<1.0 != !range1.contains(element5)) throw AssertionError() + if (!(element5 in 3.0..<1.0) != !range1.contains(element5)) throw AssertionError() + if (!(element5 !in 3.0..<1.0) != range1.contains(element5)) throw AssertionError() +} + +fun testR1xE6() { + // with possible local optimizations + if (2F in 3.0..<1.0 != range1.contains(2F)) throw AssertionError() + if (2F !in 3.0..<1.0 != !range1.contains(2F)) throw AssertionError() + if (!(2F in 3.0..<1.0) != !range1.contains(2F)) throw AssertionError() + if (!(2F !in 3.0..<1.0) != range1.contains(2F)) throw AssertionError() + // no local optimizations + if (element6 in 3.0..<1.0 != range1.contains(element6)) throw AssertionError() + if (element6 !in 3.0..<1.0 != !range1.contains(element6)) throw AssertionError() + if (!(element6 in 3.0..<1.0) != !range1.contains(element6)) throw AssertionError() + if (!(element6 !in 3.0..<1.0) != range1.contains(element6)) throw AssertionError() +} + +fun testR1xE7() { + // with possible local optimizations + if (2.0 in 3.0..<1.0 != range1.contains(2.0)) throw AssertionError() + if (2.0 !in 3.0..<1.0 != !range1.contains(2.0)) throw AssertionError() + if (!(2.0 in 3.0..<1.0) != !range1.contains(2.0)) throw AssertionError() + if (!(2.0 !in 3.0..<1.0) != range1.contains(2.0)) throw AssertionError() + // no local optimizations + if (element7 in 3.0..<1.0 != range1.contains(element7)) throw AssertionError() + if (element7 !in 3.0..<1.0 != !range1.contains(element7)) throw AssertionError() + if (!(element7 in 3.0..<1.0) != !range1.contains(element7)) throw AssertionError() + if (!(element7 !in 3.0..<1.0) != range1.contains(element7)) throw AssertionError() +} + +fun testR1xE8() { + // with possible local optimizations + if (3F in 3.0..<1.0 != range1.contains(3F)) throw AssertionError() + if (3F !in 3.0..<1.0 != !range1.contains(3F)) throw AssertionError() + if (!(3F in 3.0..<1.0) != !range1.contains(3F)) throw AssertionError() + if (!(3F !in 3.0..<1.0) != range1.contains(3F)) throw AssertionError() + // no local optimizations + if (element8 in 3.0..<1.0 != range1.contains(element8)) throw AssertionError() + if (element8 !in 3.0..<1.0 != !range1.contains(element8)) throw AssertionError() + if (!(element8 in 3.0..<1.0) != !range1.contains(element8)) throw AssertionError() + if (!(element8 !in 3.0..<1.0) != range1.contains(element8)) throw AssertionError() +} + +fun testR1xE9() { + // with possible local optimizations + if (3.0 in 3.0..<1.0 != range1.contains(3.0)) throw AssertionError() + if (3.0 !in 3.0..<1.0 != !range1.contains(3.0)) throw AssertionError() + if (!(3.0 in 3.0..<1.0) != !range1.contains(3.0)) throw AssertionError() + if (!(3.0 !in 3.0..<1.0) != range1.contains(3.0)) throw AssertionError() + // no local optimizations + if (element9 in 3.0..<1.0 != range1.contains(element9)) throw AssertionError() + if (element9 !in 3.0..<1.0 != !range1.contains(element9)) throw AssertionError() + if (!(element9 in 3.0..<1.0) != !range1.contains(element9)) throw AssertionError() + if (!(element9 !in 3.0..<1.0) != range1.contains(element9)) throw AssertionError() +} + +fun testR1xE10() { + // with possible local optimizations + if (4F in 3.0..<1.0 != range1.contains(4F)) throw AssertionError() + if (4F !in 3.0..<1.0 != !range1.contains(4F)) throw AssertionError() + if (!(4F in 3.0..<1.0) != !range1.contains(4F)) throw AssertionError() + if (!(4F !in 3.0..<1.0) != range1.contains(4F)) throw AssertionError() + // no local optimizations + if (element10 in 3.0..<1.0 != range1.contains(element10)) throw AssertionError() + if (element10 !in 3.0..<1.0 != !range1.contains(element10)) throw AssertionError() + if (!(element10 in 3.0..<1.0) != !range1.contains(element10)) throw AssertionError() + if (!(element10 !in 3.0..<1.0) != range1.contains(element10)) throw AssertionError() +} + +fun testR1xE11() { + // with possible local optimizations + if (4.0 in 3.0..<1.0 != range1.contains(4.0)) throw AssertionError() + if (4.0 !in 3.0..<1.0 != !range1.contains(4.0)) throw AssertionError() + if (!(4.0 in 3.0..<1.0) != !range1.contains(4.0)) throw AssertionError() + if (!(4.0 !in 3.0..<1.0) != range1.contains(4.0)) throw AssertionError() + // no local optimizations + if (element11 in 3.0..<1.0 != range1.contains(element11)) throw AssertionError() + if (element11 !in 3.0..<1.0 != !range1.contains(element11)) throw AssertionError() + if (!(element11 in 3.0..<1.0) != !range1.contains(element11)) throw AssertionError() + if (!(element11 !in 3.0..<1.0) != range1.contains(element11)) throw AssertionError() +} + + diff --git a/compiler/testData/codegen/box/ranges/contains/generated/floatRangeLiteral.kt b/compiler/testData/codegen/box/ranges/contains/generated/floatRangeLiteral.kt deleted file mode 100644 index 9c05ef229f0..00000000000 --- a/compiler/testData/codegen/box/ranges/contains/generated/floatRangeLiteral.kt +++ /dev/null @@ -1,362 +0,0 @@ -// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! -// WITH_STDLIB - - - -val range0 = 1.0F .. 3.0F -val range1 = 3.0F .. 1.0F - -val element0 = (-1).toFloat() -val element1 = (-1).toDouble() -val element2 = 0.toFloat() -val element3 = 0.toDouble() -val element4 = 1.toFloat() -val element5 = 1.toDouble() -val element6 = 2.toFloat() -val element7 = 2.toDouble() -val element8 = 3.toFloat() -val element9 = 3.toDouble() -val element10 = 4.toFloat() -val element11 = 4.toDouble() - -fun box(): String { - testR0xE0() - testR0xE1() - testR0xE2() - testR0xE3() - testR0xE4() - testR0xE5() - testR0xE6() - testR0xE7() - testR0xE8() - testR0xE9() - testR0xE10() - testR0xE11() - testR1xE0() - testR1xE1() - testR1xE2() - testR1xE3() - testR1xE4() - testR1xE5() - testR1xE6() - testR1xE7() - testR1xE8() - testR1xE9() - testR1xE10() - testR1xE11() - return "OK" -} - -fun testR0xE0() { - // with possible local optimizations - if ((-1).toFloat() in 1.0F .. 3.0F != range0.contains((-1).toFloat())) throw AssertionError() - if ((-1).toFloat() !in 1.0F .. 3.0F != !range0.contains((-1).toFloat())) throw AssertionError() - if (!((-1).toFloat() in 1.0F .. 3.0F) != !range0.contains((-1).toFloat())) throw AssertionError() - if (!((-1).toFloat() !in 1.0F .. 3.0F) != range0.contains((-1).toFloat())) throw AssertionError() - // no local optimizations - if (element0 in 1.0F .. 3.0F != range0.contains(element0)) throw AssertionError() - if (element0 !in 1.0F .. 3.0F != !range0.contains(element0)) throw AssertionError() - if (!(element0 in 1.0F .. 3.0F) != !range0.contains(element0)) throw AssertionError() - if (!(element0 !in 1.0F .. 3.0F) != range0.contains(element0)) throw AssertionError() -} - -fun testR0xE1() { - // with possible local optimizations - if ((-1).toDouble() in 1.0F .. 3.0F != range0.contains((-1).toDouble())) throw AssertionError() - if ((-1).toDouble() !in 1.0F .. 3.0F != !range0.contains((-1).toDouble())) throw AssertionError() - if (!((-1).toDouble() in 1.0F .. 3.0F) != !range0.contains((-1).toDouble())) throw AssertionError() - if (!((-1).toDouble() !in 1.0F .. 3.0F) != range0.contains((-1).toDouble())) throw AssertionError() - // no local optimizations - if (element1 in 1.0F .. 3.0F != range0.contains(element1)) throw AssertionError() - if (element1 !in 1.0F .. 3.0F != !range0.contains(element1)) throw AssertionError() - if (!(element1 in 1.0F .. 3.0F) != !range0.contains(element1)) throw AssertionError() - if (!(element1 !in 1.0F .. 3.0F) != range0.contains(element1)) throw AssertionError() -} - -fun testR0xE2() { - // with possible local optimizations - if (0.toFloat() in 1.0F .. 3.0F != range0.contains(0.toFloat())) throw AssertionError() - if (0.toFloat() !in 1.0F .. 3.0F != !range0.contains(0.toFloat())) throw AssertionError() - if (!(0.toFloat() in 1.0F .. 3.0F) != !range0.contains(0.toFloat())) throw AssertionError() - if (!(0.toFloat() !in 1.0F .. 3.0F) != range0.contains(0.toFloat())) throw AssertionError() - // no local optimizations - if (element2 in 1.0F .. 3.0F != range0.contains(element2)) throw AssertionError() - if (element2 !in 1.0F .. 3.0F != !range0.contains(element2)) throw AssertionError() - if (!(element2 in 1.0F .. 3.0F) != !range0.contains(element2)) throw AssertionError() - if (!(element2 !in 1.0F .. 3.0F) != range0.contains(element2)) throw AssertionError() -} - -fun testR0xE3() { - // with possible local optimizations - if (0.toDouble() in 1.0F .. 3.0F != range0.contains(0.toDouble())) throw AssertionError() - if (0.toDouble() !in 1.0F .. 3.0F != !range0.contains(0.toDouble())) throw AssertionError() - if (!(0.toDouble() in 1.0F .. 3.0F) != !range0.contains(0.toDouble())) throw AssertionError() - if (!(0.toDouble() !in 1.0F .. 3.0F) != range0.contains(0.toDouble())) throw AssertionError() - // no local optimizations - if (element3 in 1.0F .. 3.0F != range0.contains(element3)) throw AssertionError() - if (element3 !in 1.0F .. 3.0F != !range0.contains(element3)) throw AssertionError() - if (!(element3 in 1.0F .. 3.0F) != !range0.contains(element3)) throw AssertionError() - if (!(element3 !in 1.0F .. 3.0F) != range0.contains(element3)) throw AssertionError() -} - -fun testR0xE4() { - // with possible local optimizations - if (1.toFloat() in 1.0F .. 3.0F != range0.contains(1.toFloat())) throw AssertionError() - if (1.toFloat() !in 1.0F .. 3.0F != !range0.contains(1.toFloat())) throw AssertionError() - if (!(1.toFloat() in 1.0F .. 3.0F) != !range0.contains(1.toFloat())) throw AssertionError() - if (!(1.toFloat() !in 1.0F .. 3.0F) != range0.contains(1.toFloat())) throw AssertionError() - // no local optimizations - if (element4 in 1.0F .. 3.0F != range0.contains(element4)) throw AssertionError() - if (element4 !in 1.0F .. 3.0F != !range0.contains(element4)) throw AssertionError() - if (!(element4 in 1.0F .. 3.0F) != !range0.contains(element4)) throw AssertionError() - if (!(element4 !in 1.0F .. 3.0F) != range0.contains(element4)) throw AssertionError() -} - -fun testR0xE5() { - // with possible local optimizations - if (1.toDouble() in 1.0F .. 3.0F != range0.contains(1.toDouble())) throw AssertionError() - if (1.toDouble() !in 1.0F .. 3.0F != !range0.contains(1.toDouble())) throw AssertionError() - if (!(1.toDouble() in 1.0F .. 3.0F) != !range0.contains(1.toDouble())) throw AssertionError() - if (!(1.toDouble() !in 1.0F .. 3.0F) != range0.contains(1.toDouble())) throw AssertionError() - // no local optimizations - if (element5 in 1.0F .. 3.0F != range0.contains(element5)) throw AssertionError() - if (element5 !in 1.0F .. 3.0F != !range0.contains(element5)) throw AssertionError() - if (!(element5 in 1.0F .. 3.0F) != !range0.contains(element5)) throw AssertionError() - if (!(element5 !in 1.0F .. 3.0F) != range0.contains(element5)) throw AssertionError() -} - -fun testR0xE6() { - // with possible local optimizations - if (2.toFloat() in 1.0F .. 3.0F != range0.contains(2.toFloat())) throw AssertionError() - if (2.toFloat() !in 1.0F .. 3.0F != !range0.contains(2.toFloat())) throw AssertionError() - if (!(2.toFloat() in 1.0F .. 3.0F) != !range0.contains(2.toFloat())) throw AssertionError() - if (!(2.toFloat() !in 1.0F .. 3.0F) != range0.contains(2.toFloat())) throw AssertionError() - // no local optimizations - if (element6 in 1.0F .. 3.0F != range0.contains(element6)) throw AssertionError() - if (element6 !in 1.0F .. 3.0F != !range0.contains(element6)) throw AssertionError() - if (!(element6 in 1.0F .. 3.0F) != !range0.contains(element6)) throw AssertionError() - if (!(element6 !in 1.0F .. 3.0F) != range0.contains(element6)) throw AssertionError() -} - -fun testR0xE7() { - // with possible local optimizations - if (2.toDouble() in 1.0F .. 3.0F != range0.contains(2.toDouble())) throw AssertionError() - if (2.toDouble() !in 1.0F .. 3.0F != !range0.contains(2.toDouble())) throw AssertionError() - if (!(2.toDouble() in 1.0F .. 3.0F) != !range0.contains(2.toDouble())) throw AssertionError() - if (!(2.toDouble() !in 1.0F .. 3.0F) != range0.contains(2.toDouble())) throw AssertionError() - // no local optimizations - if (element7 in 1.0F .. 3.0F != range0.contains(element7)) throw AssertionError() - if (element7 !in 1.0F .. 3.0F != !range0.contains(element7)) throw AssertionError() - if (!(element7 in 1.0F .. 3.0F) != !range0.contains(element7)) throw AssertionError() - if (!(element7 !in 1.0F .. 3.0F) != range0.contains(element7)) throw AssertionError() -} - -fun testR0xE8() { - // with possible local optimizations - if (3.toFloat() in 1.0F .. 3.0F != range0.contains(3.toFloat())) throw AssertionError() - if (3.toFloat() !in 1.0F .. 3.0F != !range0.contains(3.toFloat())) throw AssertionError() - if (!(3.toFloat() in 1.0F .. 3.0F) != !range0.contains(3.toFloat())) throw AssertionError() - if (!(3.toFloat() !in 1.0F .. 3.0F) != range0.contains(3.toFloat())) throw AssertionError() - // no local optimizations - if (element8 in 1.0F .. 3.0F != range0.contains(element8)) throw AssertionError() - if (element8 !in 1.0F .. 3.0F != !range0.contains(element8)) throw AssertionError() - if (!(element8 in 1.0F .. 3.0F) != !range0.contains(element8)) throw AssertionError() - if (!(element8 !in 1.0F .. 3.0F) != range0.contains(element8)) throw AssertionError() -} - -fun testR0xE9() { - // with possible local optimizations - if (3.toDouble() in 1.0F .. 3.0F != range0.contains(3.toDouble())) throw AssertionError() - if (3.toDouble() !in 1.0F .. 3.0F != !range0.contains(3.toDouble())) throw AssertionError() - if (!(3.toDouble() in 1.0F .. 3.0F) != !range0.contains(3.toDouble())) throw AssertionError() - if (!(3.toDouble() !in 1.0F .. 3.0F) != range0.contains(3.toDouble())) throw AssertionError() - // no local optimizations - if (element9 in 1.0F .. 3.0F != range0.contains(element9)) throw AssertionError() - if (element9 !in 1.0F .. 3.0F != !range0.contains(element9)) throw AssertionError() - if (!(element9 in 1.0F .. 3.0F) != !range0.contains(element9)) throw AssertionError() - if (!(element9 !in 1.0F .. 3.0F) != range0.contains(element9)) throw AssertionError() -} - -fun testR0xE10() { - // with possible local optimizations - if (4.toFloat() in 1.0F .. 3.0F != range0.contains(4.toFloat())) throw AssertionError() - if (4.toFloat() !in 1.0F .. 3.0F != !range0.contains(4.toFloat())) throw AssertionError() - if (!(4.toFloat() in 1.0F .. 3.0F) != !range0.contains(4.toFloat())) throw AssertionError() - if (!(4.toFloat() !in 1.0F .. 3.0F) != range0.contains(4.toFloat())) throw AssertionError() - // no local optimizations - if (element10 in 1.0F .. 3.0F != range0.contains(element10)) throw AssertionError() - if (element10 !in 1.0F .. 3.0F != !range0.contains(element10)) throw AssertionError() - if (!(element10 in 1.0F .. 3.0F) != !range0.contains(element10)) throw AssertionError() - if (!(element10 !in 1.0F .. 3.0F) != range0.contains(element10)) throw AssertionError() -} - -fun testR0xE11() { - // with possible local optimizations - if (4.toDouble() in 1.0F .. 3.0F != range0.contains(4.toDouble())) throw AssertionError() - if (4.toDouble() !in 1.0F .. 3.0F != !range0.contains(4.toDouble())) throw AssertionError() - if (!(4.toDouble() in 1.0F .. 3.0F) != !range0.contains(4.toDouble())) throw AssertionError() - if (!(4.toDouble() !in 1.0F .. 3.0F) != range0.contains(4.toDouble())) throw AssertionError() - // no local optimizations - if (element11 in 1.0F .. 3.0F != range0.contains(element11)) throw AssertionError() - if (element11 !in 1.0F .. 3.0F != !range0.contains(element11)) throw AssertionError() - if (!(element11 in 1.0F .. 3.0F) != !range0.contains(element11)) throw AssertionError() - if (!(element11 !in 1.0F .. 3.0F) != range0.contains(element11)) throw AssertionError() -} - -fun testR1xE0() { - // with possible local optimizations - if ((-1).toFloat() in 3.0F .. 1.0F != range1.contains((-1).toFloat())) throw AssertionError() - if ((-1).toFloat() !in 3.0F .. 1.0F != !range1.contains((-1).toFloat())) throw AssertionError() - if (!((-1).toFloat() in 3.0F .. 1.0F) != !range1.contains((-1).toFloat())) throw AssertionError() - if (!((-1).toFloat() !in 3.0F .. 1.0F) != range1.contains((-1).toFloat())) throw AssertionError() - // no local optimizations - if (element0 in 3.0F .. 1.0F != range1.contains(element0)) throw AssertionError() - if (element0 !in 3.0F .. 1.0F != !range1.contains(element0)) throw AssertionError() - if (!(element0 in 3.0F .. 1.0F) != !range1.contains(element0)) throw AssertionError() - if (!(element0 !in 3.0F .. 1.0F) != range1.contains(element0)) throw AssertionError() -} - -fun testR1xE1() { - // with possible local optimizations - if ((-1).toDouble() in 3.0F .. 1.0F != range1.contains((-1).toDouble())) throw AssertionError() - if ((-1).toDouble() !in 3.0F .. 1.0F != !range1.contains((-1).toDouble())) throw AssertionError() - if (!((-1).toDouble() in 3.0F .. 1.0F) != !range1.contains((-1).toDouble())) throw AssertionError() - if (!((-1).toDouble() !in 3.0F .. 1.0F) != range1.contains((-1).toDouble())) throw AssertionError() - // no local optimizations - if (element1 in 3.0F .. 1.0F != range1.contains(element1)) throw AssertionError() - if (element1 !in 3.0F .. 1.0F != !range1.contains(element1)) throw AssertionError() - if (!(element1 in 3.0F .. 1.0F) != !range1.contains(element1)) throw AssertionError() - if (!(element1 !in 3.0F .. 1.0F) != range1.contains(element1)) throw AssertionError() -} - -fun testR1xE2() { - // with possible local optimizations - if (0.toFloat() in 3.0F .. 1.0F != range1.contains(0.toFloat())) throw AssertionError() - if (0.toFloat() !in 3.0F .. 1.0F != !range1.contains(0.toFloat())) throw AssertionError() - if (!(0.toFloat() in 3.0F .. 1.0F) != !range1.contains(0.toFloat())) throw AssertionError() - if (!(0.toFloat() !in 3.0F .. 1.0F) != range1.contains(0.toFloat())) throw AssertionError() - // no local optimizations - if (element2 in 3.0F .. 1.0F != range1.contains(element2)) throw AssertionError() - if (element2 !in 3.0F .. 1.0F != !range1.contains(element2)) throw AssertionError() - if (!(element2 in 3.0F .. 1.0F) != !range1.contains(element2)) throw AssertionError() - if (!(element2 !in 3.0F .. 1.0F) != range1.contains(element2)) throw AssertionError() -} - -fun testR1xE3() { - // with possible local optimizations - if (0.toDouble() in 3.0F .. 1.0F != range1.contains(0.toDouble())) throw AssertionError() - if (0.toDouble() !in 3.0F .. 1.0F != !range1.contains(0.toDouble())) throw AssertionError() - if (!(0.toDouble() in 3.0F .. 1.0F) != !range1.contains(0.toDouble())) throw AssertionError() - if (!(0.toDouble() !in 3.0F .. 1.0F) != range1.contains(0.toDouble())) throw AssertionError() - // no local optimizations - if (element3 in 3.0F .. 1.0F != range1.contains(element3)) throw AssertionError() - if (element3 !in 3.0F .. 1.0F != !range1.contains(element3)) throw AssertionError() - if (!(element3 in 3.0F .. 1.0F) != !range1.contains(element3)) throw AssertionError() - if (!(element3 !in 3.0F .. 1.0F) != range1.contains(element3)) throw AssertionError() -} - -fun testR1xE4() { - // with possible local optimizations - if (1.toFloat() in 3.0F .. 1.0F != range1.contains(1.toFloat())) throw AssertionError() - if (1.toFloat() !in 3.0F .. 1.0F != !range1.contains(1.toFloat())) throw AssertionError() - if (!(1.toFloat() in 3.0F .. 1.0F) != !range1.contains(1.toFloat())) throw AssertionError() - if (!(1.toFloat() !in 3.0F .. 1.0F) != range1.contains(1.toFloat())) throw AssertionError() - // no local optimizations - if (element4 in 3.0F .. 1.0F != range1.contains(element4)) throw AssertionError() - if (element4 !in 3.0F .. 1.0F != !range1.contains(element4)) throw AssertionError() - if (!(element4 in 3.0F .. 1.0F) != !range1.contains(element4)) throw AssertionError() - if (!(element4 !in 3.0F .. 1.0F) != range1.contains(element4)) throw AssertionError() -} - -fun testR1xE5() { - // with possible local optimizations - if (1.toDouble() in 3.0F .. 1.0F != range1.contains(1.toDouble())) throw AssertionError() - if (1.toDouble() !in 3.0F .. 1.0F != !range1.contains(1.toDouble())) throw AssertionError() - if (!(1.toDouble() in 3.0F .. 1.0F) != !range1.contains(1.toDouble())) throw AssertionError() - if (!(1.toDouble() !in 3.0F .. 1.0F) != range1.contains(1.toDouble())) throw AssertionError() - // no local optimizations - if (element5 in 3.0F .. 1.0F != range1.contains(element5)) throw AssertionError() - if (element5 !in 3.0F .. 1.0F != !range1.contains(element5)) throw AssertionError() - if (!(element5 in 3.0F .. 1.0F) != !range1.contains(element5)) throw AssertionError() - if (!(element5 !in 3.0F .. 1.0F) != range1.contains(element5)) throw AssertionError() -} - -fun testR1xE6() { - // with possible local optimizations - if (2.toFloat() in 3.0F .. 1.0F != range1.contains(2.toFloat())) throw AssertionError() - if (2.toFloat() !in 3.0F .. 1.0F != !range1.contains(2.toFloat())) throw AssertionError() - if (!(2.toFloat() in 3.0F .. 1.0F) != !range1.contains(2.toFloat())) throw AssertionError() - if (!(2.toFloat() !in 3.0F .. 1.0F) != range1.contains(2.toFloat())) throw AssertionError() - // no local optimizations - if (element6 in 3.0F .. 1.0F != range1.contains(element6)) throw AssertionError() - if (element6 !in 3.0F .. 1.0F != !range1.contains(element6)) throw AssertionError() - if (!(element6 in 3.0F .. 1.0F) != !range1.contains(element6)) throw AssertionError() - if (!(element6 !in 3.0F .. 1.0F) != range1.contains(element6)) throw AssertionError() -} - -fun testR1xE7() { - // with possible local optimizations - if (2.toDouble() in 3.0F .. 1.0F != range1.contains(2.toDouble())) throw AssertionError() - if (2.toDouble() !in 3.0F .. 1.0F != !range1.contains(2.toDouble())) throw AssertionError() - if (!(2.toDouble() in 3.0F .. 1.0F) != !range1.contains(2.toDouble())) throw AssertionError() - if (!(2.toDouble() !in 3.0F .. 1.0F) != range1.contains(2.toDouble())) throw AssertionError() - // no local optimizations - if (element7 in 3.0F .. 1.0F != range1.contains(element7)) throw AssertionError() - if (element7 !in 3.0F .. 1.0F != !range1.contains(element7)) throw AssertionError() - if (!(element7 in 3.0F .. 1.0F) != !range1.contains(element7)) throw AssertionError() - if (!(element7 !in 3.0F .. 1.0F) != range1.contains(element7)) throw AssertionError() -} - -fun testR1xE8() { - // with possible local optimizations - if (3.toFloat() in 3.0F .. 1.0F != range1.contains(3.toFloat())) throw AssertionError() - if (3.toFloat() !in 3.0F .. 1.0F != !range1.contains(3.toFloat())) throw AssertionError() - if (!(3.toFloat() in 3.0F .. 1.0F) != !range1.contains(3.toFloat())) throw AssertionError() - if (!(3.toFloat() !in 3.0F .. 1.0F) != range1.contains(3.toFloat())) throw AssertionError() - // no local optimizations - if (element8 in 3.0F .. 1.0F != range1.contains(element8)) throw AssertionError() - if (element8 !in 3.0F .. 1.0F != !range1.contains(element8)) throw AssertionError() - if (!(element8 in 3.0F .. 1.0F) != !range1.contains(element8)) throw AssertionError() - if (!(element8 !in 3.0F .. 1.0F) != range1.contains(element8)) throw AssertionError() -} - -fun testR1xE9() { - // with possible local optimizations - if (3.toDouble() in 3.0F .. 1.0F != range1.contains(3.toDouble())) throw AssertionError() - if (3.toDouble() !in 3.0F .. 1.0F != !range1.contains(3.toDouble())) throw AssertionError() - if (!(3.toDouble() in 3.0F .. 1.0F) != !range1.contains(3.toDouble())) throw AssertionError() - if (!(3.toDouble() !in 3.0F .. 1.0F) != range1.contains(3.toDouble())) throw AssertionError() - // no local optimizations - if (element9 in 3.0F .. 1.0F != range1.contains(element9)) throw AssertionError() - if (element9 !in 3.0F .. 1.0F != !range1.contains(element9)) throw AssertionError() - if (!(element9 in 3.0F .. 1.0F) != !range1.contains(element9)) throw AssertionError() - if (!(element9 !in 3.0F .. 1.0F) != range1.contains(element9)) throw AssertionError() -} - -fun testR1xE10() { - // with possible local optimizations - if (4.toFloat() in 3.0F .. 1.0F != range1.contains(4.toFloat())) throw AssertionError() - if (4.toFloat() !in 3.0F .. 1.0F != !range1.contains(4.toFloat())) throw AssertionError() - if (!(4.toFloat() in 3.0F .. 1.0F) != !range1.contains(4.toFloat())) throw AssertionError() - if (!(4.toFloat() !in 3.0F .. 1.0F) != range1.contains(4.toFloat())) throw AssertionError() - // no local optimizations - if (element10 in 3.0F .. 1.0F != range1.contains(element10)) throw AssertionError() - if (element10 !in 3.0F .. 1.0F != !range1.contains(element10)) throw AssertionError() - if (!(element10 in 3.0F .. 1.0F) != !range1.contains(element10)) throw AssertionError() - if (!(element10 !in 3.0F .. 1.0F) != range1.contains(element10)) throw AssertionError() -} - -fun testR1xE11() { - // with possible local optimizations - if (4.toDouble() in 3.0F .. 1.0F != range1.contains(4.toDouble())) throw AssertionError() - if (4.toDouble() !in 3.0F .. 1.0F != !range1.contains(4.toDouble())) throw AssertionError() - if (!(4.toDouble() in 3.0F .. 1.0F) != !range1.contains(4.toDouble())) throw AssertionError() - if (!(4.toDouble() !in 3.0F .. 1.0F) != range1.contains(4.toDouble())) throw AssertionError() - // no local optimizations - if (element11 in 3.0F .. 1.0F != range1.contains(element11)) throw AssertionError() - if (element11 !in 3.0F .. 1.0F != !range1.contains(element11)) throw AssertionError() - if (!(element11 in 3.0F .. 1.0F) != !range1.contains(element11)) throw AssertionError() - if (!(element11 !in 3.0F .. 1.0F) != range1.contains(element11)) throw AssertionError() -} - - diff --git a/compiler/testData/codegen/box/ranges/contains/generated/floatRangeTo.kt b/compiler/testData/codegen/box/ranges/contains/generated/floatRangeTo.kt new file mode 100644 index 00000000000..8019ace28ec --- /dev/null +++ b/compiler/testData/codegen/box/ranges/contains/generated/floatRangeTo.kt @@ -0,0 +1,362 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_STDLIB + + + +val range0 = 1.0F..3.0F +val range1 = 3.0F..1.0F + +val element0 = -1F +val element1 = -1.0 +val element2 = 0F +val element3 = 0.0 +val element4 = 1F +val element5 = 1.0 +val element6 = 2F +val element7 = 2.0 +val element8 = 3F +val element9 = 3.0 +val element10 = 4F +val element11 = 4.0 + +fun box(): String { + testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR0xE5() + testR0xE6() + testR0xE7() + testR0xE8() + testR0xE9() + testR0xE10() + testR0xE11() + testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + testR1xE5() + testR1xE6() + testR1xE7() + testR1xE8() + testR1xE9() + testR1xE10() + testR1xE11() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if (-1F in 1.0F..3.0F != range0.contains(-1F)) throw AssertionError() + if (-1F !in 1.0F..3.0F != !range0.contains(-1F)) throw AssertionError() + if (!(-1F in 1.0F..3.0F) != !range0.contains(-1F)) throw AssertionError() + if (!(-1F !in 1.0F..3.0F) != range0.contains(-1F)) throw AssertionError() + // no local optimizations + if (element0 in 1.0F..3.0F != range0.contains(element0)) throw AssertionError() + if (element0 !in 1.0F..3.0F != !range0.contains(element0)) throw AssertionError() + if (!(element0 in 1.0F..3.0F) != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in 1.0F..3.0F) != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if (-1.0 in 1.0F..3.0F != range0.contains(-1.0)) throw AssertionError() + if (-1.0 !in 1.0F..3.0F != !range0.contains(-1.0)) throw AssertionError() + if (!(-1.0 in 1.0F..3.0F) != !range0.contains(-1.0)) throw AssertionError() + if (!(-1.0 !in 1.0F..3.0F) != range0.contains(-1.0)) throw AssertionError() + // no local optimizations + if (element1 in 1.0F..3.0F != range0.contains(element1)) throw AssertionError() + if (element1 !in 1.0F..3.0F != !range0.contains(element1)) throw AssertionError() + if (!(element1 in 1.0F..3.0F) != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in 1.0F..3.0F) != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if (0F in 1.0F..3.0F != range0.contains(0F)) throw AssertionError() + if (0F !in 1.0F..3.0F != !range0.contains(0F)) throw AssertionError() + if (!(0F in 1.0F..3.0F) != !range0.contains(0F)) throw AssertionError() + if (!(0F !in 1.0F..3.0F) != range0.contains(0F)) throw AssertionError() + // no local optimizations + if (element2 in 1.0F..3.0F != range0.contains(element2)) throw AssertionError() + if (element2 !in 1.0F..3.0F != !range0.contains(element2)) throw AssertionError() + if (!(element2 in 1.0F..3.0F) != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in 1.0F..3.0F) != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if (0.0 in 1.0F..3.0F != range0.contains(0.0)) throw AssertionError() + if (0.0 !in 1.0F..3.0F != !range0.contains(0.0)) throw AssertionError() + if (!(0.0 in 1.0F..3.0F) != !range0.contains(0.0)) throw AssertionError() + if (!(0.0 !in 1.0F..3.0F) != range0.contains(0.0)) throw AssertionError() + // no local optimizations + if (element3 in 1.0F..3.0F != range0.contains(element3)) throw AssertionError() + if (element3 !in 1.0F..3.0F != !range0.contains(element3)) throw AssertionError() + if (!(element3 in 1.0F..3.0F) != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in 1.0F..3.0F) != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if (1F in 1.0F..3.0F != range0.contains(1F)) throw AssertionError() + if (1F !in 1.0F..3.0F != !range0.contains(1F)) throw AssertionError() + if (!(1F in 1.0F..3.0F) != !range0.contains(1F)) throw AssertionError() + if (!(1F !in 1.0F..3.0F) != range0.contains(1F)) throw AssertionError() + // no local optimizations + if (element4 in 1.0F..3.0F != range0.contains(element4)) throw AssertionError() + if (element4 !in 1.0F..3.0F != !range0.contains(element4)) throw AssertionError() + if (!(element4 in 1.0F..3.0F) != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in 1.0F..3.0F) != range0.contains(element4)) throw AssertionError() +} + +fun testR0xE5() { + // with possible local optimizations + if (1.0 in 1.0F..3.0F != range0.contains(1.0)) throw AssertionError() + if (1.0 !in 1.0F..3.0F != !range0.contains(1.0)) throw AssertionError() + if (!(1.0 in 1.0F..3.0F) != !range0.contains(1.0)) throw AssertionError() + if (!(1.0 !in 1.0F..3.0F) != range0.contains(1.0)) throw AssertionError() + // no local optimizations + if (element5 in 1.0F..3.0F != range0.contains(element5)) throw AssertionError() + if (element5 !in 1.0F..3.0F != !range0.contains(element5)) throw AssertionError() + if (!(element5 in 1.0F..3.0F) != !range0.contains(element5)) throw AssertionError() + if (!(element5 !in 1.0F..3.0F) != range0.contains(element5)) throw AssertionError() +} + +fun testR0xE6() { + // with possible local optimizations + if (2F in 1.0F..3.0F != range0.contains(2F)) throw AssertionError() + if (2F !in 1.0F..3.0F != !range0.contains(2F)) throw AssertionError() + if (!(2F in 1.0F..3.0F) != !range0.contains(2F)) throw AssertionError() + if (!(2F !in 1.0F..3.0F) != range0.contains(2F)) throw AssertionError() + // no local optimizations + if (element6 in 1.0F..3.0F != range0.contains(element6)) throw AssertionError() + if (element6 !in 1.0F..3.0F != !range0.contains(element6)) throw AssertionError() + if (!(element6 in 1.0F..3.0F) != !range0.contains(element6)) throw AssertionError() + if (!(element6 !in 1.0F..3.0F) != range0.contains(element6)) throw AssertionError() +} + +fun testR0xE7() { + // with possible local optimizations + if (2.0 in 1.0F..3.0F != range0.contains(2.0)) throw AssertionError() + if (2.0 !in 1.0F..3.0F != !range0.contains(2.0)) throw AssertionError() + if (!(2.0 in 1.0F..3.0F) != !range0.contains(2.0)) throw AssertionError() + if (!(2.0 !in 1.0F..3.0F) != range0.contains(2.0)) throw AssertionError() + // no local optimizations + if (element7 in 1.0F..3.0F != range0.contains(element7)) throw AssertionError() + if (element7 !in 1.0F..3.0F != !range0.contains(element7)) throw AssertionError() + if (!(element7 in 1.0F..3.0F) != !range0.contains(element7)) throw AssertionError() + if (!(element7 !in 1.0F..3.0F) != range0.contains(element7)) throw AssertionError() +} + +fun testR0xE8() { + // with possible local optimizations + if (3F in 1.0F..3.0F != range0.contains(3F)) throw AssertionError() + if (3F !in 1.0F..3.0F != !range0.contains(3F)) throw AssertionError() + if (!(3F in 1.0F..3.0F) != !range0.contains(3F)) throw AssertionError() + if (!(3F !in 1.0F..3.0F) != range0.contains(3F)) throw AssertionError() + // no local optimizations + if (element8 in 1.0F..3.0F != range0.contains(element8)) throw AssertionError() + if (element8 !in 1.0F..3.0F != !range0.contains(element8)) throw AssertionError() + if (!(element8 in 1.0F..3.0F) != !range0.contains(element8)) throw AssertionError() + if (!(element8 !in 1.0F..3.0F) != range0.contains(element8)) throw AssertionError() +} + +fun testR0xE9() { + // with possible local optimizations + if (3.0 in 1.0F..3.0F != range0.contains(3.0)) throw AssertionError() + if (3.0 !in 1.0F..3.0F != !range0.contains(3.0)) throw AssertionError() + if (!(3.0 in 1.0F..3.0F) != !range0.contains(3.0)) throw AssertionError() + if (!(3.0 !in 1.0F..3.0F) != range0.contains(3.0)) throw AssertionError() + // no local optimizations + if (element9 in 1.0F..3.0F != range0.contains(element9)) throw AssertionError() + if (element9 !in 1.0F..3.0F != !range0.contains(element9)) throw AssertionError() + if (!(element9 in 1.0F..3.0F) != !range0.contains(element9)) throw AssertionError() + if (!(element9 !in 1.0F..3.0F) != range0.contains(element9)) throw AssertionError() +} + +fun testR0xE10() { + // with possible local optimizations + if (4F in 1.0F..3.0F != range0.contains(4F)) throw AssertionError() + if (4F !in 1.0F..3.0F != !range0.contains(4F)) throw AssertionError() + if (!(4F in 1.0F..3.0F) != !range0.contains(4F)) throw AssertionError() + if (!(4F !in 1.0F..3.0F) != range0.contains(4F)) throw AssertionError() + // no local optimizations + if (element10 in 1.0F..3.0F != range0.contains(element10)) throw AssertionError() + if (element10 !in 1.0F..3.0F != !range0.contains(element10)) throw AssertionError() + if (!(element10 in 1.0F..3.0F) != !range0.contains(element10)) throw AssertionError() + if (!(element10 !in 1.0F..3.0F) != range0.contains(element10)) throw AssertionError() +} + +fun testR0xE11() { + // with possible local optimizations + if (4.0 in 1.0F..3.0F != range0.contains(4.0)) throw AssertionError() + if (4.0 !in 1.0F..3.0F != !range0.contains(4.0)) throw AssertionError() + if (!(4.0 in 1.0F..3.0F) != !range0.contains(4.0)) throw AssertionError() + if (!(4.0 !in 1.0F..3.0F) != range0.contains(4.0)) throw AssertionError() + // no local optimizations + if (element11 in 1.0F..3.0F != range0.contains(element11)) throw AssertionError() + if (element11 !in 1.0F..3.0F != !range0.contains(element11)) throw AssertionError() + if (!(element11 in 1.0F..3.0F) != !range0.contains(element11)) throw AssertionError() + if (!(element11 !in 1.0F..3.0F) != range0.contains(element11)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if (-1F in 3.0F..1.0F != range1.contains(-1F)) throw AssertionError() + if (-1F !in 3.0F..1.0F != !range1.contains(-1F)) throw AssertionError() + if (!(-1F in 3.0F..1.0F) != !range1.contains(-1F)) throw AssertionError() + if (!(-1F !in 3.0F..1.0F) != range1.contains(-1F)) throw AssertionError() + // no local optimizations + if (element0 in 3.0F..1.0F != range1.contains(element0)) throw AssertionError() + if (element0 !in 3.0F..1.0F != !range1.contains(element0)) throw AssertionError() + if (!(element0 in 3.0F..1.0F) != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in 3.0F..1.0F) != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if (-1.0 in 3.0F..1.0F != range1.contains(-1.0)) throw AssertionError() + if (-1.0 !in 3.0F..1.0F != !range1.contains(-1.0)) throw AssertionError() + if (!(-1.0 in 3.0F..1.0F) != !range1.contains(-1.0)) throw AssertionError() + if (!(-1.0 !in 3.0F..1.0F) != range1.contains(-1.0)) throw AssertionError() + // no local optimizations + if (element1 in 3.0F..1.0F != range1.contains(element1)) throw AssertionError() + if (element1 !in 3.0F..1.0F != !range1.contains(element1)) throw AssertionError() + if (!(element1 in 3.0F..1.0F) != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in 3.0F..1.0F) != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if (0F in 3.0F..1.0F != range1.contains(0F)) throw AssertionError() + if (0F !in 3.0F..1.0F != !range1.contains(0F)) throw AssertionError() + if (!(0F in 3.0F..1.0F) != !range1.contains(0F)) throw AssertionError() + if (!(0F !in 3.0F..1.0F) != range1.contains(0F)) throw AssertionError() + // no local optimizations + if (element2 in 3.0F..1.0F != range1.contains(element2)) throw AssertionError() + if (element2 !in 3.0F..1.0F != !range1.contains(element2)) throw AssertionError() + if (!(element2 in 3.0F..1.0F) != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in 3.0F..1.0F) != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if (0.0 in 3.0F..1.0F != range1.contains(0.0)) throw AssertionError() + if (0.0 !in 3.0F..1.0F != !range1.contains(0.0)) throw AssertionError() + if (!(0.0 in 3.0F..1.0F) != !range1.contains(0.0)) throw AssertionError() + if (!(0.0 !in 3.0F..1.0F) != range1.contains(0.0)) throw AssertionError() + // no local optimizations + if (element3 in 3.0F..1.0F != range1.contains(element3)) throw AssertionError() + if (element3 !in 3.0F..1.0F != !range1.contains(element3)) throw AssertionError() + if (!(element3 in 3.0F..1.0F) != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in 3.0F..1.0F) != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if (1F in 3.0F..1.0F != range1.contains(1F)) throw AssertionError() + if (1F !in 3.0F..1.0F != !range1.contains(1F)) throw AssertionError() + if (!(1F in 3.0F..1.0F) != !range1.contains(1F)) throw AssertionError() + if (!(1F !in 3.0F..1.0F) != range1.contains(1F)) throw AssertionError() + // no local optimizations + if (element4 in 3.0F..1.0F != range1.contains(element4)) throw AssertionError() + if (element4 !in 3.0F..1.0F != !range1.contains(element4)) throw AssertionError() + if (!(element4 in 3.0F..1.0F) != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in 3.0F..1.0F) != range1.contains(element4)) throw AssertionError() +} + +fun testR1xE5() { + // with possible local optimizations + if (1.0 in 3.0F..1.0F != range1.contains(1.0)) throw AssertionError() + if (1.0 !in 3.0F..1.0F != !range1.contains(1.0)) throw AssertionError() + if (!(1.0 in 3.0F..1.0F) != !range1.contains(1.0)) throw AssertionError() + if (!(1.0 !in 3.0F..1.0F) != range1.contains(1.0)) throw AssertionError() + // no local optimizations + if (element5 in 3.0F..1.0F != range1.contains(element5)) throw AssertionError() + if (element5 !in 3.0F..1.0F != !range1.contains(element5)) throw AssertionError() + if (!(element5 in 3.0F..1.0F) != !range1.contains(element5)) throw AssertionError() + if (!(element5 !in 3.0F..1.0F) != range1.contains(element5)) throw AssertionError() +} + +fun testR1xE6() { + // with possible local optimizations + if (2F in 3.0F..1.0F != range1.contains(2F)) throw AssertionError() + if (2F !in 3.0F..1.0F != !range1.contains(2F)) throw AssertionError() + if (!(2F in 3.0F..1.0F) != !range1.contains(2F)) throw AssertionError() + if (!(2F !in 3.0F..1.0F) != range1.contains(2F)) throw AssertionError() + // no local optimizations + if (element6 in 3.0F..1.0F != range1.contains(element6)) throw AssertionError() + if (element6 !in 3.0F..1.0F != !range1.contains(element6)) throw AssertionError() + if (!(element6 in 3.0F..1.0F) != !range1.contains(element6)) throw AssertionError() + if (!(element6 !in 3.0F..1.0F) != range1.contains(element6)) throw AssertionError() +} + +fun testR1xE7() { + // with possible local optimizations + if (2.0 in 3.0F..1.0F != range1.contains(2.0)) throw AssertionError() + if (2.0 !in 3.0F..1.0F != !range1.contains(2.0)) throw AssertionError() + if (!(2.0 in 3.0F..1.0F) != !range1.contains(2.0)) throw AssertionError() + if (!(2.0 !in 3.0F..1.0F) != range1.contains(2.0)) throw AssertionError() + // no local optimizations + if (element7 in 3.0F..1.0F != range1.contains(element7)) throw AssertionError() + if (element7 !in 3.0F..1.0F != !range1.contains(element7)) throw AssertionError() + if (!(element7 in 3.0F..1.0F) != !range1.contains(element7)) throw AssertionError() + if (!(element7 !in 3.0F..1.0F) != range1.contains(element7)) throw AssertionError() +} + +fun testR1xE8() { + // with possible local optimizations + if (3F in 3.0F..1.0F != range1.contains(3F)) throw AssertionError() + if (3F !in 3.0F..1.0F != !range1.contains(3F)) throw AssertionError() + if (!(3F in 3.0F..1.0F) != !range1.contains(3F)) throw AssertionError() + if (!(3F !in 3.0F..1.0F) != range1.contains(3F)) throw AssertionError() + // no local optimizations + if (element8 in 3.0F..1.0F != range1.contains(element8)) throw AssertionError() + if (element8 !in 3.0F..1.0F != !range1.contains(element8)) throw AssertionError() + if (!(element8 in 3.0F..1.0F) != !range1.contains(element8)) throw AssertionError() + if (!(element8 !in 3.0F..1.0F) != range1.contains(element8)) throw AssertionError() +} + +fun testR1xE9() { + // with possible local optimizations + if (3.0 in 3.0F..1.0F != range1.contains(3.0)) throw AssertionError() + if (3.0 !in 3.0F..1.0F != !range1.contains(3.0)) throw AssertionError() + if (!(3.0 in 3.0F..1.0F) != !range1.contains(3.0)) throw AssertionError() + if (!(3.0 !in 3.0F..1.0F) != range1.contains(3.0)) throw AssertionError() + // no local optimizations + if (element9 in 3.0F..1.0F != range1.contains(element9)) throw AssertionError() + if (element9 !in 3.0F..1.0F != !range1.contains(element9)) throw AssertionError() + if (!(element9 in 3.0F..1.0F) != !range1.contains(element9)) throw AssertionError() + if (!(element9 !in 3.0F..1.0F) != range1.contains(element9)) throw AssertionError() +} + +fun testR1xE10() { + // with possible local optimizations + if (4F in 3.0F..1.0F != range1.contains(4F)) throw AssertionError() + if (4F !in 3.0F..1.0F != !range1.contains(4F)) throw AssertionError() + if (!(4F in 3.0F..1.0F) != !range1.contains(4F)) throw AssertionError() + if (!(4F !in 3.0F..1.0F) != range1.contains(4F)) throw AssertionError() + // no local optimizations + if (element10 in 3.0F..1.0F != range1.contains(element10)) throw AssertionError() + if (element10 !in 3.0F..1.0F != !range1.contains(element10)) throw AssertionError() + if (!(element10 in 3.0F..1.0F) != !range1.contains(element10)) throw AssertionError() + if (!(element10 !in 3.0F..1.0F) != range1.contains(element10)) throw AssertionError() +} + +fun testR1xE11() { + // with possible local optimizations + if (4.0 in 3.0F..1.0F != range1.contains(4.0)) throw AssertionError() + if (4.0 !in 3.0F..1.0F != !range1.contains(4.0)) throw AssertionError() + if (!(4.0 in 3.0F..1.0F) != !range1.contains(4.0)) throw AssertionError() + if (!(4.0 !in 3.0F..1.0F) != range1.contains(4.0)) throw AssertionError() + // no local optimizations + if (element11 in 3.0F..1.0F != range1.contains(element11)) throw AssertionError() + if (element11 !in 3.0F..1.0F != !range1.contains(element11)) throw AssertionError() + if (!(element11 in 3.0F..1.0F) != !range1.contains(element11)) throw AssertionError() + if (!(element11 !in 3.0F..1.0F) != range1.contains(element11)) throw AssertionError() +} + + diff --git a/compiler/testData/codegen/box/ranges/contains/generated/floatRangeUntil.kt b/compiler/testData/codegen/box/ranges/contains/generated/floatRangeUntil.kt new file mode 100644 index 00000000000..034edd238a4 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/contains/generated/floatRangeUntil.kt @@ -0,0 +1,191 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_STDLIB +// DONT_TARGET_EXACT_BACKEND: JVM +// !LANGUAGE: +RangeUntilOperator +@file:OptIn(ExperimentalStdlibApi::class) + + + +val range0 = 1.0F..<3.0F +val range1 = 3.0F..<1.0F + +val element0 = -1F +val element1 = 0F +val element2 = 1F +val element3 = 2F +val element4 = 3F +val element5 = 4F + +fun box(): String { + testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR0xE5() + testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + testR1xE5() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if (-1F in 1.0F..<3.0F != range0.contains(-1F)) throw AssertionError() + if (-1F !in 1.0F..<3.0F != !range0.contains(-1F)) throw AssertionError() + if (!(-1F in 1.0F..<3.0F) != !range0.contains(-1F)) throw AssertionError() + if (!(-1F !in 1.0F..<3.0F) != range0.contains(-1F)) throw AssertionError() + // no local optimizations + if (element0 in 1.0F..<3.0F != range0.contains(element0)) throw AssertionError() + if (element0 !in 1.0F..<3.0F != !range0.contains(element0)) throw AssertionError() + if (!(element0 in 1.0F..<3.0F) != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in 1.0F..<3.0F) != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if (0F in 1.0F..<3.0F != range0.contains(0F)) throw AssertionError() + if (0F !in 1.0F..<3.0F != !range0.contains(0F)) throw AssertionError() + if (!(0F in 1.0F..<3.0F) != !range0.contains(0F)) throw AssertionError() + if (!(0F !in 1.0F..<3.0F) != range0.contains(0F)) throw AssertionError() + // no local optimizations + if (element1 in 1.0F..<3.0F != range0.contains(element1)) throw AssertionError() + if (element1 !in 1.0F..<3.0F != !range0.contains(element1)) throw AssertionError() + if (!(element1 in 1.0F..<3.0F) != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in 1.0F..<3.0F) != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if (1F in 1.0F..<3.0F != range0.contains(1F)) throw AssertionError() + if (1F !in 1.0F..<3.0F != !range0.contains(1F)) throw AssertionError() + if (!(1F in 1.0F..<3.0F) != !range0.contains(1F)) throw AssertionError() + if (!(1F !in 1.0F..<3.0F) != range0.contains(1F)) throw AssertionError() + // no local optimizations + if (element2 in 1.0F..<3.0F != range0.contains(element2)) throw AssertionError() + if (element2 !in 1.0F..<3.0F != !range0.contains(element2)) throw AssertionError() + if (!(element2 in 1.0F..<3.0F) != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in 1.0F..<3.0F) != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if (2F in 1.0F..<3.0F != range0.contains(2F)) throw AssertionError() + if (2F !in 1.0F..<3.0F != !range0.contains(2F)) throw AssertionError() + if (!(2F in 1.0F..<3.0F) != !range0.contains(2F)) throw AssertionError() + if (!(2F !in 1.0F..<3.0F) != range0.contains(2F)) throw AssertionError() + // no local optimizations + if (element3 in 1.0F..<3.0F != range0.contains(element3)) throw AssertionError() + if (element3 !in 1.0F..<3.0F != !range0.contains(element3)) throw AssertionError() + if (!(element3 in 1.0F..<3.0F) != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in 1.0F..<3.0F) != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if (3F in 1.0F..<3.0F != range0.contains(3F)) throw AssertionError() + if (3F !in 1.0F..<3.0F != !range0.contains(3F)) throw AssertionError() + if (!(3F in 1.0F..<3.0F) != !range0.contains(3F)) throw AssertionError() + if (!(3F !in 1.0F..<3.0F) != range0.contains(3F)) throw AssertionError() + // no local optimizations + if (element4 in 1.0F..<3.0F != range0.contains(element4)) throw AssertionError() + if (element4 !in 1.0F..<3.0F != !range0.contains(element4)) throw AssertionError() + if (!(element4 in 1.0F..<3.0F) != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in 1.0F..<3.0F) != range0.contains(element4)) throw AssertionError() +} + +fun testR0xE5() { + // with possible local optimizations + if (4F in 1.0F..<3.0F != range0.contains(4F)) throw AssertionError() + if (4F !in 1.0F..<3.0F != !range0.contains(4F)) throw AssertionError() + if (!(4F in 1.0F..<3.0F) != !range0.contains(4F)) throw AssertionError() + if (!(4F !in 1.0F..<3.0F) != range0.contains(4F)) throw AssertionError() + // no local optimizations + if (element5 in 1.0F..<3.0F != range0.contains(element5)) throw AssertionError() + if (element5 !in 1.0F..<3.0F != !range0.contains(element5)) throw AssertionError() + if (!(element5 in 1.0F..<3.0F) != !range0.contains(element5)) throw AssertionError() + if (!(element5 !in 1.0F..<3.0F) != range0.contains(element5)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if (-1F in 3.0F..<1.0F != range1.contains(-1F)) throw AssertionError() + if (-1F !in 3.0F..<1.0F != !range1.contains(-1F)) throw AssertionError() + if (!(-1F in 3.0F..<1.0F) != !range1.contains(-1F)) throw AssertionError() + if (!(-1F !in 3.0F..<1.0F) != range1.contains(-1F)) throw AssertionError() + // no local optimizations + if (element0 in 3.0F..<1.0F != range1.contains(element0)) throw AssertionError() + if (element0 !in 3.0F..<1.0F != !range1.contains(element0)) throw AssertionError() + if (!(element0 in 3.0F..<1.0F) != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in 3.0F..<1.0F) != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if (0F in 3.0F..<1.0F != range1.contains(0F)) throw AssertionError() + if (0F !in 3.0F..<1.0F != !range1.contains(0F)) throw AssertionError() + if (!(0F in 3.0F..<1.0F) != !range1.contains(0F)) throw AssertionError() + if (!(0F !in 3.0F..<1.0F) != range1.contains(0F)) throw AssertionError() + // no local optimizations + if (element1 in 3.0F..<1.0F != range1.contains(element1)) throw AssertionError() + if (element1 !in 3.0F..<1.0F != !range1.contains(element1)) throw AssertionError() + if (!(element1 in 3.0F..<1.0F) != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in 3.0F..<1.0F) != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if (1F in 3.0F..<1.0F != range1.contains(1F)) throw AssertionError() + if (1F !in 3.0F..<1.0F != !range1.contains(1F)) throw AssertionError() + if (!(1F in 3.0F..<1.0F) != !range1.contains(1F)) throw AssertionError() + if (!(1F !in 3.0F..<1.0F) != range1.contains(1F)) throw AssertionError() + // no local optimizations + if (element2 in 3.0F..<1.0F != range1.contains(element2)) throw AssertionError() + if (element2 !in 3.0F..<1.0F != !range1.contains(element2)) throw AssertionError() + if (!(element2 in 3.0F..<1.0F) != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in 3.0F..<1.0F) != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if (2F in 3.0F..<1.0F != range1.contains(2F)) throw AssertionError() + if (2F !in 3.0F..<1.0F != !range1.contains(2F)) throw AssertionError() + if (!(2F in 3.0F..<1.0F) != !range1.contains(2F)) throw AssertionError() + if (!(2F !in 3.0F..<1.0F) != range1.contains(2F)) throw AssertionError() + // no local optimizations + if (element3 in 3.0F..<1.0F != range1.contains(element3)) throw AssertionError() + if (element3 !in 3.0F..<1.0F != !range1.contains(element3)) throw AssertionError() + if (!(element3 in 3.0F..<1.0F) != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in 3.0F..<1.0F) != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if (3F in 3.0F..<1.0F != range1.contains(3F)) throw AssertionError() + if (3F !in 3.0F..<1.0F != !range1.contains(3F)) throw AssertionError() + if (!(3F in 3.0F..<1.0F) != !range1.contains(3F)) throw AssertionError() + if (!(3F !in 3.0F..<1.0F) != range1.contains(3F)) throw AssertionError() + // no local optimizations + if (element4 in 3.0F..<1.0F != range1.contains(element4)) throw AssertionError() + if (element4 !in 3.0F..<1.0F != !range1.contains(element4)) throw AssertionError() + if (!(element4 in 3.0F..<1.0F) != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in 3.0F..<1.0F) != range1.contains(element4)) throw AssertionError() +} + +fun testR1xE5() { + // with possible local optimizations + if (4F in 3.0F..<1.0F != range1.contains(4F)) throw AssertionError() + if (4F !in 3.0F..<1.0F != !range1.contains(4F)) throw AssertionError() + if (!(4F in 3.0F..<1.0F) != !range1.contains(4F)) throw AssertionError() + if (!(4F !in 3.0F..<1.0F) != range1.contains(4F)) throw AssertionError() + // no local optimizations + if (element5 in 3.0F..<1.0F != range1.contains(element5)) throw AssertionError() + if (element5 !in 3.0F..<1.0F != !range1.contains(element5)) throw AssertionError() + if (!(element5 in 3.0F..<1.0F) != !range1.contains(element5)) throw AssertionError() + if (!(element5 !in 3.0F..<1.0F) != range1.contains(element5)) throw AssertionError() +} + + diff --git a/compiler/testData/codegen/box/ranges/contains/generated/intDownTo.kt b/compiler/testData/codegen/box/ranges/contains/generated/intDownTo.kt index b5c401a5a45..bfd55c42f5e 100644 --- a/compiler/testData/codegen/box/ranges/contains/generated/intDownTo.kt +++ b/compiler/testData/codegen/box/ranges/contains/generated/intDownTo.kt @@ -3,41 +3,186 @@ -val range0 = 3 downTo 1 -val range1 = 1 downTo 3 +val range0 = 1 downTo 3 +val range1 = 3 downTo 1 -val element0 = 1 +val element0 = -1 +val element1 = 0 +val element2 = 1 +val element3 = 2 +val element4 = 3 +val element5 = 4 fun box(): String { testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR0xE5() testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + testR1xE5() return "OK" } fun testR0xE0() { // with possible local optimizations - if (1 in 3 downTo 1 != range0.contains(1)) throw AssertionError() - if (1 !in 3 downTo 1 != !range0.contains(1)) throw AssertionError() - if (!(1 in 3 downTo 1) != !range0.contains(1)) throw AssertionError() - if (!(1 !in 3 downTo 1) != range0.contains(1)) throw AssertionError() + if (-1 in 1 downTo 3 != range0.contains(-1)) throw AssertionError() + if (-1 !in 1 downTo 3 != !range0.contains(-1)) throw AssertionError() + if (!(-1 in 1 downTo 3) != !range0.contains(-1)) throw AssertionError() + if (!(-1 !in 1 downTo 3) != range0.contains(-1)) throw AssertionError() // no local optimizations - if (element0 in 3 downTo 1 != range0.contains(element0)) throw AssertionError() - if (element0 !in 3 downTo 1 != !range0.contains(element0)) throw AssertionError() - if (!(element0 in 3 downTo 1) != !range0.contains(element0)) throw AssertionError() - if (!(element0 !in 3 downTo 1) != range0.contains(element0)) throw AssertionError() + if (element0 in 1 downTo 3 != range0.contains(element0)) throw AssertionError() + if (element0 !in 1 downTo 3 != !range0.contains(element0)) throw AssertionError() + if (!(element0 in 1 downTo 3) != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in 1 downTo 3) != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if (0 in 1 downTo 3 != range0.contains(0)) throw AssertionError() + if (0 !in 1 downTo 3 != !range0.contains(0)) throw AssertionError() + if (!(0 in 1 downTo 3) != !range0.contains(0)) throw AssertionError() + if (!(0 !in 1 downTo 3) != range0.contains(0)) throw AssertionError() + // no local optimizations + if (element1 in 1 downTo 3 != range0.contains(element1)) throw AssertionError() + if (element1 !in 1 downTo 3 != !range0.contains(element1)) throw AssertionError() + if (!(element1 in 1 downTo 3) != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in 1 downTo 3) != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if (1 in 1 downTo 3 != range0.contains(1)) throw AssertionError() + if (1 !in 1 downTo 3 != !range0.contains(1)) throw AssertionError() + if (!(1 in 1 downTo 3) != !range0.contains(1)) throw AssertionError() + if (!(1 !in 1 downTo 3) != range0.contains(1)) throw AssertionError() + // no local optimizations + if (element2 in 1 downTo 3 != range0.contains(element2)) throw AssertionError() + if (element2 !in 1 downTo 3 != !range0.contains(element2)) throw AssertionError() + if (!(element2 in 1 downTo 3) != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in 1 downTo 3) != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if (2 in 1 downTo 3 != range0.contains(2)) throw AssertionError() + if (2 !in 1 downTo 3 != !range0.contains(2)) throw AssertionError() + if (!(2 in 1 downTo 3) != !range0.contains(2)) throw AssertionError() + if (!(2 !in 1 downTo 3) != range0.contains(2)) throw AssertionError() + // no local optimizations + if (element3 in 1 downTo 3 != range0.contains(element3)) throw AssertionError() + if (element3 !in 1 downTo 3 != !range0.contains(element3)) throw AssertionError() + if (!(element3 in 1 downTo 3) != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in 1 downTo 3) != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if (3 in 1 downTo 3 != range0.contains(3)) throw AssertionError() + if (3 !in 1 downTo 3 != !range0.contains(3)) throw AssertionError() + if (!(3 in 1 downTo 3) != !range0.contains(3)) throw AssertionError() + if (!(3 !in 1 downTo 3) != range0.contains(3)) throw AssertionError() + // no local optimizations + if (element4 in 1 downTo 3 != range0.contains(element4)) throw AssertionError() + if (element4 !in 1 downTo 3 != !range0.contains(element4)) throw AssertionError() + if (!(element4 in 1 downTo 3) != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in 1 downTo 3) != range0.contains(element4)) throw AssertionError() +} + +fun testR0xE5() { + // with possible local optimizations + if (4 in 1 downTo 3 != range0.contains(4)) throw AssertionError() + if (4 !in 1 downTo 3 != !range0.contains(4)) throw AssertionError() + if (!(4 in 1 downTo 3) != !range0.contains(4)) throw AssertionError() + if (!(4 !in 1 downTo 3) != range0.contains(4)) throw AssertionError() + // no local optimizations + if (element5 in 1 downTo 3 != range0.contains(element5)) throw AssertionError() + if (element5 !in 1 downTo 3 != !range0.contains(element5)) throw AssertionError() + if (!(element5 in 1 downTo 3) != !range0.contains(element5)) throw AssertionError() + if (!(element5 !in 1 downTo 3) != range0.contains(element5)) throw AssertionError() } fun testR1xE0() { // with possible local optimizations - if (1 in 1 downTo 3 != range1.contains(1)) throw AssertionError() - if (1 !in 1 downTo 3 != !range1.contains(1)) throw AssertionError() - if (!(1 in 1 downTo 3) != !range1.contains(1)) throw AssertionError() - if (!(1 !in 1 downTo 3) != range1.contains(1)) throw AssertionError() + if (-1 in 3 downTo 1 != range1.contains(-1)) throw AssertionError() + if (-1 !in 3 downTo 1 != !range1.contains(-1)) throw AssertionError() + if (!(-1 in 3 downTo 1) != !range1.contains(-1)) throw AssertionError() + if (!(-1 !in 3 downTo 1) != range1.contains(-1)) throw AssertionError() // no local optimizations - if (element0 in 1 downTo 3 != range1.contains(element0)) throw AssertionError() - if (element0 !in 1 downTo 3 != !range1.contains(element0)) throw AssertionError() - if (!(element0 in 1 downTo 3) != !range1.contains(element0)) throw AssertionError() - if (!(element0 !in 1 downTo 3) != range1.contains(element0)) throw AssertionError() + if (element0 in 3 downTo 1 != range1.contains(element0)) throw AssertionError() + if (element0 !in 3 downTo 1 != !range1.contains(element0)) throw AssertionError() + if (!(element0 in 3 downTo 1) != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in 3 downTo 1) != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if (0 in 3 downTo 1 != range1.contains(0)) throw AssertionError() + if (0 !in 3 downTo 1 != !range1.contains(0)) throw AssertionError() + if (!(0 in 3 downTo 1) != !range1.contains(0)) throw AssertionError() + if (!(0 !in 3 downTo 1) != range1.contains(0)) throw AssertionError() + // no local optimizations + if (element1 in 3 downTo 1 != range1.contains(element1)) throw AssertionError() + if (element1 !in 3 downTo 1 != !range1.contains(element1)) throw AssertionError() + if (!(element1 in 3 downTo 1) != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in 3 downTo 1) != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if (1 in 3 downTo 1 != range1.contains(1)) throw AssertionError() + if (1 !in 3 downTo 1 != !range1.contains(1)) throw AssertionError() + if (!(1 in 3 downTo 1) != !range1.contains(1)) throw AssertionError() + if (!(1 !in 3 downTo 1) != range1.contains(1)) throw AssertionError() + // no local optimizations + if (element2 in 3 downTo 1 != range1.contains(element2)) throw AssertionError() + if (element2 !in 3 downTo 1 != !range1.contains(element2)) throw AssertionError() + if (!(element2 in 3 downTo 1) != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in 3 downTo 1) != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if (2 in 3 downTo 1 != range1.contains(2)) throw AssertionError() + if (2 !in 3 downTo 1 != !range1.contains(2)) throw AssertionError() + if (!(2 in 3 downTo 1) != !range1.contains(2)) throw AssertionError() + if (!(2 !in 3 downTo 1) != range1.contains(2)) throw AssertionError() + // no local optimizations + if (element3 in 3 downTo 1 != range1.contains(element3)) throw AssertionError() + if (element3 !in 3 downTo 1 != !range1.contains(element3)) throw AssertionError() + if (!(element3 in 3 downTo 1) != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in 3 downTo 1) != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if (3 in 3 downTo 1 != range1.contains(3)) throw AssertionError() + if (3 !in 3 downTo 1 != !range1.contains(3)) throw AssertionError() + if (!(3 in 3 downTo 1) != !range1.contains(3)) throw AssertionError() + if (!(3 !in 3 downTo 1) != range1.contains(3)) throw AssertionError() + // no local optimizations + if (element4 in 3 downTo 1 != range1.contains(element4)) throw AssertionError() + if (element4 !in 3 downTo 1 != !range1.contains(element4)) throw AssertionError() + if (!(element4 in 3 downTo 1) != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in 3 downTo 1) != range1.contains(element4)) throw AssertionError() +} + +fun testR1xE5() { + // with possible local optimizations + if (4 in 3 downTo 1 != range1.contains(4)) throw AssertionError() + if (4 !in 3 downTo 1 != !range1.contains(4)) throw AssertionError() + if (!(4 in 3 downTo 1) != !range1.contains(4)) throw AssertionError() + if (!(4 !in 3 downTo 1) != range1.contains(4)) throw AssertionError() + // no local optimizations + if (element5 in 3 downTo 1 != range1.contains(element5)) throw AssertionError() + if (element5 !in 3 downTo 1 != !range1.contains(element5)) throw AssertionError() + if (!(element5 in 3 downTo 1) != !range1.contains(element5)) throw AssertionError() + if (!(element5 !in 3 downTo 1) != range1.contains(element5)) throw AssertionError() } diff --git a/compiler/testData/codegen/box/ranges/contains/generated/intRangeLiteral.kt b/compiler/testData/codegen/box/ranges/contains/generated/intRangeLiteral.kt deleted file mode 100644 index 7c70e41eccf..00000000000 --- a/compiler/testData/codegen/box/ranges/contains/generated/intRangeLiteral.kt +++ /dev/null @@ -1,710 +0,0 @@ -// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! -// WITH_STDLIB - - - -val range0 = 1 .. 3 -val range1 = 3 .. 1 - -val element0 = (-1).toByte() -val element1 = (-1).toShort() -val element2 = (-1) -val element3 = (-1).toLong() -val element4 = 0.toByte() -val element5 = 0.toShort() -val element6 = 0 -val element7 = 0.toLong() -val element8 = 1.toByte() -val element9 = 1.toShort() -val element10 = 1 -val element11 = 1.toLong() -val element12 = 2.toByte() -val element13 = 2.toShort() -val element14 = 2 -val element15 = 2.toLong() -val element16 = 3.toByte() -val element17 = 3.toShort() -val element18 = 3 -val element19 = 3.toLong() -val element20 = 4.toByte() -val element21 = 4.toShort() -val element22 = 4 -val element23 = 4.toLong() - -fun box(): String { - testR0xE0() - testR0xE1() - testR0xE2() - testR0xE3() - testR0xE4() - testR0xE5() - testR0xE6() - testR0xE7() - testR0xE8() - testR0xE9() - testR0xE10() - testR0xE11() - testR0xE12() - testR0xE13() - testR0xE14() - testR0xE15() - testR0xE16() - testR0xE17() - testR0xE18() - testR0xE19() - testR0xE20() - testR0xE21() - testR0xE22() - testR0xE23() - testR1xE0() - testR1xE1() - testR1xE2() - testR1xE3() - testR1xE4() - testR1xE5() - testR1xE6() - testR1xE7() - testR1xE8() - testR1xE9() - testR1xE10() - testR1xE11() - testR1xE12() - testR1xE13() - testR1xE14() - testR1xE15() - testR1xE16() - testR1xE17() - testR1xE18() - testR1xE19() - testR1xE20() - testR1xE21() - testR1xE22() - testR1xE23() - return "OK" -} - -fun testR0xE0() { - // with possible local optimizations - if ((-1).toByte() in 1 .. 3 != range0.contains((-1).toByte())) throw AssertionError() - if ((-1).toByte() !in 1 .. 3 != !range0.contains((-1).toByte())) throw AssertionError() - if (!((-1).toByte() in 1 .. 3) != !range0.contains((-1).toByte())) throw AssertionError() - if (!((-1).toByte() !in 1 .. 3) != range0.contains((-1).toByte())) throw AssertionError() - // no local optimizations - if (element0 in 1 .. 3 != range0.contains(element0)) throw AssertionError() - if (element0 !in 1 .. 3 != !range0.contains(element0)) throw AssertionError() - if (!(element0 in 1 .. 3) != !range0.contains(element0)) throw AssertionError() - if (!(element0 !in 1 .. 3) != range0.contains(element0)) throw AssertionError() -} - -fun testR0xE1() { - // with possible local optimizations - if ((-1).toShort() in 1 .. 3 != range0.contains((-1).toShort())) throw AssertionError() - if ((-1).toShort() !in 1 .. 3 != !range0.contains((-1).toShort())) throw AssertionError() - if (!((-1).toShort() in 1 .. 3) != !range0.contains((-1).toShort())) throw AssertionError() - if (!((-1).toShort() !in 1 .. 3) != range0.contains((-1).toShort())) throw AssertionError() - // no local optimizations - if (element1 in 1 .. 3 != range0.contains(element1)) throw AssertionError() - if (element1 !in 1 .. 3 != !range0.contains(element1)) throw AssertionError() - if (!(element1 in 1 .. 3) != !range0.contains(element1)) throw AssertionError() - if (!(element1 !in 1 .. 3) != range0.contains(element1)) throw AssertionError() -} - -fun testR0xE2() { - // with possible local optimizations - if ((-1) in 1 .. 3 != range0.contains((-1))) throw AssertionError() - if ((-1) !in 1 .. 3 != !range0.contains((-1))) throw AssertionError() - if (!((-1) in 1 .. 3) != !range0.contains((-1))) throw AssertionError() - if (!((-1) !in 1 .. 3) != range0.contains((-1))) throw AssertionError() - // no local optimizations - if (element2 in 1 .. 3 != range0.contains(element2)) throw AssertionError() - if (element2 !in 1 .. 3 != !range0.contains(element2)) throw AssertionError() - if (!(element2 in 1 .. 3) != !range0.contains(element2)) throw AssertionError() - if (!(element2 !in 1 .. 3) != range0.contains(element2)) throw AssertionError() -} - -fun testR0xE3() { - // with possible local optimizations - if ((-1).toLong() in 1 .. 3 != range0.contains((-1).toLong())) throw AssertionError() - if ((-1).toLong() !in 1 .. 3 != !range0.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() in 1 .. 3) != !range0.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() !in 1 .. 3) != range0.contains((-1).toLong())) throw AssertionError() - // no local optimizations - if (element3 in 1 .. 3 != range0.contains(element3)) throw AssertionError() - if (element3 !in 1 .. 3 != !range0.contains(element3)) throw AssertionError() - if (!(element3 in 1 .. 3) != !range0.contains(element3)) throw AssertionError() - if (!(element3 !in 1 .. 3) != range0.contains(element3)) throw AssertionError() -} - -fun testR0xE4() { - // with possible local optimizations - if (0.toByte() in 1 .. 3 != range0.contains(0.toByte())) throw AssertionError() - if (0.toByte() !in 1 .. 3 != !range0.contains(0.toByte())) throw AssertionError() - if (!(0.toByte() in 1 .. 3) != !range0.contains(0.toByte())) throw AssertionError() - if (!(0.toByte() !in 1 .. 3) != range0.contains(0.toByte())) throw AssertionError() - // no local optimizations - if (element4 in 1 .. 3 != range0.contains(element4)) throw AssertionError() - if (element4 !in 1 .. 3 != !range0.contains(element4)) throw AssertionError() - if (!(element4 in 1 .. 3) != !range0.contains(element4)) throw AssertionError() - if (!(element4 !in 1 .. 3) != range0.contains(element4)) throw AssertionError() -} - -fun testR0xE5() { - // with possible local optimizations - if (0.toShort() in 1 .. 3 != range0.contains(0.toShort())) throw AssertionError() - if (0.toShort() !in 1 .. 3 != !range0.contains(0.toShort())) throw AssertionError() - if (!(0.toShort() in 1 .. 3) != !range0.contains(0.toShort())) throw AssertionError() - if (!(0.toShort() !in 1 .. 3) != range0.contains(0.toShort())) throw AssertionError() - // no local optimizations - if (element5 in 1 .. 3 != range0.contains(element5)) throw AssertionError() - if (element5 !in 1 .. 3 != !range0.contains(element5)) throw AssertionError() - if (!(element5 in 1 .. 3) != !range0.contains(element5)) throw AssertionError() - if (!(element5 !in 1 .. 3) != range0.contains(element5)) throw AssertionError() -} - -fun testR0xE6() { - // with possible local optimizations - if (0 in 1 .. 3 != range0.contains(0)) throw AssertionError() - if (0 !in 1 .. 3 != !range0.contains(0)) throw AssertionError() - if (!(0 in 1 .. 3) != !range0.contains(0)) throw AssertionError() - if (!(0 !in 1 .. 3) != range0.contains(0)) throw AssertionError() - // no local optimizations - if (element6 in 1 .. 3 != range0.contains(element6)) throw AssertionError() - if (element6 !in 1 .. 3 != !range0.contains(element6)) throw AssertionError() - if (!(element6 in 1 .. 3) != !range0.contains(element6)) throw AssertionError() - if (!(element6 !in 1 .. 3) != range0.contains(element6)) throw AssertionError() -} - -fun testR0xE7() { - // with possible local optimizations - if (0.toLong() in 1 .. 3 != range0.contains(0.toLong())) throw AssertionError() - if (0.toLong() !in 1 .. 3 != !range0.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() in 1 .. 3) != !range0.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() !in 1 .. 3) != range0.contains(0.toLong())) throw AssertionError() - // no local optimizations - if (element7 in 1 .. 3 != range0.contains(element7)) throw AssertionError() - if (element7 !in 1 .. 3 != !range0.contains(element7)) throw AssertionError() - if (!(element7 in 1 .. 3) != !range0.contains(element7)) throw AssertionError() - if (!(element7 !in 1 .. 3) != range0.contains(element7)) throw AssertionError() -} - -fun testR0xE8() { - // with possible local optimizations - if (1.toByte() in 1 .. 3 != range0.contains(1.toByte())) throw AssertionError() - if (1.toByte() !in 1 .. 3 != !range0.contains(1.toByte())) throw AssertionError() - if (!(1.toByte() in 1 .. 3) != !range0.contains(1.toByte())) throw AssertionError() - if (!(1.toByte() !in 1 .. 3) != range0.contains(1.toByte())) throw AssertionError() - // no local optimizations - if (element8 in 1 .. 3 != range0.contains(element8)) throw AssertionError() - if (element8 !in 1 .. 3 != !range0.contains(element8)) throw AssertionError() - if (!(element8 in 1 .. 3) != !range0.contains(element8)) throw AssertionError() - if (!(element8 !in 1 .. 3) != range0.contains(element8)) throw AssertionError() -} - -fun testR0xE9() { - // with possible local optimizations - if (1.toShort() in 1 .. 3 != range0.contains(1.toShort())) throw AssertionError() - if (1.toShort() !in 1 .. 3 != !range0.contains(1.toShort())) throw AssertionError() - if (!(1.toShort() in 1 .. 3) != !range0.contains(1.toShort())) throw AssertionError() - if (!(1.toShort() !in 1 .. 3) != range0.contains(1.toShort())) throw AssertionError() - // no local optimizations - if (element9 in 1 .. 3 != range0.contains(element9)) throw AssertionError() - if (element9 !in 1 .. 3 != !range0.contains(element9)) throw AssertionError() - if (!(element9 in 1 .. 3) != !range0.contains(element9)) throw AssertionError() - if (!(element9 !in 1 .. 3) != range0.contains(element9)) throw AssertionError() -} - -fun testR0xE10() { - // with possible local optimizations - if (1 in 1 .. 3 != range0.contains(1)) throw AssertionError() - if (1 !in 1 .. 3 != !range0.contains(1)) throw AssertionError() - if (!(1 in 1 .. 3) != !range0.contains(1)) throw AssertionError() - if (!(1 !in 1 .. 3) != range0.contains(1)) throw AssertionError() - // no local optimizations - if (element10 in 1 .. 3 != range0.contains(element10)) throw AssertionError() - if (element10 !in 1 .. 3 != !range0.contains(element10)) throw AssertionError() - if (!(element10 in 1 .. 3) != !range0.contains(element10)) throw AssertionError() - if (!(element10 !in 1 .. 3) != range0.contains(element10)) throw AssertionError() -} - -fun testR0xE11() { - // with possible local optimizations - if (1.toLong() in 1 .. 3 != range0.contains(1.toLong())) throw AssertionError() - if (1.toLong() !in 1 .. 3 != !range0.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() in 1 .. 3) != !range0.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() !in 1 .. 3) != range0.contains(1.toLong())) throw AssertionError() - // no local optimizations - if (element11 in 1 .. 3 != range0.contains(element11)) throw AssertionError() - if (element11 !in 1 .. 3 != !range0.contains(element11)) throw AssertionError() - if (!(element11 in 1 .. 3) != !range0.contains(element11)) throw AssertionError() - if (!(element11 !in 1 .. 3) != range0.contains(element11)) throw AssertionError() -} - -fun testR0xE12() { - // with possible local optimizations - if (2.toByte() in 1 .. 3 != range0.contains(2.toByte())) throw AssertionError() - if (2.toByte() !in 1 .. 3 != !range0.contains(2.toByte())) throw AssertionError() - if (!(2.toByte() in 1 .. 3) != !range0.contains(2.toByte())) throw AssertionError() - if (!(2.toByte() !in 1 .. 3) != range0.contains(2.toByte())) throw AssertionError() - // no local optimizations - if (element12 in 1 .. 3 != range0.contains(element12)) throw AssertionError() - if (element12 !in 1 .. 3 != !range0.contains(element12)) throw AssertionError() - if (!(element12 in 1 .. 3) != !range0.contains(element12)) throw AssertionError() - if (!(element12 !in 1 .. 3) != range0.contains(element12)) throw AssertionError() -} - -fun testR0xE13() { - // with possible local optimizations - if (2.toShort() in 1 .. 3 != range0.contains(2.toShort())) throw AssertionError() - if (2.toShort() !in 1 .. 3 != !range0.contains(2.toShort())) throw AssertionError() - if (!(2.toShort() in 1 .. 3) != !range0.contains(2.toShort())) throw AssertionError() - if (!(2.toShort() !in 1 .. 3) != range0.contains(2.toShort())) throw AssertionError() - // no local optimizations - if (element13 in 1 .. 3 != range0.contains(element13)) throw AssertionError() - if (element13 !in 1 .. 3 != !range0.contains(element13)) throw AssertionError() - if (!(element13 in 1 .. 3) != !range0.contains(element13)) throw AssertionError() - if (!(element13 !in 1 .. 3) != range0.contains(element13)) throw AssertionError() -} - -fun testR0xE14() { - // with possible local optimizations - if (2 in 1 .. 3 != range0.contains(2)) throw AssertionError() - if (2 !in 1 .. 3 != !range0.contains(2)) throw AssertionError() - if (!(2 in 1 .. 3) != !range0.contains(2)) throw AssertionError() - if (!(2 !in 1 .. 3) != range0.contains(2)) throw AssertionError() - // no local optimizations - if (element14 in 1 .. 3 != range0.contains(element14)) throw AssertionError() - if (element14 !in 1 .. 3 != !range0.contains(element14)) throw AssertionError() - if (!(element14 in 1 .. 3) != !range0.contains(element14)) throw AssertionError() - if (!(element14 !in 1 .. 3) != range0.contains(element14)) throw AssertionError() -} - -fun testR0xE15() { - // with possible local optimizations - if (2.toLong() in 1 .. 3 != range0.contains(2.toLong())) throw AssertionError() - if (2.toLong() !in 1 .. 3 != !range0.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() in 1 .. 3) != !range0.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() !in 1 .. 3) != range0.contains(2.toLong())) throw AssertionError() - // no local optimizations - if (element15 in 1 .. 3 != range0.contains(element15)) throw AssertionError() - if (element15 !in 1 .. 3 != !range0.contains(element15)) throw AssertionError() - if (!(element15 in 1 .. 3) != !range0.contains(element15)) throw AssertionError() - if (!(element15 !in 1 .. 3) != range0.contains(element15)) throw AssertionError() -} - -fun testR0xE16() { - // with possible local optimizations - if (3.toByte() in 1 .. 3 != range0.contains(3.toByte())) throw AssertionError() - if (3.toByte() !in 1 .. 3 != !range0.contains(3.toByte())) throw AssertionError() - if (!(3.toByte() in 1 .. 3) != !range0.contains(3.toByte())) throw AssertionError() - if (!(3.toByte() !in 1 .. 3) != range0.contains(3.toByte())) throw AssertionError() - // no local optimizations - if (element16 in 1 .. 3 != range0.contains(element16)) throw AssertionError() - if (element16 !in 1 .. 3 != !range0.contains(element16)) throw AssertionError() - if (!(element16 in 1 .. 3) != !range0.contains(element16)) throw AssertionError() - if (!(element16 !in 1 .. 3) != range0.contains(element16)) throw AssertionError() -} - -fun testR0xE17() { - // with possible local optimizations - if (3.toShort() in 1 .. 3 != range0.contains(3.toShort())) throw AssertionError() - if (3.toShort() !in 1 .. 3 != !range0.contains(3.toShort())) throw AssertionError() - if (!(3.toShort() in 1 .. 3) != !range0.contains(3.toShort())) throw AssertionError() - if (!(3.toShort() !in 1 .. 3) != range0.contains(3.toShort())) throw AssertionError() - // no local optimizations - if (element17 in 1 .. 3 != range0.contains(element17)) throw AssertionError() - if (element17 !in 1 .. 3 != !range0.contains(element17)) throw AssertionError() - if (!(element17 in 1 .. 3) != !range0.contains(element17)) throw AssertionError() - if (!(element17 !in 1 .. 3) != range0.contains(element17)) throw AssertionError() -} - -fun testR0xE18() { - // with possible local optimizations - if (3 in 1 .. 3 != range0.contains(3)) throw AssertionError() - if (3 !in 1 .. 3 != !range0.contains(3)) throw AssertionError() - if (!(3 in 1 .. 3) != !range0.contains(3)) throw AssertionError() - if (!(3 !in 1 .. 3) != range0.contains(3)) throw AssertionError() - // no local optimizations - if (element18 in 1 .. 3 != range0.contains(element18)) throw AssertionError() - if (element18 !in 1 .. 3 != !range0.contains(element18)) throw AssertionError() - if (!(element18 in 1 .. 3) != !range0.contains(element18)) throw AssertionError() - if (!(element18 !in 1 .. 3) != range0.contains(element18)) throw AssertionError() -} - -fun testR0xE19() { - // with possible local optimizations - if (3.toLong() in 1 .. 3 != range0.contains(3.toLong())) throw AssertionError() - if (3.toLong() !in 1 .. 3 != !range0.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() in 1 .. 3) != !range0.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() !in 1 .. 3) != range0.contains(3.toLong())) throw AssertionError() - // no local optimizations - if (element19 in 1 .. 3 != range0.contains(element19)) throw AssertionError() - if (element19 !in 1 .. 3 != !range0.contains(element19)) throw AssertionError() - if (!(element19 in 1 .. 3) != !range0.contains(element19)) throw AssertionError() - if (!(element19 !in 1 .. 3) != range0.contains(element19)) throw AssertionError() -} - -fun testR0xE20() { - // with possible local optimizations - if (4.toByte() in 1 .. 3 != range0.contains(4.toByte())) throw AssertionError() - if (4.toByte() !in 1 .. 3 != !range0.contains(4.toByte())) throw AssertionError() - if (!(4.toByte() in 1 .. 3) != !range0.contains(4.toByte())) throw AssertionError() - if (!(4.toByte() !in 1 .. 3) != range0.contains(4.toByte())) throw AssertionError() - // no local optimizations - if (element20 in 1 .. 3 != range0.contains(element20)) throw AssertionError() - if (element20 !in 1 .. 3 != !range0.contains(element20)) throw AssertionError() - if (!(element20 in 1 .. 3) != !range0.contains(element20)) throw AssertionError() - if (!(element20 !in 1 .. 3) != range0.contains(element20)) throw AssertionError() -} - -fun testR0xE21() { - // with possible local optimizations - if (4.toShort() in 1 .. 3 != range0.contains(4.toShort())) throw AssertionError() - if (4.toShort() !in 1 .. 3 != !range0.contains(4.toShort())) throw AssertionError() - if (!(4.toShort() in 1 .. 3) != !range0.contains(4.toShort())) throw AssertionError() - if (!(4.toShort() !in 1 .. 3) != range0.contains(4.toShort())) throw AssertionError() - // no local optimizations - if (element21 in 1 .. 3 != range0.contains(element21)) throw AssertionError() - if (element21 !in 1 .. 3 != !range0.contains(element21)) throw AssertionError() - if (!(element21 in 1 .. 3) != !range0.contains(element21)) throw AssertionError() - if (!(element21 !in 1 .. 3) != range0.contains(element21)) throw AssertionError() -} - -fun testR0xE22() { - // with possible local optimizations - if (4 in 1 .. 3 != range0.contains(4)) throw AssertionError() - if (4 !in 1 .. 3 != !range0.contains(4)) throw AssertionError() - if (!(4 in 1 .. 3) != !range0.contains(4)) throw AssertionError() - if (!(4 !in 1 .. 3) != range0.contains(4)) throw AssertionError() - // no local optimizations - if (element22 in 1 .. 3 != range0.contains(element22)) throw AssertionError() - if (element22 !in 1 .. 3 != !range0.contains(element22)) throw AssertionError() - if (!(element22 in 1 .. 3) != !range0.contains(element22)) throw AssertionError() - if (!(element22 !in 1 .. 3) != range0.contains(element22)) throw AssertionError() -} - -fun testR0xE23() { - // with possible local optimizations - if (4.toLong() in 1 .. 3 != range0.contains(4.toLong())) throw AssertionError() - if (4.toLong() !in 1 .. 3 != !range0.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() in 1 .. 3) != !range0.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() !in 1 .. 3) != range0.contains(4.toLong())) throw AssertionError() - // no local optimizations - if (element23 in 1 .. 3 != range0.contains(element23)) throw AssertionError() - if (element23 !in 1 .. 3 != !range0.contains(element23)) throw AssertionError() - if (!(element23 in 1 .. 3) != !range0.contains(element23)) throw AssertionError() - if (!(element23 !in 1 .. 3) != range0.contains(element23)) throw AssertionError() -} - -fun testR1xE0() { - // with possible local optimizations - if ((-1).toByte() in 3 .. 1 != range1.contains((-1).toByte())) throw AssertionError() - if ((-1).toByte() !in 3 .. 1 != !range1.contains((-1).toByte())) throw AssertionError() - if (!((-1).toByte() in 3 .. 1) != !range1.contains((-1).toByte())) throw AssertionError() - if (!((-1).toByte() !in 3 .. 1) != range1.contains((-1).toByte())) throw AssertionError() - // no local optimizations - if (element0 in 3 .. 1 != range1.contains(element0)) throw AssertionError() - if (element0 !in 3 .. 1 != !range1.contains(element0)) throw AssertionError() - if (!(element0 in 3 .. 1) != !range1.contains(element0)) throw AssertionError() - if (!(element0 !in 3 .. 1) != range1.contains(element0)) throw AssertionError() -} - -fun testR1xE1() { - // with possible local optimizations - if ((-1).toShort() in 3 .. 1 != range1.contains((-1).toShort())) throw AssertionError() - if ((-1).toShort() !in 3 .. 1 != !range1.contains((-1).toShort())) throw AssertionError() - if (!((-1).toShort() in 3 .. 1) != !range1.contains((-1).toShort())) throw AssertionError() - if (!((-1).toShort() !in 3 .. 1) != range1.contains((-1).toShort())) throw AssertionError() - // no local optimizations - if (element1 in 3 .. 1 != range1.contains(element1)) throw AssertionError() - if (element1 !in 3 .. 1 != !range1.contains(element1)) throw AssertionError() - if (!(element1 in 3 .. 1) != !range1.contains(element1)) throw AssertionError() - if (!(element1 !in 3 .. 1) != range1.contains(element1)) throw AssertionError() -} - -fun testR1xE2() { - // with possible local optimizations - if ((-1) in 3 .. 1 != range1.contains((-1))) throw AssertionError() - if ((-1) !in 3 .. 1 != !range1.contains((-1))) throw AssertionError() - if (!((-1) in 3 .. 1) != !range1.contains((-1))) throw AssertionError() - if (!((-1) !in 3 .. 1) != range1.contains((-1))) throw AssertionError() - // no local optimizations - if (element2 in 3 .. 1 != range1.contains(element2)) throw AssertionError() - if (element2 !in 3 .. 1 != !range1.contains(element2)) throw AssertionError() - if (!(element2 in 3 .. 1) != !range1.contains(element2)) throw AssertionError() - if (!(element2 !in 3 .. 1) != range1.contains(element2)) throw AssertionError() -} - -fun testR1xE3() { - // with possible local optimizations - if ((-1).toLong() in 3 .. 1 != range1.contains((-1).toLong())) throw AssertionError() - if ((-1).toLong() !in 3 .. 1 != !range1.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() in 3 .. 1) != !range1.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() !in 3 .. 1) != range1.contains((-1).toLong())) throw AssertionError() - // no local optimizations - if (element3 in 3 .. 1 != range1.contains(element3)) throw AssertionError() - if (element3 !in 3 .. 1 != !range1.contains(element3)) throw AssertionError() - if (!(element3 in 3 .. 1) != !range1.contains(element3)) throw AssertionError() - if (!(element3 !in 3 .. 1) != range1.contains(element3)) throw AssertionError() -} - -fun testR1xE4() { - // with possible local optimizations - if (0.toByte() in 3 .. 1 != range1.contains(0.toByte())) throw AssertionError() - if (0.toByte() !in 3 .. 1 != !range1.contains(0.toByte())) throw AssertionError() - if (!(0.toByte() in 3 .. 1) != !range1.contains(0.toByte())) throw AssertionError() - if (!(0.toByte() !in 3 .. 1) != range1.contains(0.toByte())) throw AssertionError() - // no local optimizations - if (element4 in 3 .. 1 != range1.contains(element4)) throw AssertionError() - if (element4 !in 3 .. 1 != !range1.contains(element4)) throw AssertionError() - if (!(element4 in 3 .. 1) != !range1.contains(element4)) throw AssertionError() - if (!(element4 !in 3 .. 1) != range1.contains(element4)) throw AssertionError() -} - -fun testR1xE5() { - // with possible local optimizations - if (0.toShort() in 3 .. 1 != range1.contains(0.toShort())) throw AssertionError() - if (0.toShort() !in 3 .. 1 != !range1.contains(0.toShort())) throw AssertionError() - if (!(0.toShort() in 3 .. 1) != !range1.contains(0.toShort())) throw AssertionError() - if (!(0.toShort() !in 3 .. 1) != range1.contains(0.toShort())) throw AssertionError() - // no local optimizations - if (element5 in 3 .. 1 != range1.contains(element5)) throw AssertionError() - if (element5 !in 3 .. 1 != !range1.contains(element5)) throw AssertionError() - if (!(element5 in 3 .. 1) != !range1.contains(element5)) throw AssertionError() - if (!(element5 !in 3 .. 1) != range1.contains(element5)) throw AssertionError() -} - -fun testR1xE6() { - // with possible local optimizations - if (0 in 3 .. 1 != range1.contains(0)) throw AssertionError() - if (0 !in 3 .. 1 != !range1.contains(0)) throw AssertionError() - if (!(0 in 3 .. 1) != !range1.contains(0)) throw AssertionError() - if (!(0 !in 3 .. 1) != range1.contains(0)) throw AssertionError() - // no local optimizations - if (element6 in 3 .. 1 != range1.contains(element6)) throw AssertionError() - if (element6 !in 3 .. 1 != !range1.contains(element6)) throw AssertionError() - if (!(element6 in 3 .. 1) != !range1.contains(element6)) throw AssertionError() - if (!(element6 !in 3 .. 1) != range1.contains(element6)) throw AssertionError() -} - -fun testR1xE7() { - // with possible local optimizations - if (0.toLong() in 3 .. 1 != range1.contains(0.toLong())) throw AssertionError() - if (0.toLong() !in 3 .. 1 != !range1.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() in 3 .. 1) != !range1.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() !in 3 .. 1) != range1.contains(0.toLong())) throw AssertionError() - // no local optimizations - if (element7 in 3 .. 1 != range1.contains(element7)) throw AssertionError() - if (element7 !in 3 .. 1 != !range1.contains(element7)) throw AssertionError() - if (!(element7 in 3 .. 1) != !range1.contains(element7)) throw AssertionError() - if (!(element7 !in 3 .. 1) != range1.contains(element7)) throw AssertionError() -} - -fun testR1xE8() { - // with possible local optimizations - if (1.toByte() in 3 .. 1 != range1.contains(1.toByte())) throw AssertionError() - if (1.toByte() !in 3 .. 1 != !range1.contains(1.toByte())) throw AssertionError() - if (!(1.toByte() in 3 .. 1) != !range1.contains(1.toByte())) throw AssertionError() - if (!(1.toByte() !in 3 .. 1) != range1.contains(1.toByte())) throw AssertionError() - // no local optimizations - if (element8 in 3 .. 1 != range1.contains(element8)) throw AssertionError() - if (element8 !in 3 .. 1 != !range1.contains(element8)) throw AssertionError() - if (!(element8 in 3 .. 1) != !range1.contains(element8)) throw AssertionError() - if (!(element8 !in 3 .. 1) != range1.contains(element8)) throw AssertionError() -} - -fun testR1xE9() { - // with possible local optimizations - if (1.toShort() in 3 .. 1 != range1.contains(1.toShort())) throw AssertionError() - if (1.toShort() !in 3 .. 1 != !range1.contains(1.toShort())) throw AssertionError() - if (!(1.toShort() in 3 .. 1) != !range1.contains(1.toShort())) throw AssertionError() - if (!(1.toShort() !in 3 .. 1) != range1.contains(1.toShort())) throw AssertionError() - // no local optimizations - if (element9 in 3 .. 1 != range1.contains(element9)) throw AssertionError() - if (element9 !in 3 .. 1 != !range1.contains(element9)) throw AssertionError() - if (!(element9 in 3 .. 1) != !range1.contains(element9)) throw AssertionError() - if (!(element9 !in 3 .. 1) != range1.contains(element9)) throw AssertionError() -} - -fun testR1xE10() { - // with possible local optimizations - if (1 in 3 .. 1 != range1.contains(1)) throw AssertionError() - if (1 !in 3 .. 1 != !range1.contains(1)) throw AssertionError() - if (!(1 in 3 .. 1) != !range1.contains(1)) throw AssertionError() - if (!(1 !in 3 .. 1) != range1.contains(1)) throw AssertionError() - // no local optimizations - if (element10 in 3 .. 1 != range1.contains(element10)) throw AssertionError() - if (element10 !in 3 .. 1 != !range1.contains(element10)) throw AssertionError() - if (!(element10 in 3 .. 1) != !range1.contains(element10)) throw AssertionError() - if (!(element10 !in 3 .. 1) != range1.contains(element10)) throw AssertionError() -} - -fun testR1xE11() { - // with possible local optimizations - if (1.toLong() in 3 .. 1 != range1.contains(1.toLong())) throw AssertionError() - if (1.toLong() !in 3 .. 1 != !range1.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() in 3 .. 1) != !range1.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() !in 3 .. 1) != range1.contains(1.toLong())) throw AssertionError() - // no local optimizations - if (element11 in 3 .. 1 != range1.contains(element11)) throw AssertionError() - if (element11 !in 3 .. 1 != !range1.contains(element11)) throw AssertionError() - if (!(element11 in 3 .. 1) != !range1.contains(element11)) throw AssertionError() - if (!(element11 !in 3 .. 1) != range1.contains(element11)) throw AssertionError() -} - -fun testR1xE12() { - // with possible local optimizations - if (2.toByte() in 3 .. 1 != range1.contains(2.toByte())) throw AssertionError() - if (2.toByte() !in 3 .. 1 != !range1.contains(2.toByte())) throw AssertionError() - if (!(2.toByte() in 3 .. 1) != !range1.contains(2.toByte())) throw AssertionError() - if (!(2.toByte() !in 3 .. 1) != range1.contains(2.toByte())) throw AssertionError() - // no local optimizations - if (element12 in 3 .. 1 != range1.contains(element12)) throw AssertionError() - if (element12 !in 3 .. 1 != !range1.contains(element12)) throw AssertionError() - if (!(element12 in 3 .. 1) != !range1.contains(element12)) throw AssertionError() - if (!(element12 !in 3 .. 1) != range1.contains(element12)) throw AssertionError() -} - -fun testR1xE13() { - // with possible local optimizations - if (2.toShort() in 3 .. 1 != range1.contains(2.toShort())) throw AssertionError() - if (2.toShort() !in 3 .. 1 != !range1.contains(2.toShort())) throw AssertionError() - if (!(2.toShort() in 3 .. 1) != !range1.contains(2.toShort())) throw AssertionError() - if (!(2.toShort() !in 3 .. 1) != range1.contains(2.toShort())) throw AssertionError() - // no local optimizations - if (element13 in 3 .. 1 != range1.contains(element13)) throw AssertionError() - if (element13 !in 3 .. 1 != !range1.contains(element13)) throw AssertionError() - if (!(element13 in 3 .. 1) != !range1.contains(element13)) throw AssertionError() - if (!(element13 !in 3 .. 1) != range1.contains(element13)) throw AssertionError() -} - -fun testR1xE14() { - // with possible local optimizations - if (2 in 3 .. 1 != range1.contains(2)) throw AssertionError() - if (2 !in 3 .. 1 != !range1.contains(2)) throw AssertionError() - if (!(2 in 3 .. 1) != !range1.contains(2)) throw AssertionError() - if (!(2 !in 3 .. 1) != range1.contains(2)) throw AssertionError() - // no local optimizations - if (element14 in 3 .. 1 != range1.contains(element14)) throw AssertionError() - if (element14 !in 3 .. 1 != !range1.contains(element14)) throw AssertionError() - if (!(element14 in 3 .. 1) != !range1.contains(element14)) throw AssertionError() - if (!(element14 !in 3 .. 1) != range1.contains(element14)) throw AssertionError() -} - -fun testR1xE15() { - // with possible local optimizations - if (2.toLong() in 3 .. 1 != range1.contains(2.toLong())) throw AssertionError() - if (2.toLong() !in 3 .. 1 != !range1.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() in 3 .. 1) != !range1.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() !in 3 .. 1) != range1.contains(2.toLong())) throw AssertionError() - // no local optimizations - if (element15 in 3 .. 1 != range1.contains(element15)) throw AssertionError() - if (element15 !in 3 .. 1 != !range1.contains(element15)) throw AssertionError() - if (!(element15 in 3 .. 1) != !range1.contains(element15)) throw AssertionError() - if (!(element15 !in 3 .. 1) != range1.contains(element15)) throw AssertionError() -} - -fun testR1xE16() { - // with possible local optimizations - if (3.toByte() in 3 .. 1 != range1.contains(3.toByte())) throw AssertionError() - if (3.toByte() !in 3 .. 1 != !range1.contains(3.toByte())) throw AssertionError() - if (!(3.toByte() in 3 .. 1) != !range1.contains(3.toByte())) throw AssertionError() - if (!(3.toByte() !in 3 .. 1) != range1.contains(3.toByte())) throw AssertionError() - // no local optimizations - if (element16 in 3 .. 1 != range1.contains(element16)) throw AssertionError() - if (element16 !in 3 .. 1 != !range1.contains(element16)) throw AssertionError() - if (!(element16 in 3 .. 1) != !range1.contains(element16)) throw AssertionError() - if (!(element16 !in 3 .. 1) != range1.contains(element16)) throw AssertionError() -} - -fun testR1xE17() { - // with possible local optimizations - if (3.toShort() in 3 .. 1 != range1.contains(3.toShort())) throw AssertionError() - if (3.toShort() !in 3 .. 1 != !range1.contains(3.toShort())) throw AssertionError() - if (!(3.toShort() in 3 .. 1) != !range1.contains(3.toShort())) throw AssertionError() - if (!(3.toShort() !in 3 .. 1) != range1.contains(3.toShort())) throw AssertionError() - // no local optimizations - if (element17 in 3 .. 1 != range1.contains(element17)) throw AssertionError() - if (element17 !in 3 .. 1 != !range1.contains(element17)) throw AssertionError() - if (!(element17 in 3 .. 1) != !range1.contains(element17)) throw AssertionError() - if (!(element17 !in 3 .. 1) != range1.contains(element17)) throw AssertionError() -} - -fun testR1xE18() { - // with possible local optimizations - if (3 in 3 .. 1 != range1.contains(3)) throw AssertionError() - if (3 !in 3 .. 1 != !range1.contains(3)) throw AssertionError() - if (!(3 in 3 .. 1) != !range1.contains(3)) throw AssertionError() - if (!(3 !in 3 .. 1) != range1.contains(3)) throw AssertionError() - // no local optimizations - if (element18 in 3 .. 1 != range1.contains(element18)) throw AssertionError() - if (element18 !in 3 .. 1 != !range1.contains(element18)) throw AssertionError() - if (!(element18 in 3 .. 1) != !range1.contains(element18)) throw AssertionError() - if (!(element18 !in 3 .. 1) != range1.contains(element18)) throw AssertionError() -} - -fun testR1xE19() { - // with possible local optimizations - if (3.toLong() in 3 .. 1 != range1.contains(3.toLong())) throw AssertionError() - if (3.toLong() !in 3 .. 1 != !range1.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() in 3 .. 1) != !range1.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() !in 3 .. 1) != range1.contains(3.toLong())) throw AssertionError() - // no local optimizations - if (element19 in 3 .. 1 != range1.contains(element19)) throw AssertionError() - if (element19 !in 3 .. 1 != !range1.contains(element19)) throw AssertionError() - if (!(element19 in 3 .. 1) != !range1.contains(element19)) throw AssertionError() - if (!(element19 !in 3 .. 1) != range1.contains(element19)) throw AssertionError() -} - -fun testR1xE20() { - // with possible local optimizations - if (4.toByte() in 3 .. 1 != range1.contains(4.toByte())) throw AssertionError() - if (4.toByte() !in 3 .. 1 != !range1.contains(4.toByte())) throw AssertionError() - if (!(4.toByte() in 3 .. 1) != !range1.contains(4.toByte())) throw AssertionError() - if (!(4.toByte() !in 3 .. 1) != range1.contains(4.toByte())) throw AssertionError() - // no local optimizations - if (element20 in 3 .. 1 != range1.contains(element20)) throw AssertionError() - if (element20 !in 3 .. 1 != !range1.contains(element20)) throw AssertionError() - if (!(element20 in 3 .. 1) != !range1.contains(element20)) throw AssertionError() - if (!(element20 !in 3 .. 1) != range1.contains(element20)) throw AssertionError() -} - -fun testR1xE21() { - // with possible local optimizations - if (4.toShort() in 3 .. 1 != range1.contains(4.toShort())) throw AssertionError() - if (4.toShort() !in 3 .. 1 != !range1.contains(4.toShort())) throw AssertionError() - if (!(4.toShort() in 3 .. 1) != !range1.contains(4.toShort())) throw AssertionError() - if (!(4.toShort() !in 3 .. 1) != range1.contains(4.toShort())) throw AssertionError() - // no local optimizations - if (element21 in 3 .. 1 != range1.contains(element21)) throw AssertionError() - if (element21 !in 3 .. 1 != !range1.contains(element21)) throw AssertionError() - if (!(element21 in 3 .. 1) != !range1.contains(element21)) throw AssertionError() - if (!(element21 !in 3 .. 1) != range1.contains(element21)) throw AssertionError() -} - -fun testR1xE22() { - // with possible local optimizations - if (4 in 3 .. 1 != range1.contains(4)) throw AssertionError() - if (4 !in 3 .. 1 != !range1.contains(4)) throw AssertionError() - if (!(4 in 3 .. 1) != !range1.contains(4)) throw AssertionError() - if (!(4 !in 3 .. 1) != range1.contains(4)) throw AssertionError() - // no local optimizations - if (element22 in 3 .. 1 != range1.contains(element22)) throw AssertionError() - if (element22 !in 3 .. 1 != !range1.contains(element22)) throw AssertionError() - if (!(element22 in 3 .. 1) != !range1.contains(element22)) throw AssertionError() - if (!(element22 !in 3 .. 1) != range1.contains(element22)) throw AssertionError() -} - -fun testR1xE23() { - // with possible local optimizations - if (4.toLong() in 3 .. 1 != range1.contains(4.toLong())) throw AssertionError() - if (4.toLong() !in 3 .. 1 != !range1.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() in 3 .. 1) != !range1.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() !in 3 .. 1) != range1.contains(4.toLong())) throw AssertionError() - // no local optimizations - if (element23 in 3 .. 1 != range1.contains(element23)) throw AssertionError() - if (element23 !in 3 .. 1 != !range1.contains(element23)) throw AssertionError() - if (!(element23 in 3 .. 1) != !range1.contains(element23)) throw AssertionError() - if (!(element23 !in 3 .. 1) != range1.contains(element23)) throw AssertionError() -} - - diff --git a/compiler/testData/codegen/box/ranges/contains/generated/intRangeTo.kt b/compiler/testData/codegen/box/ranges/contains/generated/intRangeTo.kt new file mode 100644 index 00000000000..7fc076fba91 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/contains/generated/intRangeTo.kt @@ -0,0 +1,710 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_STDLIB + + + +val range0 = 1..3 +val range1 = 3..1 + +val element0 = (-1).toByte() +val element1 = (-1).toShort() +val element2 = -1 +val element3 = -1L +val element4 = 0.toByte() +val element5 = 0.toShort() +val element6 = 0 +val element7 = 0L +val element8 = 1.toByte() +val element9 = 1.toShort() +val element10 = 1 +val element11 = 1L +val element12 = 2.toByte() +val element13 = 2.toShort() +val element14 = 2 +val element15 = 2L +val element16 = 3.toByte() +val element17 = 3.toShort() +val element18 = 3 +val element19 = 3L +val element20 = 4.toByte() +val element21 = 4.toShort() +val element22 = 4 +val element23 = 4L + +fun box(): String { + testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR0xE5() + testR0xE6() + testR0xE7() + testR0xE8() + testR0xE9() + testR0xE10() + testR0xE11() + testR0xE12() + testR0xE13() + testR0xE14() + testR0xE15() + testR0xE16() + testR0xE17() + testR0xE18() + testR0xE19() + testR0xE20() + testR0xE21() + testR0xE22() + testR0xE23() + testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + testR1xE5() + testR1xE6() + testR1xE7() + testR1xE8() + testR1xE9() + testR1xE10() + testR1xE11() + testR1xE12() + testR1xE13() + testR1xE14() + testR1xE15() + testR1xE16() + testR1xE17() + testR1xE18() + testR1xE19() + testR1xE20() + testR1xE21() + testR1xE22() + testR1xE23() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if ((-1).toByte() in 1..3 != range0.contains((-1).toByte())) throw AssertionError() + if ((-1).toByte() !in 1..3 != !range0.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() in 1..3) != !range0.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() !in 1..3) != range0.contains((-1).toByte())) throw AssertionError() + // no local optimizations + if (element0 in 1..3 != range0.contains(element0)) throw AssertionError() + if (element0 !in 1..3 != !range0.contains(element0)) throw AssertionError() + if (!(element0 in 1..3) != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in 1..3) != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if ((-1).toShort() in 1..3 != range0.contains((-1).toShort())) throw AssertionError() + if ((-1).toShort() !in 1..3 != !range0.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() in 1..3) != !range0.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() !in 1..3) != range0.contains((-1).toShort())) throw AssertionError() + // no local optimizations + if (element1 in 1..3 != range0.contains(element1)) throw AssertionError() + if (element1 !in 1..3 != !range0.contains(element1)) throw AssertionError() + if (!(element1 in 1..3) != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in 1..3) != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if (-1 in 1..3 != range0.contains(-1)) throw AssertionError() + if (-1 !in 1..3 != !range0.contains(-1)) throw AssertionError() + if (!(-1 in 1..3) != !range0.contains(-1)) throw AssertionError() + if (!(-1 !in 1..3) != range0.contains(-1)) throw AssertionError() + // no local optimizations + if (element2 in 1..3 != range0.contains(element2)) throw AssertionError() + if (element2 !in 1..3 != !range0.contains(element2)) throw AssertionError() + if (!(element2 in 1..3) != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in 1..3) != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if (-1L in 1..3 != range0.contains(-1L)) throw AssertionError() + if (-1L !in 1..3 != !range0.contains(-1L)) throw AssertionError() + if (!(-1L in 1..3) != !range0.contains(-1L)) throw AssertionError() + if (!(-1L !in 1..3) != range0.contains(-1L)) throw AssertionError() + // no local optimizations + if (element3 in 1..3 != range0.contains(element3)) throw AssertionError() + if (element3 !in 1..3 != !range0.contains(element3)) throw AssertionError() + if (!(element3 in 1..3) != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in 1..3) != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if (0.toByte() in 1..3 != range0.contains(0.toByte())) throw AssertionError() + if (0.toByte() !in 1..3 != !range0.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() in 1..3) != !range0.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() !in 1..3) != range0.contains(0.toByte())) throw AssertionError() + // no local optimizations + if (element4 in 1..3 != range0.contains(element4)) throw AssertionError() + if (element4 !in 1..3 != !range0.contains(element4)) throw AssertionError() + if (!(element4 in 1..3) != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in 1..3) != range0.contains(element4)) throw AssertionError() +} + +fun testR0xE5() { + // with possible local optimizations + if (0.toShort() in 1..3 != range0.contains(0.toShort())) throw AssertionError() + if (0.toShort() !in 1..3 != !range0.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() in 1..3) != !range0.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() !in 1..3) != range0.contains(0.toShort())) throw AssertionError() + // no local optimizations + if (element5 in 1..3 != range0.contains(element5)) throw AssertionError() + if (element5 !in 1..3 != !range0.contains(element5)) throw AssertionError() + if (!(element5 in 1..3) != !range0.contains(element5)) throw AssertionError() + if (!(element5 !in 1..3) != range0.contains(element5)) throw AssertionError() +} + +fun testR0xE6() { + // with possible local optimizations + if (0 in 1..3 != range0.contains(0)) throw AssertionError() + if (0 !in 1..3 != !range0.contains(0)) throw AssertionError() + if (!(0 in 1..3) != !range0.contains(0)) throw AssertionError() + if (!(0 !in 1..3) != range0.contains(0)) throw AssertionError() + // no local optimizations + if (element6 in 1..3 != range0.contains(element6)) throw AssertionError() + if (element6 !in 1..3 != !range0.contains(element6)) throw AssertionError() + if (!(element6 in 1..3) != !range0.contains(element6)) throw AssertionError() + if (!(element6 !in 1..3) != range0.contains(element6)) throw AssertionError() +} + +fun testR0xE7() { + // with possible local optimizations + if (0L in 1..3 != range0.contains(0L)) throw AssertionError() + if (0L !in 1..3 != !range0.contains(0L)) throw AssertionError() + if (!(0L in 1..3) != !range0.contains(0L)) throw AssertionError() + if (!(0L !in 1..3) != range0.contains(0L)) throw AssertionError() + // no local optimizations + if (element7 in 1..3 != range0.contains(element7)) throw AssertionError() + if (element7 !in 1..3 != !range0.contains(element7)) throw AssertionError() + if (!(element7 in 1..3) != !range0.contains(element7)) throw AssertionError() + if (!(element7 !in 1..3) != range0.contains(element7)) throw AssertionError() +} + +fun testR0xE8() { + // with possible local optimizations + if (1.toByte() in 1..3 != range0.contains(1.toByte())) throw AssertionError() + if (1.toByte() !in 1..3 != !range0.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() in 1..3) != !range0.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() !in 1..3) != range0.contains(1.toByte())) throw AssertionError() + // no local optimizations + if (element8 in 1..3 != range0.contains(element8)) throw AssertionError() + if (element8 !in 1..3 != !range0.contains(element8)) throw AssertionError() + if (!(element8 in 1..3) != !range0.contains(element8)) throw AssertionError() + if (!(element8 !in 1..3) != range0.contains(element8)) throw AssertionError() +} + +fun testR0xE9() { + // with possible local optimizations + if (1.toShort() in 1..3 != range0.contains(1.toShort())) throw AssertionError() + if (1.toShort() !in 1..3 != !range0.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() in 1..3) != !range0.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() !in 1..3) != range0.contains(1.toShort())) throw AssertionError() + // no local optimizations + if (element9 in 1..3 != range0.contains(element9)) throw AssertionError() + if (element9 !in 1..3 != !range0.contains(element9)) throw AssertionError() + if (!(element9 in 1..3) != !range0.contains(element9)) throw AssertionError() + if (!(element9 !in 1..3) != range0.contains(element9)) throw AssertionError() +} + +fun testR0xE10() { + // with possible local optimizations + if (1 in 1..3 != range0.contains(1)) throw AssertionError() + if (1 !in 1..3 != !range0.contains(1)) throw AssertionError() + if (!(1 in 1..3) != !range0.contains(1)) throw AssertionError() + if (!(1 !in 1..3) != range0.contains(1)) throw AssertionError() + // no local optimizations + if (element10 in 1..3 != range0.contains(element10)) throw AssertionError() + if (element10 !in 1..3 != !range0.contains(element10)) throw AssertionError() + if (!(element10 in 1..3) != !range0.contains(element10)) throw AssertionError() + if (!(element10 !in 1..3) != range0.contains(element10)) throw AssertionError() +} + +fun testR0xE11() { + // with possible local optimizations + if (1L in 1..3 != range0.contains(1L)) throw AssertionError() + if (1L !in 1..3 != !range0.contains(1L)) throw AssertionError() + if (!(1L in 1..3) != !range0.contains(1L)) throw AssertionError() + if (!(1L !in 1..3) != range0.contains(1L)) throw AssertionError() + // no local optimizations + if (element11 in 1..3 != range0.contains(element11)) throw AssertionError() + if (element11 !in 1..3 != !range0.contains(element11)) throw AssertionError() + if (!(element11 in 1..3) != !range0.contains(element11)) throw AssertionError() + if (!(element11 !in 1..3) != range0.contains(element11)) throw AssertionError() +} + +fun testR0xE12() { + // with possible local optimizations + if (2.toByte() in 1..3 != range0.contains(2.toByte())) throw AssertionError() + if (2.toByte() !in 1..3 != !range0.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() in 1..3) != !range0.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() !in 1..3) != range0.contains(2.toByte())) throw AssertionError() + // no local optimizations + if (element12 in 1..3 != range0.contains(element12)) throw AssertionError() + if (element12 !in 1..3 != !range0.contains(element12)) throw AssertionError() + if (!(element12 in 1..3) != !range0.contains(element12)) throw AssertionError() + if (!(element12 !in 1..3) != range0.contains(element12)) throw AssertionError() +} + +fun testR0xE13() { + // with possible local optimizations + if (2.toShort() in 1..3 != range0.contains(2.toShort())) throw AssertionError() + if (2.toShort() !in 1..3 != !range0.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() in 1..3) != !range0.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() !in 1..3) != range0.contains(2.toShort())) throw AssertionError() + // no local optimizations + if (element13 in 1..3 != range0.contains(element13)) throw AssertionError() + if (element13 !in 1..3 != !range0.contains(element13)) throw AssertionError() + if (!(element13 in 1..3) != !range0.contains(element13)) throw AssertionError() + if (!(element13 !in 1..3) != range0.contains(element13)) throw AssertionError() +} + +fun testR0xE14() { + // with possible local optimizations + if (2 in 1..3 != range0.contains(2)) throw AssertionError() + if (2 !in 1..3 != !range0.contains(2)) throw AssertionError() + if (!(2 in 1..3) != !range0.contains(2)) throw AssertionError() + if (!(2 !in 1..3) != range0.contains(2)) throw AssertionError() + // no local optimizations + if (element14 in 1..3 != range0.contains(element14)) throw AssertionError() + if (element14 !in 1..3 != !range0.contains(element14)) throw AssertionError() + if (!(element14 in 1..3) != !range0.contains(element14)) throw AssertionError() + if (!(element14 !in 1..3) != range0.contains(element14)) throw AssertionError() +} + +fun testR0xE15() { + // with possible local optimizations + if (2L in 1..3 != range0.contains(2L)) throw AssertionError() + if (2L !in 1..3 != !range0.contains(2L)) throw AssertionError() + if (!(2L in 1..3) != !range0.contains(2L)) throw AssertionError() + if (!(2L !in 1..3) != range0.contains(2L)) throw AssertionError() + // no local optimizations + if (element15 in 1..3 != range0.contains(element15)) throw AssertionError() + if (element15 !in 1..3 != !range0.contains(element15)) throw AssertionError() + if (!(element15 in 1..3) != !range0.contains(element15)) throw AssertionError() + if (!(element15 !in 1..3) != range0.contains(element15)) throw AssertionError() +} + +fun testR0xE16() { + // with possible local optimizations + if (3.toByte() in 1..3 != range0.contains(3.toByte())) throw AssertionError() + if (3.toByte() !in 1..3 != !range0.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() in 1..3) != !range0.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() !in 1..3) != range0.contains(3.toByte())) throw AssertionError() + // no local optimizations + if (element16 in 1..3 != range0.contains(element16)) throw AssertionError() + if (element16 !in 1..3 != !range0.contains(element16)) throw AssertionError() + if (!(element16 in 1..3) != !range0.contains(element16)) throw AssertionError() + if (!(element16 !in 1..3) != range0.contains(element16)) throw AssertionError() +} + +fun testR0xE17() { + // with possible local optimizations + if (3.toShort() in 1..3 != range0.contains(3.toShort())) throw AssertionError() + if (3.toShort() !in 1..3 != !range0.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() in 1..3) != !range0.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() !in 1..3) != range0.contains(3.toShort())) throw AssertionError() + // no local optimizations + if (element17 in 1..3 != range0.contains(element17)) throw AssertionError() + if (element17 !in 1..3 != !range0.contains(element17)) throw AssertionError() + if (!(element17 in 1..3) != !range0.contains(element17)) throw AssertionError() + if (!(element17 !in 1..3) != range0.contains(element17)) throw AssertionError() +} + +fun testR0xE18() { + // with possible local optimizations + if (3 in 1..3 != range0.contains(3)) throw AssertionError() + if (3 !in 1..3 != !range0.contains(3)) throw AssertionError() + if (!(3 in 1..3) != !range0.contains(3)) throw AssertionError() + if (!(3 !in 1..3) != range0.contains(3)) throw AssertionError() + // no local optimizations + if (element18 in 1..3 != range0.contains(element18)) throw AssertionError() + if (element18 !in 1..3 != !range0.contains(element18)) throw AssertionError() + if (!(element18 in 1..3) != !range0.contains(element18)) throw AssertionError() + if (!(element18 !in 1..3) != range0.contains(element18)) throw AssertionError() +} + +fun testR0xE19() { + // with possible local optimizations + if (3L in 1..3 != range0.contains(3L)) throw AssertionError() + if (3L !in 1..3 != !range0.contains(3L)) throw AssertionError() + if (!(3L in 1..3) != !range0.contains(3L)) throw AssertionError() + if (!(3L !in 1..3) != range0.contains(3L)) throw AssertionError() + // no local optimizations + if (element19 in 1..3 != range0.contains(element19)) throw AssertionError() + if (element19 !in 1..3 != !range0.contains(element19)) throw AssertionError() + if (!(element19 in 1..3) != !range0.contains(element19)) throw AssertionError() + if (!(element19 !in 1..3) != range0.contains(element19)) throw AssertionError() +} + +fun testR0xE20() { + // with possible local optimizations + if (4.toByte() in 1..3 != range0.contains(4.toByte())) throw AssertionError() + if (4.toByte() !in 1..3 != !range0.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() in 1..3) != !range0.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() !in 1..3) != range0.contains(4.toByte())) throw AssertionError() + // no local optimizations + if (element20 in 1..3 != range0.contains(element20)) throw AssertionError() + if (element20 !in 1..3 != !range0.contains(element20)) throw AssertionError() + if (!(element20 in 1..3) != !range0.contains(element20)) throw AssertionError() + if (!(element20 !in 1..3) != range0.contains(element20)) throw AssertionError() +} + +fun testR0xE21() { + // with possible local optimizations + if (4.toShort() in 1..3 != range0.contains(4.toShort())) throw AssertionError() + if (4.toShort() !in 1..3 != !range0.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() in 1..3) != !range0.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() !in 1..3) != range0.contains(4.toShort())) throw AssertionError() + // no local optimizations + if (element21 in 1..3 != range0.contains(element21)) throw AssertionError() + if (element21 !in 1..3 != !range0.contains(element21)) throw AssertionError() + if (!(element21 in 1..3) != !range0.contains(element21)) throw AssertionError() + if (!(element21 !in 1..3) != range0.contains(element21)) throw AssertionError() +} + +fun testR0xE22() { + // with possible local optimizations + if (4 in 1..3 != range0.contains(4)) throw AssertionError() + if (4 !in 1..3 != !range0.contains(4)) throw AssertionError() + if (!(4 in 1..3) != !range0.contains(4)) throw AssertionError() + if (!(4 !in 1..3) != range0.contains(4)) throw AssertionError() + // no local optimizations + if (element22 in 1..3 != range0.contains(element22)) throw AssertionError() + if (element22 !in 1..3 != !range0.contains(element22)) throw AssertionError() + if (!(element22 in 1..3) != !range0.contains(element22)) throw AssertionError() + if (!(element22 !in 1..3) != range0.contains(element22)) throw AssertionError() +} + +fun testR0xE23() { + // with possible local optimizations + if (4L in 1..3 != range0.contains(4L)) throw AssertionError() + if (4L !in 1..3 != !range0.contains(4L)) throw AssertionError() + if (!(4L in 1..3) != !range0.contains(4L)) throw AssertionError() + if (!(4L !in 1..3) != range0.contains(4L)) throw AssertionError() + // no local optimizations + if (element23 in 1..3 != range0.contains(element23)) throw AssertionError() + if (element23 !in 1..3 != !range0.contains(element23)) throw AssertionError() + if (!(element23 in 1..3) != !range0.contains(element23)) throw AssertionError() + if (!(element23 !in 1..3) != range0.contains(element23)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if ((-1).toByte() in 3..1 != range1.contains((-1).toByte())) throw AssertionError() + if ((-1).toByte() !in 3..1 != !range1.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() in 3..1) != !range1.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() !in 3..1) != range1.contains((-1).toByte())) throw AssertionError() + // no local optimizations + if (element0 in 3..1 != range1.contains(element0)) throw AssertionError() + if (element0 !in 3..1 != !range1.contains(element0)) throw AssertionError() + if (!(element0 in 3..1) != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in 3..1) != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if ((-1).toShort() in 3..1 != range1.contains((-1).toShort())) throw AssertionError() + if ((-1).toShort() !in 3..1 != !range1.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() in 3..1) != !range1.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() !in 3..1) != range1.contains((-1).toShort())) throw AssertionError() + // no local optimizations + if (element1 in 3..1 != range1.contains(element1)) throw AssertionError() + if (element1 !in 3..1 != !range1.contains(element1)) throw AssertionError() + if (!(element1 in 3..1) != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in 3..1) != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if (-1 in 3..1 != range1.contains(-1)) throw AssertionError() + if (-1 !in 3..1 != !range1.contains(-1)) throw AssertionError() + if (!(-1 in 3..1) != !range1.contains(-1)) throw AssertionError() + if (!(-1 !in 3..1) != range1.contains(-1)) throw AssertionError() + // no local optimizations + if (element2 in 3..1 != range1.contains(element2)) throw AssertionError() + if (element2 !in 3..1 != !range1.contains(element2)) throw AssertionError() + if (!(element2 in 3..1) != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in 3..1) != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if (-1L in 3..1 != range1.contains(-1L)) throw AssertionError() + if (-1L !in 3..1 != !range1.contains(-1L)) throw AssertionError() + if (!(-1L in 3..1) != !range1.contains(-1L)) throw AssertionError() + if (!(-1L !in 3..1) != range1.contains(-1L)) throw AssertionError() + // no local optimizations + if (element3 in 3..1 != range1.contains(element3)) throw AssertionError() + if (element3 !in 3..1 != !range1.contains(element3)) throw AssertionError() + if (!(element3 in 3..1) != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in 3..1) != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if (0.toByte() in 3..1 != range1.contains(0.toByte())) throw AssertionError() + if (0.toByte() !in 3..1 != !range1.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() in 3..1) != !range1.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() !in 3..1) != range1.contains(0.toByte())) throw AssertionError() + // no local optimizations + if (element4 in 3..1 != range1.contains(element4)) throw AssertionError() + if (element4 !in 3..1 != !range1.contains(element4)) throw AssertionError() + if (!(element4 in 3..1) != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in 3..1) != range1.contains(element4)) throw AssertionError() +} + +fun testR1xE5() { + // with possible local optimizations + if (0.toShort() in 3..1 != range1.contains(0.toShort())) throw AssertionError() + if (0.toShort() !in 3..1 != !range1.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() in 3..1) != !range1.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() !in 3..1) != range1.contains(0.toShort())) throw AssertionError() + // no local optimizations + if (element5 in 3..1 != range1.contains(element5)) throw AssertionError() + if (element5 !in 3..1 != !range1.contains(element5)) throw AssertionError() + if (!(element5 in 3..1) != !range1.contains(element5)) throw AssertionError() + if (!(element5 !in 3..1) != range1.contains(element5)) throw AssertionError() +} + +fun testR1xE6() { + // with possible local optimizations + if (0 in 3..1 != range1.contains(0)) throw AssertionError() + if (0 !in 3..1 != !range1.contains(0)) throw AssertionError() + if (!(0 in 3..1) != !range1.contains(0)) throw AssertionError() + if (!(0 !in 3..1) != range1.contains(0)) throw AssertionError() + // no local optimizations + if (element6 in 3..1 != range1.contains(element6)) throw AssertionError() + if (element6 !in 3..1 != !range1.contains(element6)) throw AssertionError() + if (!(element6 in 3..1) != !range1.contains(element6)) throw AssertionError() + if (!(element6 !in 3..1) != range1.contains(element6)) throw AssertionError() +} + +fun testR1xE7() { + // with possible local optimizations + if (0L in 3..1 != range1.contains(0L)) throw AssertionError() + if (0L !in 3..1 != !range1.contains(0L)) throw AssertionError() + if (!(0L in 3..1) != !range1.contains(0L)) throw AssertionError() + if (!(0L !in 3..1) != range1.contains(0L)) throw AssertionError() + // no local optimizations + if (element7 in 3..1 != range1.contains(element7)) throw AssertionError() + if (element7 !in 3..1 != !range1.contains(element7)) throw AssertionError() + if (!(element7 in 3..1) != !range1.contains(element7)) throw AssertionError() + if (!(element7 !in 3..1) != range1.contains(element7)) throw AssertionError() +} + +fun testR1xE8() { + // with possible local optimizations + if (1.toByte() in 3..1 != range1.contains(1.toByte())) throw AssertionError() + if (1.toByte() !in 3..1 != !range1.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() in 3..1) != !range1.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() !in 3..1) != range1.contains(1.toByte())) throw AssertionError() + // no local optimizations + if (element8 in 3..1 != range1.contains(element8)) throw AssertionError() + if (element8 !in 3..1 != !range1.contains(element8)) throw AssertionError() + if (!(element8 in 3..1) != !range1.contains(element8)) throw AssertionError() + if (!(element8 !in 3..1) != range1.contains(element8)) throw AssertionError() +} + +fun testR1xE9() { + // with possible local optimizations + if (1.toShort() in 3..1 != range1.contains(1.toShort())) throw AssertionError() + if (1.toShort() !in 3..1 != !range1.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() in 3..1) != !range1.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() !in 3..1) != range1.contains(1.toShort())) throw AssertionError() + // no local optimizations + if (element9 in 3..1 != range1.contains(element9)) throw AssertionError() + if (element9 !in 3..1 != !range1.contains(element9)) throw AssertionError() + if (!(element9 in 3..1) != !range1.contains(element9)) throw AssertionError() + if (!(element9 !in 3..1) != range1.contains(element9)) throw AssertionError() +} + +fun testR1xE10() { + // with possible local optimizations + if (1 in 3..1 != range1.contains(1)) throw AssertionError() + if (1 !in 3..1 != !range1.contains(1)) throw AssertionError() + if (!(1 in 3..1) != !range1.contains(1)) throw AssertionError() + if (!(1 !in 3..1) != range1.contains(1)) throw AssertionError() + // no local optimizations + if (element10 in 3..1 != range1.contains(element10)) throw AssertionError() + if (element10 !in 3..1 != !range1.contains(element10)) throw AssertionError() + if (!(element10 in 3..1) != !range1.contains(element10)) throw AssertionError() + if (!(element10 !in 3..1) != range1.contains(element10)) throw AssertionError() +} + +fun testR1xE11() { + // with possible local optimizations + if (1L in 3..1 != range1.contains(1L)) throw AssertionError() + if (1L !in 3..1 != !range1.contains(1L)) throw AssertionError() + if (!(1L in 3..1) != !range1.contains(1L)) throw AssertionError() + if (!(1L !in 3..1) != range1.contains(1L)) throw AssertionError() + // no local optimizations + if (element11 in 3..1 != range1.contains(element11)) throw AssertionError() + if (element11 !in 3..1 != !range1.contains(element11)) throw AssertionError() + if (!(element11 in 3..1) != !range1.contains(element11)) throw AssertionError() + if (!(element11 !in 3..1) != range1.contains(element11)) throw AssertionError() +} + +fun testR1xE12() { + // with possible local optimizations + if (2.toByte() in 3..1 != range1.contains(2.toByte())) throw AssertionError() + if (2.toByte() !in 3..1 != !range1.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() in 3..1) != !range1.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() !in 3..1) != range1.contains(2.toByte())) throw AssertionError() + // no local optimizations + if (element12 in 3..1 != range1.contains(element12)) throw AssertionError() + if (element12 !in 3..1 != !range1.contains(element12)) throw AssertionError() + if (!(element12 in 3..1) != !range1.contains(element12)) throw AssertionError() + if (!(element12 !in 3..1) != range1.contains(element12)) throw AssertionError() +} + +fun testR1xE13() { + // with possible local optimizations + if (2.toShort() in 3..1 != range1.contains(2.toShort())) throw AssertionError() + if (2.toShort() !in 3..1 != !range1.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() in 3..1) != !range1.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() !in 3..1) != range1.contains(2.toShort())) throw AssertionError() + // no local optimizations + if (element13 in 3..1 != range1.contains(element13)) throw AssertionError() + if (element13 !in 3..1 != !range1.contains(element13)) throw AssertionError() + if (!(element13 in 3..1) != !range1.contains(element13)) throw AssertionError() + if (!(element13 !in 3..1) != range1.contains(element13)) throw AssertionError() +} + +fun testR1xE14() { + // with possible local optimizations + if (2 in 3..1 != range1.contains(2)) throw AssertionError() + if (2 !in 3..1 != !range1.contains(2)) throw AssertionError() + if (!(2 in 3..1) != !range1.contains(2)) throw AssertionError() + if (!(2 !in 3..1) != range1.contains(2)) throw AssertionError() + // no local optimizations + if (element14 in 3..1 != range1.contains(element14)) throw AssertionError() + if (element14 !in 3..1 != !range1.contains(element14)) throw AssertionError() + if (!(element14 in 3..1) != !range1.contains(element14)) throw AssertionError() + if (!(element14 !in 3..1) != range1.contains(element14)) throw AssertionError() +} + +fun testR1xE15() { + // with possible local optimizations + if (2L in 3..1 != range1.contains(2L)) throw AssertionError() + if (2L !in 3..1 != !range1.contains(2L)) throw AssertionError() + if (!(2L in 3..1) != !range1.contains(2L)) throw AssertionError() + if (!(2L !in 3..1) != range1.contains(2L)) throw AssertionError() + // no local optimizations + if (element15 in 3..1 != range1.contains(element15)) throw AssertionError() + if (element15 !in 3..1 != !range1.contains(element15)) throw AssertionError() + if (!(element15 in 3..1) != !range1.contains(element15)) throw AssertionError() + if (!(element15 !in 3..1) != range1.contains(element15)) throw AssertionError() +} + +fun testR1xE16() { + // with possible local optimizations + if (3.toByte() in 3..1 != range1.contains(3.toByte())) throw AssertionError() + if (3.toByte() !in 3..1 != !range1.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() in 3..1) != !range1.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() !in 3..1) != range1.contains(3.toByte())) throw AssertionError() + // no local optimizations + if (element16 in 3..1 != range1.contains(element16)) throw AssertionError() + if (element16 !in 3..1 != !range1.contains(element16)) throw AssertionError() + if (!(element16 in 3..1) != !range1.contains(element16)) throw AssertionError() + if (!(element16 !in 3..1) != range1.contains(element16)) throw AssertionError() +} + +fun testR1xE17() { + // with possible local optimizations + if (3.toShort() in 3..1 != range1.contains(3.toShort())) throw AssertionError() + if (3.toShort() !in 3..1 != !range1.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() in 3..1) != !range1.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() !in 3..1) != range1.contains(3.toShort())) throw AssertionError() + // no local optimizations + if (element17 in 3..1 != range1.contains(element17)) throw AssertionError() + if (element17 !in 3..1 != !range1.contains(element17)) throw AssertionError() + if (!(element17 in 3..1) != !range1.contains(element17)) throw AssertionError() + if (!(element17 !in 3..1) != range1.contains(element17)) throw AssertionError() +} + +fun testR1xE18() { + // with possible local optimizations + if (3 in 3..1 != range1.contains(3)) throw AssertionError() + if (3 !in 3..1 != !range1.contains(3)) throw AssertionError() + if (!(3 in 3..1) != !range1.contains(3)) throw AssertionError() + if (!(3 !in 3..1) != range1.contains(3)) throw AssertionError() + // no local optimizations + if (element18 in 3..1 != range1.contains(element18)) throw AssertionError() + if (element18 !in 3..1 != !range1.contains(element18)) throw AssertionError() + if (!(element18 in 3..1) != !range1.contains(element18)) throw AssertionError() + if (!(element18 !in 3..1) != range1.contains(element18)) throw AssertionError() +} + +fun testR1xE19() { + // with possible local optimizations + if (3L in 3..1 != range1.contains(3L)) throw AssertionError() + if (3L !in 3..1 != !range1.contains(3L)) throw AssertionError() + if (!(3L in 3..1) != !range1.contains(3L)) throw AssertionError() + if (!(3L !in 3..1) != range1.contains(3L)) throw AssertionError() + // no local optimizations + if (element19 in 3..1 != range1.contains(element19)) throw AssertionError() + if (element19 !in 3..1 != !range1.contains(element19)) throw AssertionError() + if (!(element19 in 3..1) != !range1.contains(element19)) throw AssertionError() + if (!(element19 !in 3..1) != range1.contains(element19)) throw AssertionError() +} + +fun testR1xE20() { + // with possible local optimizations + if (4.toByte() in 3..1 != range1.contains(4.toByte())) throw AssertionError() + if (4.toByte() !in 3..1 != !range1.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() in 3..1) != !range1.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() !in 3..1) != range1.contains(4.toByte())) throw AssertionError() + // no local optimizations + if (element20 in 3..1 != range1.contains(element20)) throw AssertionError() + if (element20 !in 3..1 != !range1.contains(element20)) throw AssertionError() + if (!(element20 in 3..1) != !range1.contains(element20)) throw AssertionError() + if (!(element20 !in 3..1) != range1.contains(element20)) throw AssertionError() +} + +fun testR1xE21() { + // with possible local optimizations + if (4.toShort() in 3..1 != range1.contains(4.toShort())) throw AssertionError() + if (4.toShort() !in 3..1 != !range1.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() in 3..1) != !range1.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() !in 3..1) != range1.contains(4.toShort())) throw AssertionError() + // no local optimizations + if (element21 in 3..1 != range1.contains(element21)) throw AssertionError() + if (element21 !in 3..1 != !range1.contains(element21)) throw AssertionError() + if (!(element21 in 3..1) != !range1.contains(element21)) throw AssertionError() + if (!(element21 !in 3..1) != range1.contains(element21)) throw AssertionError() +} + +fun testR1xE22() { + // with possible local optimizations + if (4 in 3..1 != range1.contains(4)) throw AssertionError() + if (4 !in 3..1 != !range1.contains(4)) throw AssertionError() + if (!(4 in 3..1) != !range1.contains(4)) throw AssertionError() + if (!(4 !in 3..1) != range1.contains(4)) throw AssertionError() + // no local optimizations + if (element22 in 3..1 != range1.contains(element22)) throw AssertionError() + if (element22 !in 3..1 != !range1.contains(element22)) throw AssertionError() + if (!(element22 in 3..1) != !range1.contains(element22)) throw AssertionError() + if (!(element22 !in 3..1) != range1.contains(element22)) throw AssertionError() +} + +fun testR1xE23() { + // with possible local optimizations + if (4L in 3..1 != range1.contains(4L)) throw AssertionError() + if (4L !in 3..1 != !range1.contains(4L)) throw AssertionError() + if (!(4L in 3..1) != !range1.contains(4L)) throw AssertionError() + if (!(4L !in 3..1) != range1.contains(4L)) throw AssertionError() + // no local optimizations + if (element23 in 3..1 != range1.contains(element23)) throw AssertionError() + if (element23 !in 3..1 != !range1.contains(element23)) throw AssertionError() + if (!(element23 in 3..1) != !range1.contains(element23)) throw AssertionError() + if (!(element23 !in 3..1) != range1.contains(element23)) throw AssertionError() +} + + diff --git a/compiler/testData/codegen/box/ranges/contains/generated/intRangeUntil.kt b/compiler/testData/codegen/box/ranges/contains/generated/intRangeUntil.kt new file mode 100644 index 00000000000..0753dc1be71 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/contains/generated/intRangeUntil.kt @@ -0,0 +1,713 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_STDLIB +// DONT_TARGET_EXACT_BACKEND: JVM +// !LANGUAGE: +RangeUntilOperator +@file:OptIn(ExperimentalStdlibApi::class) + + + +val range0 = 1..<3 +val range1 = 3..<1 + +val element0 = (-1).toByte() +val element1 = (-1).toShort() +val element2 = -1 +val element3 = -1L +val element4 = 0.toByte() +val element5 = 0.toShort() +val element6 = 0 +val element7 = 0L +val element8 = 1.toByte() +val element9 = 1.toShort() +val element10 = 1 +val element11 = 1L +val element12 = 2.toByte() +val element13 = 2.toShort() +val element14 = 2 +val element15 = 2L +val element16 = 3.toByte() +val element17 = 3.toShort() +val element18 = 3 +val element19 = 3L +val element20 = 4.toByte() +val element21 = 4.toShort() +val element22 = 4 +val element23 = 4L + +fun box(): String { + testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR0xE5() + testR0xE6() + testR0xE7() + testR0xE8() + testR0xE9() + testR0xE10() + testR0xE11() + testR0xE12() + testR0xE13() + testR0xE14() + testR0xE15() + testR0xE16() + testR0xE17() + testR0xE18() + testR0xE19() + testR0xE20() + testR0xE21() + testR0xE22() + testR0xE23() + testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + testR1xE5() + testR1xE6() + testR1xE7() + testR1xE8() + testR1xE9() + testR1xE10() + testR1xE11() + testR1xE12() + testR1xE13() + testR1xE14() + testR1xE15() + testR1xE16() + testR1xE17() + testR1xE18() + testR1xE19() + testR1xE20() + testR1xE21() + testR1xE22() + testR1xE23() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if ((-1).toByte() in 1..<3 != range0.contains((-1).toByte())) throw AssertionError() + if ((-1).toByte() !in 1..<3 != !range0.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() in 1..<3) != !range0.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() !in 1..<3) != range0.contains((-1).toByte())) throw AssertionError() + // no local optimizations + if (element0 in 1..<3 != range0.contains(element0)) throw AssertionError() + if (element0 !in 1..<3 != !range0.contains(element0)) throw AssertionError() + if (!(element0 in 1..<3) != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in 1..<3) != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if ((-1).toShort() in 1..<3 != range0.contains((-1).toShort())) throw AssertionError() + if ((-1).toShort() !in 1..<3 != !range0.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() in 1..<3) != !range0.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() !in 1..<3) != range0.contains((-1).toShort())) throw AssertionError() + // no local optimizations + if (element1 in 1..<3 != range0.contains(element1)) throw AssertionError() + if (element1 !in 1..<3 != !range0.contains(element1)) throw AssertionError() + if (!(element1 in 1..<3) != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in 1..<3) != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if (-1 in 1..<3 != range0.contains(-1)) throw AssertionError() + if (-1 !in 1..<3 != !range0.contains(-1)) throw AssertionError() + if (!(-1 in 1..<3) != !range0.contains(-1)) throw AssertionError() + if (!(-1 !in 1..<3) != range0.contains(-1)) throw AssertionError() + // no local optimizations + if (element2 in 1..<3 != range0.contains(element2)) throw AssertionError() + if (element2 !in 1..<3 != !range0.contains(element2)) throw AssertionError() + if (!(element2 in 1..<3) != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in 1..<3) != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if (-1L in 1..<3 != range0.contains(-1L)) throw AssertionError() + if (-1L !in 1..<3 != !range0.contains(-1L)) throw AssertionError() + if (!(-1L in 1..<3) != !range0.contains(-1L)) throw AssertionError() + if (!(-1L !in 1..<3) != range0.contains(-1L)) throw AssertionError() + // no local optimizations + if (element3 in 1..<3 != range0.contains(element3)) throw AssertionError() + if (element3 !in 1..<3 != !range0.contains(element3)) throw AssertionError() + if (!(element3 in 1..<3) != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in 1..<3) != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if (0.toByte() in 1..<3 != range0.contains(0.toByte())) throw AssertionError() + if (0.toByte() !in 1..<3 != !range0.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() in 1..<3) != !range0.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() !in 1..<3) != range0.contains(0.toByte())) throw AssertionError() + // no local optimizations + if (element4 in 1..<3 != range0.contains(element4)) throw AssertionError() + if (element4 !in 1..<3 != !range0.contains(element4)) throw AssertionError() + if (!(element4 in 1..<3) != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in 1..<3) != range0.contains(element4)) throw AssertionError() +} + +fun testR0xE5() { + // with possible local optimizations + if (0.toShort() in 1..<3 != range0.contains(0.toShort())) throw AssertionError() + if (0.toShort() !in 1..<3 != !range0.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() in 1..<3) != !range0.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() !in 1..<3) != range0.contains(0.toShort())) throw AssertionError() + // no local optimizations + if (element5 in 1..<3 != range0.contains(element5)) throw AssertionError() + if (element5 !in 1..<3 != !range0.contains(element5)) throw AssertionError() + if (!(element5 in 1..<3) != !range0.contains(element5)) throw AssertionError() + if (!(element5 !in 1..<3) != range0.contains(element5)) throw AssertionError() +} + +fun testR0xE6() { + // with possible local optimizations + if (0 in 1..<3 != range0.contains(0)) throw AssertionError() + if (0 !in 1..<3 != !range0.contains(0)) throw AssertionError() + if (!(0 in 1..<3) != !range0.contains(0)) throw AssertionError() + if (!(0 !in 1..<3) != range0.contains(0)) throw AssertionError() + // no local optimizations + if (element6 in 1..<3 != range0.contains(element6)) throw AssertionError() + if (element6 !in 1..<3 != !range0.contains(element6)) throw AssertionError() + if (!(element6 in 1..<3) != !range0.contains(element6)) throw AssertionError() + if (!(element6 !in 1..<3) != range0.contains(element6)) throw AssertionError() +} + +fun testR0xE7() { + // with possible local optimizations + if (0L in 1..<3 != range0.contains(0L)) throw AssertionError() + if (0L !in 1..<3 != !range0.contains(0L)) throw AssertionError() + if (!(0L in 1..<3) != !range0.contains(0L)) throw AssertionError() + if (!(0L !in 1..<3) != range0.contains(0L)) throw AssertionError() + // no local optimizations + if (element7 in 1..<3 != range0.contains(element7)) throw AssertionError() + if (element7 !in 1..<3 != !range0.contains(element7)) throw AssertionError() + if (!(element7 in 1..<3) != !range0.contains(element7)) throw AssertionError() + if (!(element7 !in 1..<3) != range0.contains(element7)) throw AssertionError() +} + +fun testR0xE8() { + // with possible local optimizations + if (1.toByte() in 1..<3 != range0.contains(1.toByte())) throw AssertionError() + if (1.toByte() !in 1..<3 != !range0.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() in 1..<3) != !range0.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() !in 1..<3) != range0.contains(1.toByte())) throw AssertionError() + // no local optimizations + if (element8 in 1..<3 != range0.contains(element8)) throw AssertionError() + if (element8 !in 1..<3 != !range0.contains(element8)) throw AssertionError() + if (!(element8 in 1..<3) != !range0.contains(element8)) throw AssertionError() + if (!(element8 !in 1..<3) != range0.contains(element8)) throw AssertionError() +} + +fun testR0xE9() { + // with possible local optimizations + if (1.toShort() in 1..<3 != range0.contains(1.toShort())) throw AssertionError() + if (1.toShort() !in 1..<3 != !range0.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() in 1..<3) != !range0.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() !in 1..<3) != range0.contains(1.toShort())) throw AssertionError() + // no local optimizations + if (element9 in 1..<3 != range0.contains(element9)) throw AssertionError() + if (element9 !in 1..<3 != !range0.contains(element9)) throw AssertionError() + if (!(element9 in 1..<3) != !range0.contains(element9)) throw AssertionError() + if (!(element9 !in 1..<3) != range0.contains(element9)) throw AssertionError() +} + +fun testR0xE10() { + // with possible local optimizations + if (1 in 1..<3 != range0.contains(1)) throw AssertionError() + if (1 !in 1..<3 != !range0.contains(1)) throw AssertionError() + if (!(1 in 1..<3) != !range0.contains(1)) throw AssertionError() + if (!(1 !in 1..<3) != range0.contains(1)) throw AssertionError() + // no local optimizations + if (element10 in 1..<3 != range0.contains(element10)) throw AssertionError() + if (element10 !in 1..<3 != !range0.contains(element10)) throw AssertionError() + if (!(element10 in 1..<3) != !range0.contains(element10)) throw AssertionError() + if (!(element10 !in 1..<3) != range0.contains(element10)) throw AssertionError() +} + +fun testR0xE11() { + // with possible local optimizations + if (1L in 1..<3 != range0.contains(1L)) throw AssertionError() + if (1L !in 1..<3 != !range0.contains(1L)) throw AssertionError() + if (!(1L in 1..<3) != !range0.contains(1L)) throw AssertionError() + if (!(1L !in 1..<3) != range0.contains(1L)) throw AssertionError() + // no local optimizations + if (element11 in 1..<3 != range0.contains(element11)) throw AssertionError() + if (element11 !in 1..<3 != !range0.contains(element11)) throw AssertionError() + if (!(element11 in 1..<3) != !range0.contains(element11)) throw AssertionError() + if (!(element11 !in 1..<3) != range0.contains(element11)) throw AssertionError() +} + +fun testR0xE12() { + // with possible local optimizations + if (2.toByte() in 1..<3 != range0.contains(2.toByte())) throw AssertionError() + if (2.toByte() !in 1..<3 != !range0.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() in 1..<3) != !range0.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() !in 1..<3) != range0.contains(2.toByte())) throw AssertionError() + // no local optimizations + if (element12 in 1..<3 != range0.contains(element12)) throw AssertionError() + if (element12 !in 1..<3 != !range0.contains(element12)) throw AssertionError() + if (!(element12 in 1..<3) != !range0.contains(element12)) throw AssertionError() + if (!(element12 !in 1..<3) != range0.contains(element12)) throw AssertionError() +} + +fun testR0xE13() { + // with possible local optimizations + if (2.toShort() in 1..<3 != range0.contains(2.toShort())) throw AssertionError() + if (2.toShort() !in 1..<3 != !range0.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() in 1..<3) != !range0.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() !in 1..<3) != range0.contains(2.toShort())) throw AssertionError() + // no local optimizations + if (element13 in 1..<3 != range0.contains(element13)) throw AssertionError() + if (element13 !in 1..<3 != !range0.contains(element13)) throw AssertionError() + if (!(element13 in 1..<3) != !range0.contains(element13)) throw AssertionError() + if (!(element13 !in 1..<3) != range0.contains(element13)) throw AssertionError() +} + +fun testR0xE14() { + // with possible local optimizations + if (2 in 1..<3 != range0.contains(2)) throw AssertionError() + if (2 !in 1..<3 != !range0.contains(2)) throw AssertionError() + if (!(2 in 1..<3) != !range0.contains(2)) throw AssertionError() + if (!(2 !in 1..<3) != range0.contains(2)) throw AssertionError() + // no local optimizations + if (element14 in 1..<3 != range0.contains(element14)) throw AssertionError() + if (element14 !in 1..<3 != !range0.contains(element14)) throw AssertionError() + if (!(element14 in 1..<3) != !range0.contains(element14)) throw AssertionError() + if (!(element14 !in 1..<3) != range0.contains(element14)) throw AssertionError() +} + +fun testR0xE15() { + // with possible local optimizations + if (2L in 1..<3 != range0.contains(2L)) throw AssertionError() + if (2L !in 1..<3 != !range0.contains(2L)) throw AssertionError() + if (!(2L in 1..<3) != !range0.contains(2L)) throw AssertionError() + if (!(2L !in 1..<3) != range0.contains(2L)) throw AssertionError() + // no local optimizations + if (element15 in 1..<3 != range0.contains(element15)) throw AssertionError() + if (element15 !in 1..<3 != !range0.contains(element15)) throw AssertionError() + if (!(element15 in 1..<3) != !range0.contains(element15)) throw AssertionError() + if (!(element15 !in 1..<3) != range0.contains(element15)) throw AssertionError() +} + +fun testR0xE16() { + // with possible local optimizations + if (3.toByte() in 1..<3 != range0.contains(3.toByte())) throw AssertionError() + if (3.toByte() !in 1..<3 != !range0.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() in 1..<3) != !range0.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() !in 1..<3) != range0.contains(3.toByte())) throw AssertionError() + // no local optimizations + if (element16 in 1..<3 != range0.contains(element16)) throw AssertionError() + if (element16 !in 1..<3 != !range0.contains(element16)) throw AssertionError() + if (!(element16 in 1..<3) != !range0.contains(element16)) throw AssertionError() + if (!(element16 !in 1..<3) != range0.contains(element16)) throw AssertionError() +} + +fun testR0xE17() { + // with possible local optimizations + if (3.toShort() in 1..<3 != range0.contains(3.toShort())) throw AssertionError() + if (3.toShort() !in 1..<3 != !range0.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() in 1..<3) != !range0.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() !in 1..<3) != range0.contains(3.toShort())) throw AssertionError() + // no local optimizations + if (element17 in 1..<3 != range0.contains(element17)) throw AssertionError() + if (element17 !in 1..<3 != !range0.contains(element17)) throw AssertionError() + if (!(element17 in 1..<3) != !range0.contains(element17)) throw AssertionError() + if (!(element17 !in 1..<3) != range0.contains(element17)) throw AssertionError() +} + +fun testR0xE18() { + // with possible local optimizations + if (3 in 1..<3 != range0.contains(3)) throw AssertionError() + if (3 !in 1..<3 != !range0.contains(3)) throw AssertionError() + if (!(3 in 1..<3) != !range0.contains(3)) throw AssertionError() + if (!(3 !in 1..<3) != range0.contains(3)) throw AssertionError() + // no local optimizations + if (element18 in 1..<3 != range0.contains(element18)) throw AssertionError() + if (element18 !in 1..<3 != !range0.contains(element18)) throw AssertionError() + if (!(element18 in 1..<3) != !range0.contains(element18)) throw AssertionError() + if (!(element18 !in 1..<3) != range0.contains(element18)) throw AssertionError() +} + +fun testR0xE19() { + // with possible local optimizations + if (3L in 1..<3 != range0.contains(3L)) throw AssertionError() + if (3L !in 1..<3 != !range0.contains(3L)) throw AssertionError() + if (!(3L in 1..<3) != !range0.contains(3L)) throw AssertionError() + if (!(3L !in 1..<3) != range0.contains(3L)) throw AssertionError() + // no local optimizations + if (element19 in 1..<3 != range0.contains(element19)) throw AssertionError() + if (element19 !in 1..<3 != !range0.contains(element19)) throw AssertionError() + if (!(element19 in 1..<3) != !range0.contains(element19)) throw AssertionError() + if (!(element19 !in 1..<3) != range0.contains(element19)) throw AssertionError() +} + +fun testR0xE20() { + // with possible local optimizations + if (4.toByte() in 1..<3 != range0.contains(4.toByte())) throw AssertionError() + if (4.toByte() !in 1..<3 != !range0.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() in 1..<3) != !range0.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() !in 1..<3) != range0.contains(4.toByte())) throw AssertionError() + // no local optimizations + if (element20 in 1..<3 != range0.contains(element20)) throw AssertionError() + if (element20 !in 1..<3 != !range0.contains(element20)) throw AssertionError() + if (!(element20 in 1..<3) != !range0.contains(element20)) throw AssertionError() + if (!(element20 !in 1..<3) != range0.contains(element20)) throw AssertionError() +} + +fun testR0xE21() { + // with possible local optimizations + if (4.toShort() in 1..<3 != range0.contains(4.toShort())) throw AssertionError() + if (4.toShort() !in 1..<3 != !range0.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() in 1..<3) != !range0.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() !in 1..<3) != range0.contains(4.toShort())) throw AssertionError() + // no local optimizations + if (element21 in 1..<3 != range0.contains(element21)) throw AssertionError() + if (element21 !in 1..<3 != !range0.contains(element21)) throw AssertionError() + if (!(element21 in 1..<3) != !range0.contains(element21)) throw AssertionError() + if (!(element21 !in 1..<3) != range0.contains(element21)) throw AssertionError() +} + +fun testR0xE22() { + // with possible local optimizations + if (4 in 1..<3 != range0.contains(4)) throw AssertionError() + if (4 !in 1..<3 != !range0.contains(4)) throw AssertionError() + if (!(4 in 1..<3) != !range0.contains(4)) throw AssertionError() + if (!(4 !in 1..<3) != range0.contains(4)) throw AssertionError() + // no local optimizations + if (element22 in 1..<3 != range0.contains(element22)) throw AssertionError() + if (element22 !in 1..<3 != !range0.contains(element22)) throw AssertionError() + if (!(element22 in 1..<3) != !range0.contains(element22)) throw AssertionError() + if (!(element22 !in 1..<3) != range0.contains(element22)) throw AssertionError() +} + +fun testR0xE23() { + // with possible local optimizations + if (4L in 1..<3 != range0.contains(4L)) throw AssertionError() + if (4L !in 1..<3 != !range0.contains(4L)) throw AssertionError() + if (!(4L in 1..<3) != !range0.contains(4L)) throw AssertionError() + if (!(4L !in 1..<3) != range0.contains(4L)) throw AssertionError() + // no local optimizations + if (element23 in 1..<3 != range0.contains(element23)) throw AssertionError() + if (element23 !in 1..<3 != !range0.contains(element23)) throw AssertionError() + if (!(element23 in 1..<3) != !range0.contains(element23)) throw AssertionError() + if (!(element23 !in 1..<3) != range0.contains(element23)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if ((-1).toByte() in 3..<1 != range1.contains((-1).toByte())) throw AssertionError() + if ((-1).toByte() !in 3..<1 != !range1.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() in 3..<1) != !range1.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() !in 3..<1) != range1.contains((-1).toByte())) throw AssertionError() + // no local optimizations + if (element0 in 3..<1 != range1.contains(element0)) throw AssertionError() + if (element0 !in 3..<1 != !range1.contains(element0)) throw AssertionError() + if (!(element0 in 3..<1) != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in 3..<1) != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if ((-1).toShort() in 3..<1 != range1.contains((-1).toShort())) throw AssertionError() + if ((-1).toShort() !in 3..<1 != !range1.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() in 3..<1) != !range1.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() !in 3..<1) != range1.contains((-1).toShort())) throw AssertionError() + // no local optimizations + if (element1 in 3..<1 != range1.contains(element1)) throw AssertionError() + if (element1 !in 3..<1 != !range1.contains(element1)) throw AssertionError() + if (!(element1 in 3..<1) != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in 3..<1) != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if (-1 in 3..<1 != range1.contains(-1)) throw AssertionError() + if (-1 !in 3..<1 != !range1.contains(-1)) throw AssertionError() + if (!(-1 in 3..<1) != !range1.contains(-1)) throw AssertionError() + if (!(-1 !in 3..<1) != range1.contains(-1)) throw AssertionError() + // no local optimizations + if (element2 in 3..<1 != range1.contains(element2)) throw AssertionError() + if (element2 !in 3..<1 != !range1.contains(element2)) throw AssertionError() + if (!(element2 in 3..<1) != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in 3..<1) != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if (-1L in 3..<1 != range1.contains(-1L)) throw AssertionError() + if (-1L !in 3..<1 != !range1.contains(-1L)) throw AssertionError() + if (!(-1L in 3..<1) != !range1.contains(-1L)) throw AssertionError() + if (!(-1L !in 3..<1) != range1.contains(-1L)) throw AssertionError() + // no local optimizations + if (element3 in 3..<1 != range1.contains(element3)) throw AssertionError() + if (element3 !in 3..<1 != !range1.contains(element3)) throw AssertionError() + if (!(element3 in 3..<1) != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in 3..<1) != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if (0.toByte() in 3..<1 != range1.contains(0.toByte())) throw AssertionError() + if (0.toByte() !in 3..<1 != !range1.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() in 3..<1) != !range1.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() !in 3..<1) != range1.contains(0.toByte())) throw AssertionError() + // no local optimizations + if (element4 in 3..<1 != range1.contains(element4)) throw AssertionError() + if (element4 !in 3..<1 != !range1.contains(element4)) throw AssertionError() + if (!(element4 in 3..<1) != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in 3..<1) != range1.contains(element4)) throw AssertionError() +} + +fun testR1xE5() { + // with possible local optimizations + if (0.toShort() in 3..<1 != range1.contains(0.toShort())) throw AssertionError() + if (0.toShort() !in 3..<1 != !range1.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() in 3..<1) != !range1.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() !in 3..<1) != range1.contains(0.toShort())) throw AssertionError() + // no local optimizations + if (element5 in 3..<1 != range1.contains(element5)) throw AssertionError() + if (element5 !in 3..<1 != !range1.contains(element5)) throw AssertionError() + if (!(element5 in 3..<1) != !range1.contains(element5)) throw AssertionError() + if (!(element5 !in 3..<1) != range1.contains(element5)) throw AssertionError() +} + +fun testR1xE6() { + // with possible local optimizations + if (0 in 3..<1 != range1.contains(0)) throw AssertionError() + if (0 !in 3..<1 != !range1.contains(0)) throw AssertionError() + if (!(0 in 3..<1) != !range1.contains(0)) throw AssertionError() + if (!(0 !in 3..<1) != range1.contains(0)) throw AssertionError() + // no local optimizations + if (element6 in 3..<1 != range1.contains(element6)) throw AssertionError() + if (element6 !in 3..<1 != !range1.contains(element6)) throw AssertionError() + if (!(element6 in 3..<1) != !range1.contains(element6)) throw AssertionError() + if (!(element6 !in 3..<1) != range1.contains(element6)) throw AssertionError() +} + +fun testR1xE7() { + // with possible local optimizations + if (0L in 3..<1 != range1.contains(0L)) throw AssertionError() + if (0L !in 3..<1 != !range1.contains(0L)) throw AssertionError() + if (!(0L in 3..<1) != !range1.contains(0L)) throw AssertionError() + if (!(0L !in 3..<1) != range1.contains(0L)) throw AssertionError() + // no local optimizations + if (element7 in 3..<1 != range1.contains(element7)) throw AssertionError() + if (element7 !in 3..<1 != !range1.contains(element7)) throw AssertionError() + if (!(element7 in 3..<1) != !range1.contains(element7)) throw AssertionError() + if (!(element7 !in 3..<1) != range1.contains(element7)) throw AssertionError() +} + +fun testR1xE8() { + // with possible local optimizations + if (1.toByte() in 3..<1 != range1.contains(1.toByte())) throw AssertionError() + if (1.toByte() !in 3..<1 != !range1.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() in 3..<1) != !range1.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() !in 3..<1) != range1.contains(1.toByte())) throw AssertionError() + // no local optimizations + if (element8 in 3..<1 != range1.contains(element8)) throw AssertionError() + if (element8 !in 3..<1 != !range1.contains(element8)) throw AssertionError() + if (!(element8 in 3..<1) != !range1.contains(element8)) throw AssertionError() + if (!(element8 !in 3..<1) != range1.contains(element8)) throw AssertionError() +} + +fun testR1xE9() { + // with possible local optimizations + if (1.toShort() in 3..<1 != range1.contains(1.toShort())) throw AssertionError() + if (1.toShort() !in 3..<1 != !range1.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() in 3..<1) != !range1.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() !in 3..<1) != range1.contains(1.toShort())) throw AssertionError() + // no local optimizations + if (element9 in 3..<1 != range1.contains(element9)) throw AssertionError() + if (element9 !in 3..<1 != !range1.contains(element9)) throw AssertionError() + if (!(element9 in 3..<1) != !range1.contains(element9)) throw AssertionError() + if (!(element9 !in 3..<1) != range1.contains(element9)) throw AssertionError() +} + +fun testR1xE10() { + // with possible local optimizations + if (1 in 3..<1 != range1.contains(1)) throw AssertionError() + if (1 !in 3..<1 != !range1.contains(1)) throw AssertionError() + if (!(1 in 3..<1) != !range1.contains(1)) throw AssertionError() + if (!(1 !in 3..<1) != range1.contains(1)) throw AssertionError() + // no local optimizations + if (element10 in 3..<1 != range1.contains(element10)) throw AssertionError() + if (element10 !in 3..<1 != !range1.contains(element10)) throw AssertionError() + if (!(element10 in 3..<1) != !range1.contains(element10)) throw AssertionError() + if (!(element10 !in 3..<1) != range1.contains(element10)) throw AssertionError() +} + +fun testR1xE11() { + // with possible local optimizations + if (1L in 3..<1 != range1.contains(1L)) throw AssertionError() + if (1L !in 3..<1 != !range1.contains(1L)) throw AssertionError() + if (!(1L in 3..<1) != !range1.contains(1L)) throw AssertionError() + if (!(1L !in 3..<1) != range1.contains(1L)) throw AssertionError() + // no local optimizations + if (element11 in 3..<1 != range1.contains(element11)) throw AssertionError() + if (element11 !in 3..<1 != !range1.contains(element11)) throw AssertionError() + if (!(element11 in 3..<1) != !range1.contains(element11)) throw AssertionError() + if (!(element11 !in 3..<1) != range1.contains(element11)) throw AssertionError() +} + +fun testR1xE12() { + // with possible local optimizations + if (2.toByte() in 3..<1 != range1.contains(2.toByte())) throw AssertionError() + if (2.toByte() !in 3..<1 != !range1.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() in 3..<1) != !range1.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() !in 3..<1) != range1.contains(2.toByte())) throw AssertionError() + // no local optimizations + if (element12 in 3..<1 != range1.contains(element12)) throw AssertionError() + if (element12 !in 3..<1 != !range1.contains(element12)) throw AssertionError() + if (!(element12 in 3..<1) != !range1.contains(element12)) throw AssertionError() + if (!(element12 !in 3..<1) != range1.contains(element12)) throw AssertionError() +} + +fun testR1xE13() { + // with possible local optimizations + if (2.toShort() in 3..<1 != range1.contains(2.toShort())) throw AssertionError() + if (2.toShort() !in 3..<1 != !range1.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() in 3..<1) != !range1.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() !in 3..<1) != range1.contains(2.toShort())) throw AssertionError() + // no local optimizations + if (element13 in 3..<1 != range1.contains(element13)) throw AssertionError() + if (element13 !in 3..<1 != !range1.contains(element13)) throw AssertionError() + if (!(element13 in 3..<1) != !range1.contains(element13)) throw AssertionError() + if (!(element13 !in 3..<1) != range1.contains(element13)) throw AssertionError() +} + +fun testR1xE14() { + // with possible local optimizations + if (2 in 3..<1 != range1.contains(2)) throw AssertionError() + if (2 !in 3..<1 != !range1.contains(2)) throw AssertionError() + if (!(2 in 3..<1) != !range1.contains(2)) throw AssertionError() + if (!(2 !in 3..<1) != range1.contains(2)) throw AssertionError() + // no local optimizations + if (element14 in 3..<1 != range1.contains(element14)) throw AssertionError() + if (element14 !in 3..<1 != !range1.contains(element14)) throw AssertionError() + if (!(element14 in 3..<1) != !range1.contains(element14)) throw AssertionError() + if (!(element14 !in 3..<1) != range1.contains(element14)) throw AssertionError() +} + +fun testR1xE15() { + // with possible local optimizations + if (2L in 3..<1 != range1.contains(2L)) throw AssertionError() + if (2L !in 3..<1 != !range1.contains(2L)) throw AssertionError() + if (!(2L in 3..<1) != !range1.contains(2L)) throw AssertionError() + if (!(2L !in 3..<1) != range1.contains(2L)) throw AssertionError() + // no local optimizations + if (element15 in 3..<1 != range1.contains(element15)) throw AssertionError() + if (element15 !in 3..<1 != !range1.contains(element15)) throw AssertionError() + if (!(element15 in 3..<1) != !range1.contains(element15)) throw AssertionError() + if (!(element15 !in 3..<1) != range1.contains(element15)) throw AssertionError() +} + +fun testR1xE16() { + // with possible local optimizations + if (3.toByte() in 3..<1 != range1.contains(3.toByte())) throw AssertionError() + if (3.toByte() !in 3..<1 != !range1.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() in 3..<1) != !range1.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() !in 3..<1) != range1.contains(3.toByte())) throw AssertionError() + // no local optimizations + if (element16 in 3..<1 != range1.contains(element16)) throw AssertionError() + if (element16 !in 3..<1 != !range1.contains(element16)) throw AssertionError() + if (!(element16 in 3..<1) != !range1.contains(element16)) throw AssertionError() + if (!(element16 !in 3..<1) != range1.contains(element16)) throw AssertionError() +} + +fun testR1xE17() { + // with possible local optimizations + if (3.toShort() in 3..<1 != range1.contains(3.toShort())) throw AssertionError() + if (3.toShort() !in 3..<1 != !range1.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() in 3..<1) != !range1.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() !in 3..<1) != range1.contains(3.toShort())) throw AssertionError() + // no local optimizations + if (element17 in 3..<1 != range1.contains(element17)) throw AssertionError() + if (element17 !in 3..<1 != !range1.contains(element17)) throw AssertionError() + if (!(element17 in 3..<1) != !range1.contains(element17)) throw AssertionError() + if (!(element17 !in 3..<1) != range1.contains(element17)) throw AssertionError() +} + +fun testR1xE18() { + // with possible local optimizations + if (3 in 3..<1 != range1.contains(3)) throw AssertionError() + if (3 !in 3..<1 != !range1.contains(3)) throw AssertionError() + if (!(3 in 3..<1) != !range1.contains(3)) throw AssertionError() + if (!(3 !in 3..<1) != range1.contains(3)) throw AssertionError() + // no local optimizations + if (element18 in 3..<1 != range1.contains(element18)) throw AssertionError() + if (element18 !in 3..<1 != !range1.contains(element18)) throw AssertionError() + if (!(element18 in 3..<1) != !range1.contains(element18)) throw AssertionError() + if (!(element18 !in 3..<1) != range1.contains(element18)) throw AssertionError() +} + +fun testR1xE19() { + // with possible local optimizations + if (3L in 3..<1 != range1.contains(3L)) throw AssertionError() + if (3L !in 3..<1 != !range1.contains(3L)) throw AssertionError() + if (!(3L in 3..<1) != !range1.contains(3L)) throw AssertionError() + if (!(3L !in 3..<1) != range1.contains(3L)) throw AssertionError() + // no local optimizations + if (element19 in 3..<1 != range1.contains(element19)) throw AssertionError() + if (element19 !in 3..<1 != !range1.contains(element19)) throw AssertionError() + if (!(element19 in 3..<1) != !range1.contains(element19)) throw AssertionError() + if (!(element19 !in 3..<1) != range1.contains(element19)) throw AssertionError() +} + +fun testR1xE20() { + // with possible local optimizations + if (4.toByte() in 3..<1 != range1.contains(4.toByte())) throw AssertionError() + if (4.toByte() !in 3..<1 != !range1.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() in 3..<1) != !range1.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() !in 3..<1) != range1.contains(4.toByte())) throw AssertionError() + // no local optimizations + if (element20 in 3..<1 != range1.contains(element20)) throw AssertionError() + if (element20 !in 3..<1 != !range1.contains(element20)) throw AssertionError() + if (!(element20 in 3..<1) != !range1.contains(element20)) throw AssertionError() + if (!(element20 !in 3..<1) != range1.contains(element20)) throw AssertionError() +} + +fun testR1xE21() { + // with possible local optimizations + if (4.toShort() in 3..<1 != range1.contains(4.toShort())) throw AssertionError() + if (4.toShort() !in 3..<1 != !range1.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() in 3..<1) != !range1.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() !in 3..<1) != range1.contains(4.toShort())) throw AssertionError() + // no local optimizations + if (element21 in 3..<1 != range1.contains(element21)) throw AssertionError() + if (element21 !in 3..<1 != !range1.contains(element21)) throw AssertionError() + if (!(element21 in 3..<1) != !range1.contains(element21)) throw AssertionError() + if (!(element21 !in 3..<1) != range1.contains(element21)) throw AssertionError() +} + +fun testR1xE22() { + // with possible local optimizations + if (4 in 3..<1 != range1.contains(4)) throw AssertionError() + if (4 !in 3..<1 != !range1.contains(4)) throw AssertionError() + if (!(4 in 3..<1) != !range1.contains(4)) throw AssertionError() + if (!(4 !in 3..<1) != range1.contains(4)) throw AssertionError() + // no local optimizations + if (element22 in 3..<1 != range1.contains(element22)) throw AssertionError() + if (element22 !in 3..<1 != !range1.contains(element22)) throw AssertionError() + if (!(element22 in 3..<1) != !range1.contains(element22)) throw AssertionError() + if (!(element22 !in 3..<1) != range1.contains(element22)) throw AssertionError() +} + +fun testR1xE23() { + // with possible local optimizations + if (4L in 3..<1 != range1.contains(4L)) throw AssertionError() + if (4L !in 3..<1 != !range1.contains(4L)) throw AssertionError() + if (!(4L in 3..<1) != !range1.contains(4L)) throw AssertionError() + if (!(4L !in 3..<1) != range1.contains(4L)) throw AssertionError() + // no local optimizations + if (element23 in 3..<1 != range1.contains(element23)) throw AssertionError() + if (element23 !in 3..<1 != !range1.contains(element23)) throw AssertionError() + if (!(element23 in 3..<1) != !range1.contains(element23)) throw AssertionError() + if (!(element23 !in 3..<1) != range1.contains(element23)) throw AssertionError() +} + + diff --git a/compiler/testData/codegen/box/ranges/contains/generated/intUntil.kt b/compiler/testData/codegen/box/ranges/contains/generated/intUntil.kt index 877c476b71a..8c9fff5d38b 100644 --- a/compiler/testData/codegen/box/ranges/contains/generated/intUntil.kt +++ b/compiler/testData/codegen/box/ranges/contains/generated/intUntil.kt @@ -8,28 +8,28 @@ val range1 = 3 until 1 val element0 = (-1).toByte() val element1 = (-1).toShort() -val element2 = (-1) -val element3 = (-1).toLong() +val element2 = -1 +val element3 = -1L val element4 = 0.toByte() val element5 = 0.toShort() val element6 = 0 -val element7 = 0.toLong() +val element7 = 0L val element8 = 1.toByte() val element9 = 1.toShort() val element10 = 1 -val element11 = 1.toLong() +val element11 = 1L val element12 = 2.toByte() val element13 = 2.toShort() val element14 = 2 -val element15 = 2.toLong() +val element15 = 2L val element16 = 3.toByte() val element17 = 3.toShort() val element18 = 3 -val element19 = 3.toLong() +val element19 = 3L val element20 = 4.toByte() val element21 = 4.toShort() val element22 = 4 -val element23 = 4.toLong() +val element23 = 4L fun box(): String { testR0xE0() @@ -111,10 +111,10 @@ fun testR0xE1() { fun testR0xE2() { // with possible local optimizations - if ((-1) in 1 until 3 != range0.contains((-1))) throw AssertionError() - if ((-1) !in 1 until 3 != !range0.contains((-1))) throw AssertionError() - if (!((-1) in 1 until 3) != !range0.contains((-1))) throw AssertionError() - if (!((-1) !in 1 until 3) != range0.contains((-1))) throw AssertionError() + if (-1 in 1 until 3 != range0.contains(-1)) throw AssertionError() + if (-1 !in 1 until 3 != !range0.contains(-1)) throw AssertionError() + if (!(-1 in 1 until 3) != !range0.contains(-1)) throw AssertionError() + if (!(-1 !in 1 until 3) != range0.contains(-1)) throw AssertionError() // no local optimizations if (element2 in 1 until 3 != range0.contains(element2)) throw AssertionError() if (element2 !in 1 until 3 != !range0.contains(element2)) throw AssertionError() @@ -124,10 +124,10 @@ fun testR0xE2() { fun testR0xE3() { // with possible local optimizations - if ((-1).toLong() in 1 until 3 != range0.contains((-1).toLong())) throw AssertionError() - if ((-1).toLong() !in 1 until 3 != !range0.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() in 1 until 3) != !range0.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() !in 1 until 3) != range0.contains((-1).toLong())) throw AssertionError() + if (-1L in 1 until 3 != range0.contains(-1L)) throw AssertionError() + if (-1L !in 1 until 3 != !range0.contains(-1L)) throw AssertionError() + if (!(-1L in 1 until 3) != !range0.contains(-1L)) throw AssertionError() + if (!(-1L !in 1 until 3) != range0.contains(-1L)) throw AssertionError() // no local optimizations if (element3 in 1 until 3 != range0.contains(element3)) throw AssertionError() if (element3 !in 1 until 3 != !range0.contains(element3)) throw AssertionError() @@ -176,10 +176,10 @@ fun testR0xE6() { fun testR0xE7() { // with possible local optimizations - if (0.toLong() in 1 until 3 != range0.contains(0.toLong())) throw AssertionError() - if (0.toLong() !in 1 until 3 != !range0.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() in 1 until 3) != !range0.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() !in 1 until 3) != range0.contains(0.toLong())) throw AssertionError() + if (0L in 1 until 3 != range0.contains(0L)) throw AssertionError() + if (0L !in 1 until 3 != !range0.contains(0L)) throw AssertionError() + if (!(0L in 1 until 3) != !range0.contains(0L)) throw AssertionError() + if (!(0L !in 1 until 3) != range0.contains(0L)) throw AssertionError() // no local optimizations if (element7 in 1 until 3 != range0.contains(element7)) throw AssertionError() if (element7 !in 1 until 3 != !range0.contains(element7)) throw AssertionError() @@ -228,10 +228,10 @@ fun testR0xE10() { fun testR0xE11() { // with possible local optimizations - if (1.toLong() in 1 until 3 != range0.contains(1.toLong())) throw AssertionError() - if (1.toLong() !in 1 until 3 != !range0.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() in 1 until 3) != !range0.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() !in 1 until 3) != range0.contains(1.toLong())) throw AssertionError() + if (1L in 1 until 3 != range0.contains(1L)) throw AssertionError() + if (1L !in 1 until 3 != !range0.contains(1L)) throw AssertionError() + if (!(1L in 1 until 3) != !range0.contains(1L)) throw AssertionError() + if (!(1L !in 1 until 3) != range0.contains(1L)) throw AssertionError() // no local optimizations if (element11 in 1 until 3 != range0.contains(element11)) throw AssertionError() if (element11 !in 1 until 3 != !range0.contains(element11)) throw AssertionError() @@ -280,10 +280,10 @@ fun testR0xE14() { fun testR0xE15() { // with possible local optimizations - if (2.toLong() in 1 until 3 != range0.contains(2.toLong())) throw AssertionError() - if (2.toLong() !in 1 until 3 != !range0.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() in 1 until 3) != !range0.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() !in 1 until 3) != range0.contains(2.toLong())) throw AssertionError() + if (2L in 1 until 3 != range0.contains(2L)) throw AssertionError() + if (2L !in 1 until 3 != !range0.contains(2L)) throw AssertionError() + if (!(2L in 1 until 3) != !range0.contains(2L)) throw AssertionError() + if (!(2L !in 1 until 3) != range0.contains(2L)) throw AssertionError() // no local optimizations if (element15 in 1 until 3 != range0.contains(element15)) throw AssertionError() if (element15 !in 1 until 3 != !range0.contains(element15)) throw AssertionError() @@ -332,10 +332,10 @@ fun testR0xE18() { fun testR0xE19() { // with possible local optimizations - if (3.toLong() in 1 until 3 != range0.contains(3.toLong())) throw AssertionError() - if (3.toLong() !in 1 until 3 != !range0.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() in 1 until 3) != !range0.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() !in 1 until 3) != range0.contains(3.toLong())) throw AssertionError() + if (3L in 1 until 3 != range0.contains(3L)) throw AssertionError() + if (3L !in 1 until 3 != !range0.contains(3L)) throw AssertionError() + if (!(3L in 1 until 3) != !range0.contains(3L)) throw AssertionError() + if (!(3L !in 1 until 3) != range0.contains(3L)) throw AssertionError() // no local optimizations if (element19 in 1 until 3 != range0.contains(element19)) throw AssertionError() if (element19 !in 1 until 3 != !range0.contains(element19)) throw AssertionError() @@ -384,10 +384,10 @@ fun testR0xE22() { fun testR0xE23() { // with possible local optimizations - if (4.toLong() in 1 until 3 != range0.contains(4.toLong())) throw AssertionError() - if (4.toLong() !in 1 until 3 != !range0.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() in 1 until 3) != !range0.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() !in 1 until 3) != range0.contains(4.toLong())) throw AssertionError() + if (4L in 1 until 3 != range0.contains(4L)) throw AssertionError() + if (4L !in 1 until 3 != !range0.contains(4L)) throw AssertionError() + if (!(4L in 1 until 3) != !range0.contains(4L)) throw AssertionError() + if (!(4L !in 1 until 3) != range0.contains(4L)) throw AssertionError() // no local optimizations if (element23 in 1 until 3 != range0.contains(element23)) throw AssertionError() if (element23 !in 1 until 3 != !range0.contains(element23)) throw AssertionError() @@ -423,10 +423,10 @@ fun testR1xE1() { fun testR1xE2() { // with possible local optimizations - if ((-1) in 3 until 1 != range1.contains((-1))) throw AssertionError() - if ((-1) !in 3 until 1 != !range1.contains((-1))) throw AssertionError() - if (!((-1) in 3 until 1) != !range1.contains((-1))) throw AssertionError() - if (!((-1) !in 3 until 1) != range1.contains((-1))) throw AssertionError() + if (-1 in 3 until 1 != range1.contains(-1)) throw AssertionError() + if (-1 !in 3 until 1 != !range1.contains(-1)) throw AssertionError() + if (!(-1 in 3 until 1) != !range1.contains(-1)) throw AssertionError() + if (!(-1 !in 3 until 1) != range1.contains(-1)) throw AssertionError() // no local optimizations if (element2 in 3 until 1 != range1.contains(element2)) throw AssertionError() if (element2 !in 3 until 1 != !range1.contains(element2)) throw AssertionError() @@ -436,10 +436,10 @@ fun testR1xE2() { fun testR1xE3() { // with possible local optimizations - if ((-1).toLong() in 3 until 1 != range1.contains((-1).toLong())) throw AssertionError() - if ((-1).toLong() !in 3 until 1 != !range1.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() in 3 until 1) != !range1.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() !in 3 until 1) != range1.contains((-1).toLong())) throw AssertionError() + if (-1L in 3 until 1 != range1.contains(-1L)) throw AssertionError() + if (-1L !in 3 until 1 != !range1.contains(-1L)) throw AssertionError() + if (!(-1L in 3 until 1) != !range1.contains(-1L)) throw AssertionError() + if (!(-1L !in 3 until 1) != range1.contains(-1L)) throw AssertionError() // no local optimizations if (element3 in 3 until 1 != range1.contains(element3)) throw AssertionError() if (element3 !in 3 until 1 != !range1.contains(element3)) throw AssertionError() @@ -488,10 +488,10 @@ fun testR1xE6() { fun testR1xE7() { // with possible local optimizations - if (0.toLong() in 3 until 1 != range1.contains(0.toLong())) throw AssertionError() - if (0.toLong() !in 3 until 1 != !range1.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() in 3 until 1) != !range1.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() !in 3 until 1) != range1.contains(0.toLong())) throw AssertionError() + if (0L in 3 until 1 != range1.contains(0L)) throw AssertionError() + if (0L !in 3 until 1 != !range1.contains(0L)) throw AssertionError() + if (!(0L in 3 until 1) != !range1.contains(0L)) throw AssertionError() + if (!(0L !in 3 until 1) != range1.contains(0L)) throw AssertionError() // no local optimizations if (element7 in 3 until 1 != range1.contains(element7)) throw AssertionError() if (element7 !in 3 until 1 != !range1.contains(element7)) throw AssertionError() @@ -540,10 +540,10 @@ fun testR1xE10() { fun testR1xE11() { // with possible local optimizations - if (1.toLong() in 3 until 1 != range1.contains(1.toLong())) throw AssertionError() - if (1.toLong() !in 3 until 1 != !range1.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() in 3 until 1) != !range1.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() !in 3 until 1) != range1.contains(1.toLong())) throw AssertionError() + if (1L in 3 until 1 != range1.contains(1L)) throw AssertionError() + if (1L !in 3 until 1 != !range1.contains(1L)) throw AssertionError() + if (!(1L in 3 until 1) != !range1.contains(1L)) throw AssertionError() + if (!(1L !in 3 until 1) != range1.contains(1L)) throw AssertionError() // no local optimizations if (element11 in 3 until 1 != range1.contains(element11)) throw AssertionError() if (element11 !in 3 until 1 != !range1.contains(element11)) throw AssertionError() @@ -592,10 +592,10 @@ fun testR1xE14() { fun testR1xE15() { // with possible local optimizations - if (2.toLong() in 3 until 1 != range1.contains(2.toLong())) throw AssertionError() - if (2.toLong() !in 3 until 1 != !range1.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() in 3 until 1) != !range1.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() !in 3 until 1) != range1.contains(2.toLong())) throw AssertionError() + if (2L in 3 until 1 != range1.contains(2L)) throw AssertionError() + if (2L !in 3 until 1 != !range1.contains(2L)) throw AssertionError() + if (!(2L in 3 until 1) != !range1.contains(2L)) throw AssertionError() + if (!(2L !in 3 until 1) != range1.contains(2L)) throw AssertionError() // no local optimizations if (element15 in 3 until 1 != range1.contains(element15)) throw AssertionError() if (element15 !in 3 until 1 != !range1.contains(element15)) throw AssertionError() @@ -644,10 +644,10 @@ fun testR1xE18() { fun testR1xE19() { // with possible local optimizations - if (3.toLong() in 3 until 1 != range1.contains(3.toLong())) throw AssertionError() - if (3.toLong() !in 3 until 1 != !range1.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() in 3 until 1) != !range1.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() !in 3 until 1) != range1.contains(3.toLong())) throw AssertionError() + if (3L in 3 until 1 != range1.contains(3L)) throw AssertionError() + if (3L !in 3 until 1 != !range1.contains(3L)) throw AssertionError() + if (!(3L in 3 until 1) != !range1.contains(3L)) throw AssertionError() + if (!(3L !in 3 until 1) != range1.contains(3L)) throw AssertionError() // no local optimizations if (element19 in 3 until 1 != range1.contains(element19)) throw AssertionError() if (element19 !in 3 until 1 != !range1.contains(element19)) throw AssertionError() @@ -696,10 +696,10 @@ fun testR1xE22() { fun testR1xE23() { // with possible local optimizations - if (4.toLong() in 3 until 1 != range1.contains(4.toLong())) throw AssertionError() - if (4.toLong() !in 3 until 1 != !range1.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() in 3 until 1) != !range1.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() !in 3 until 1) != range1.contains(4.toLong())) throw AssertionError() + if (4L in 3 until 1 != range1.contains(4L)) throw AssertionError() + if (4L !in 3 until 1 != !range1.contains(4L)) throw AssertionError() + if (!(4L in 3 until 1) != !range1.contains(4L)) throw AssertionError() + if (!(4L !in 3 until 1) != range1.contains(4L)) throw AssertionError() // no local optimizations if (element23 in 3 until 1 != range1.contains(element23)) throw AssertionError() if (element23 !in 3 until 1 != !range1.contains(element23)) throw AssertionError() diff --git a/compiler/testData/codegen/box/ranges/contains/generated/longDownTo.kt b/compiler/testData/codegen/box/ranges/contains/generated/longDownTo.kt index 66809149667..bd8a62110fe 100644 --- a/compiler/testData/codegen/box/ranges/contains/generated/longDownTo.kt +++ b/compiler/testData/codegen/box/ranges/contains/generated/longDownTo.kt @@ -3,41 +3,186 @@ -val range0 = 3L downTo 1L -val range1 = 1L downTo 3L +val range0 = 1L downTo 3L +val range1 = 3L downTo 1L -val element0 = 1L +val element0 = -1L +val element1 = 0L +val element2 = 1L +val element3 = 2L +val element4 = 3L +val element5 = 4L fun box(): String { testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR0xE5() testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + testR1xE5() return "OK" } fun testR0xE0() { // with possible local optimizations - if (1L in 3L downTo 1L != range0.contains(1L)) throw AssertionError() - if (1L !in 3L downTo 1L != !range0.contains(1L)) throw AssertionError() - if (!(1L in 3L downTo 1L) != !range0.contains(1L)) throw AssertionError() - if (!(1L !in 3L downTo 1L) != range0.contains(1L)) throw AssertionError() + if (-1L in 1L downTo 3L != range0.contains(-1L)) throw AssertionError() + if (-1L !in 1L downTo 3L != !range0.contains(-1L)) throw AssertionError() + if (!(-1L in 1L downTo 3L) != !range0.contains(-1L)) throw AssertionError() + if (!(-1L !in 1L downTo 3L) != range0.contains(-1L)) throw AssertionError() // no local optimizations - if (element0 in 3L downTo 1L != range0.contains(element0)) throw AssertionError() - if (element0 !in 3L downTo 1L != !range0.contains(element0)) throw AssertionError() - if (!(element0 in 3L downTo 1L) != !range0.contains(element0)) throw AssertionError() - if (!(element0 !in 3L downTo 1L) != range0.contains(element0)) throw AssertionError() + if (element0 in 1L downTo 3L != range0.contains(element0)) throw AssertionError() + if (element0 !in 1L downTo 3L != !range0.contains(element0)) throw AssertionError() + if (!(element0 in 1L downTo 3L) != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in 1L downTo 3L) != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if (0L in 1L downTo 3L != range0.contains(0L)) throw AssertionError() + if (0L !in 1L downTo 3L != !range0.contains(0L)) throw AssertionError() + if (!(0L in 1L downTo 3L) != !range0.contains(0L)) throw AssertionError() + if (!(0L !in 1L downTo 3L) != range0.contains(0L)) throw AssertionError() + // no local optimizations + if (element1 in 1L downTo 3L != range0.contains(element1)) throw AssertionError() + if (element1 !in 1L downTo 3L != !range0.contains(element1)) throw AssertionError() + if (!(element1 in 1L downTo 3L) != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in 1L downTo 3L) != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if (1L in 1L downTo 3L != range0.contains(1L)) throw AssertionError() + if (1L !in 1L downTo 3L != !range0.contains(1L)) throw AssertionError() + if (!(1L in 1L downTo 3L) != !range0.contains(1L)) throw AssertionError() + if (!(1L !in 1L downTo 3L) != range0.contains(1L)) throw AssertionError() + // no local optimizations + if (element2 in 1L downTo 3L != range0.contains(element2)) throw AssertionError() + if (element2 !in 1L downTo 3L != !range0.contains(element2)) throw AssertionError() + if (!(element2 in 1L downTo 3L) != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in 1L downTo 3L) != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if (2L in 1L downTo 3L != range0.contains(2L)) throw AssertionError() + if (2L !in 1L downTo 3L != !range0.contains(2L)) throw AssertionError() + if (!(2L in 1L downTo 3L) != !range0.contains(2L)) throw AssertionError() + if (!(2L !in 1L downTo 3L) != range0.contains(2L)) throw AssertionError() + // no local optimizations + if (element3 in 1L downTo 3L != range0.contains(element3)) throw AssertionError() + if (element3 !in 1L downTo 3L != !range0.contains(element3)) throw AssertionError() + if (!(element3 in 1L downTo 3L) != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in 1L downTo 3L) != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if (3L in 1L downTo 3L != range0.contains(3L)) throw AssertionError() + if (3L !in 1L downTo 3L != !range0.contains(3L)) throw AssertionError() + if (!(3L in 1L downTo 3L) != !range0.contains(3L)) throw AssertionError() + if (!(3L !in 1L downTo 3L) != range0.contains(3L)) throw AssertionError() + // no local optimizations + if (element4 in 1L downTo 3L != range0.contains(element4)) throw AssertionError() + if (element4 !in 1L downTo 3L != !range0.contains(element4)) throw AssertionError() + if (!(element4 in 1L downTo 3L) != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in 1L downTo 3L) != range0.contains(element4)) throw AssertionError() +} + +fun testR0xE5() { + // with possible local optimizations + if (4L in 1L downTo 3L != range0.contains(4L)) throw AssertionError() + if (4L !in 1L downTo 3L != !range0.contains(4L)) throw AssertionError() + if (!(4L in 1L downTo 3L) != !range0.contains(4L)) throw AssertionError() + if (!(4L !in 1L downTo 3L) != range0.contains(4L)) throw AssertionError() + // no local optimizations + if (element5 in 1L downTo 3L != range0.contains(element5)) throw AssertionError() + if (element5 !in 1L downTo 3L != !range0.contains(element5)) throw AssertionError() + if (!(element5 in 1L downTo 3L) != !range0.contains(element5)) throw AssertionError() + if (!(element5 !in 1L downTo 3L) != range0.contains(element5)) throw AssertionError() } fun testR1xE0() { // with possible local optimizations - if (1L in 1L downTo 3L != range1.contains(1L)) throw AssertionError() - if (1L !in 1L downTo 3L != !range1.contains(1L)) throw AssertionError() - if (!(1L in 1L downTo 3L) != !range1.contains(1L)) throw AssertionError() - if (!(1L !in 1L downTo 3L) != range1.contains(1L)) throw AssertionError() + if (-1L in 3L downTo 1L != range1.contains(-1L)) throw AssertionError() + if (-1L !in 3L downTo 1L != !range1.contains(-1L)) throw AssertionError() + if (!(-1L in 3L downTo 1L) != !range1.contains(-1L)) throw AssertionError() + if (!(-1L !in 3L downTo 1L) != range1.contains(-1L)) throw AssertionError() // no local optimizations - if (element0 in 1L downTo 3L != range1.contains(element0)) throw AssertionError() - if (element0 !in 1L downTo 3L != !range1.contains(element0)) throw AssertionError() - if (!(element0 in 1L downTo 3L) != !range1.contains(element0)) throw AssertionError() - if (!(element0 !in 1L downTo 3L) != range1.contains(element0)) throw AssertionError() + if (element0 in 3L downTo 1L != range1.contains(element0)) throw AssertionError() + if (element0 !in 3L downTo 1L != !range1.contains(element0)) throw AssertionError() + if (!(element0 in 3L downTo 1L) != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in 3L downTo 1L) != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if (0L in 3L downTo 1L != range1.contains(0L)) throw AssertionError() + if (0L !in 3L downTo 1L != !range1.contains(0L)) throw AssertionError() + if (!(0L in 3L downTo 1L) != !range1.contains(0L)) throw AssertionError() + if (!(0L !in 3L downTo 1L) != range1.contains(0L)) throw AssertionError() + // no local optimizations + if (element1 in 3L downTo 1L != range1.contains(element1)) throw AssertionError() + if (element1 !in 3L downTo 1L != !range1.contains(element1)) throw AssertionError() + if (!(element1 in 3L downTo 1L) != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in 3L downTo 1L) != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if (1L in 3L downTo 1L != range1.contains(1L)) throw AssertionError() + if (1L !in 3L downTo 1L != !range1.contains(1L)) throw AssertionError() + if (!(1L in 3L downTo 1L) != !range1.contains(1L)) throw AssertionError() + if (!(1L !in 3L downTo 1L) != range1.contains(1L)) throw AssertionError() + // no local optimizations + if (element2 in 3L downTo 1L != range1.contains(element2)) throw AssertionError() + if (element2 !in 3L downTo 1L != !range1.contains(element2)) throw AssertionError() + if (!(element2 in 3L downTo 1L) != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in 3L downTo 1L) != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if (2L in 3L downTo 1L != range1.contains(2L)) throw AssertionError() + if (2L !in 3L downTo 1L != !range1.contains(2L)) throw AssertionError() + if (!(2L in 3L downTo 1L) != !range1.contains(2L)) throw AssertionError() + if (!(2L !in 3L downTo 1L) != range1.contains(2L)) throw AssertionError() + // no local optimizations + if (element3 in 3L downTo 1L != range1.contains(element3)) throw AssertionError() + if (element3 !in 3L downTo 1L != !range1.contains(element3)) throw AssertionError() + if (!(element3 in 3L downTo 1L) != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in 3L downTo 1L) != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if (3L in 3L downTo 1L != range1.contains(3L)) throw AssertionError() + if (3L !in 3L downTo 1L != !range1.contains(3L)) throw AssertionError() + if (!(3L in 3L downTo 1L) != !range1.contains(3L)) throw AssertionError() + if (!(3L !in 3L downTo 1L) != range1.contains(3L)) throw AssertionError() + // no local optimizations + if (element4 in 3L downTo 1L != range1.contains(element4)) throw AssertionError() + if (element4 !in 3L downTo 1L != !range1.contains(element4)) throw AssertionError() + if (!(element4 in 3L downTo 1L) != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in 3L downTo 1L) != range1.contains(element4)) throw AssertionError() +} + +fun testR1xE5() { + // with possible local optimizations + if (4L in 3L downTo 1L != range1.contains(4L)) throw AssertionError() + if (4L !in 3L downTo 1L != !range1.contains(4L)) throw AssertionError() + if (!(4L in 3L downTo 1L) != !range1.contains(4L)) throw AssertionError() + if (!(4L !in 3L downTo 1L) != range1.contains(4L)) throw AssertionError() + // no local optimizations + if (element5 in 3L downTo 1L != range1.contains(element5)) throw AssertionError() + if (element5 !in 3L downTo 1L != !range1.contains(element5)) throw AssertionError() + if (!(element5 in 3L downTo 1L) != !range1.contains(element5)) throw AssertionError() + if (!(element5 !in 3L downTo 1L) != range1.contains(element5)) throw AssertionError() } diff --git a/compiler/testData/codegen/box/ranges/contains/generated/longRangeLiteral.kt b/compiler/testData/codegen/box/ranges/contains/generated/longRangeLiteral.kt deleted file mode 100644 index 48c732cedd4..00000000000 --- a/compiler/testData/codegen/box/ranges/contains/generated/longRangeLiteral.kt +++ /dev/null @@ -1,710 +0,0 @@ -// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! -// WITH_STDLIB - - - -val range0 = 1L .. 3L -val range1 = 3L .. 1L - -val element0 = (-1).toByte() -val element1 = (-1).toShort() -val element2 = (-1) -val element3 = (-1).toLong() -val element4 = 0.toByte() -val element5 = 0.toShort() -val element6 = 0 -val element7 = 0.toLong() -val element8 = 1.toByte() -val element9 = 1.toShort() -val element10 = 1 -val element11 = 1.toLong() -val element12 = 2.toByte() -val element13 = 2.toShort() -val element14 = 2 -val element15 = 2.toLong() -val element16 = 3.toByte() -val element17 = 3.toShort() -val element18 = 3 -val element19 = 3.toLong() -val element20 = 4.toByte() -val element21 = 4.toShort() -val element22 = 4 -val element23 = 4.toLong() - -fun box(): String { - testR0xE0() - testR0xE1() - testR0xE2() - testR0xE3() - testR0xE4() - testR0xE5() - testR0xE6() - testR0xE7() - testR0xE8() - testR0xE9() - testR0xE10() - testR0xE11() - testR0xE12() - testR0xE13() - testR0xE14() - testR0xE15() - testR0xE16() - testR0xE17() - testR0xE18() - testR0xE19() - testR0xE20() - testR0xE21() - testR0xE22() - testR0xE23() - testR1xE0() - testR1xE1() - testR1xE2() - testR1xE3() - testR1xE4() - testR1xE5() - testR1xE6() - testR1xE7() - testR1xE8() - testR1xE9() - testR1xE10() - testR1xE11() - testR1xE12() - testR1xE13() - testR1xE14() - testR1xE15() - testR1xE16() - testR1xE17() - testR1xE18() - testR1xE19() - testR1xE20() - testR1xE21() - testR1xE22() - testR1xE23() - return "OK" -} - -fun testR0xE0() { - // with possible local optimizations - if ((-1).toByte() in 1L .. 3L != range0.contains((-1).toByte())) throw AssertionError() - if ((-1).toByte() !in 1L .. 3L != !range0.contains((-1).toByte())) throw AssertionError() - if (!((-1).toByte() in 1L .. 3L) != !range0.contains((-1).toByte())) throw AssertionError() - if (!((-1).toByte() !in 1L .. 3L) != range0.contains((-1).toByte())) throw AssertionError() - // no local optimizations - if (element0 in 1L .. 3L != range0.contains(element0)) throw AssertionError() - if (element0 !in 1L .. 3L != !range0.contains(element0)) throw AssertionError() - if (!(element0 in 1L .. 3L) != !range0.contains(element0)) throw AssertionError() - if (!(element0 !in 1L .. 3L) != range0.contains(element0)) throw AssertionError() -} - -fun testR0xE1() { - // with possible local optimizations - if ((-1).toShort() in 1L .. 3L != range0.contains((-1).toShort())) throw AssertionError() - if ((-1).toShort() !in 1L .. 3L != !range0.contains((-1).toShort())) throw AssertionError() - if (!((-1).toShort() in 1L .. 3L) != !range0.contains((-1).toShort())) throw AssertionError() - if (!((-1).toShort() !in 1L .. 3L) != range0.contains((-1).toShort())) throw AssertionError() - // no local optimizations - if (element1 in 1L .. 3L != range0.contains(element1)) throw AssertionError() - if (element1 !in 1L .. 3L != !range0.contains(element1)) throw AssertionError() - if (!(element1 in 1L .. 3L) != !range0.contains(element1)) throw AssertionError() - if (!(element1 !in 1L .. 3L) != range0.contains(element1)) throw AssertionError() -} - -fun testR0xE2() { - // with possible local optimizations - if ((-1) in 1L .. 3L != range0.contains((-1))) throw AssertionError() - if ((-1) !in 1L .. 3L != !range0.contains((-1))) throw AssertionError() - if (!((-1) in 1L .. 3L) != !range0.contains((-1))) throw AssertionError() - if (!((-1) !in 1L .. 3L) != range0.contains((-1))) throw AssertionError() - // no local optimizations - if (element2 in 1L .. 3L != range0.contains(element2)) throw AssertionError() - if (element2 !in 1L .. 3L != !range0.contains(element2)) throw AssertionError() - if (!(element2 in 1L .. 3L) != !range0.contains(element2)) throw AssertionError() - if (!(element2 !in 1L .. 3L) != range0.contains(element2)) throw AssertionError() -} - -fun testR0xE3() { - // with possible local optimizations - if ((-1).toLong() in 1L .. 3L != range0.contains((-1).toLong())) throw AssertionError() - if ((-1).toLong() !in 1L .. 3L != !range0.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() in 1L .. 3L) != !range0.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() !in 1L .. 3L) != range0.contains((-1).toLong())) throw AssertionError() - // no local optimizations - if (element3 in 1L .. 3L != range0.contains(element3)) throw AssertionError() - if (element3 !in 1L .. 3L != !range0.contains(element3)) throw AssertionError() - if (!(element3 in 1L .. 3L) != !range0.contains(element3)) throw AssertionError() - if (!(element3 !in 1L .. 3L) != range0.contains(element3)) throw AssertionError() -} - -fun testR0xE4() { - // with possible local optimizations - if (0.toByte() in 1L .. 3L != range0.contains(0.toByte())) throw AssertionError() - if (0.toByte() !in 1L .. 3L != !range0.contains(0.toByte())) throw AssertionError() - if (!(0.toByte() in 1L .. 3L) != !range0.contains(0.toByte())) throw AssertionError() - if (!(0.toByte() !in 1L .. 3L) != range0.contains(0.toByte())) throw AssertionError() - // no local optimizations - if (element4 in 1L .. 3L != range0.contains(element4)) throw AssertionError() - if (element4 !in 1L .. 3L != !range0.contains(element4)) throw AssertionError() - if (!(element4 in 1L .. 3L) != !range0.contains(element4)) throw AssertionError() - if (!(element4 !in 1L .. 3L) != range0.contains(element4)) throw AssertionError() -} - -fun testR0xE5() { - // with possible local optimizations - if (0.toShort() in 1L .. 3L != range0.contains(0.toShort())) throw AssertionError() - if (0.toShort() !in 1L .. 3L != !range0.contains(0.toShort())) throw AssertionError() - if (!(0.toShort() in 1L .. 3L) != !range0.contains(0.toShort())) throw AssertionError() - if (!(0.toShort() !in 1L .. 3L) != range0.contains(0.toShort())) throw AssertionError() - // no local optimizations - if (element5 in 1L .. 3L != range0.contains(element5)) throw AssertionError() - if (element5 !in 1L .. 3L != !range0.contains(element5)) throw AssertionError() - if (!(element5 in 1L .. 3L) != !range0.contains(element5)) throw AssertionError() - if (!(element5 !in 1L .. 3L) != range0.contains(element5)) throw AssertionError() -} - -fun testR0xE6() { - // with possible local optimizations - if (0 in 1L .. 3L != range0.contains(0)) throw AssertionError() - if (0 !in 1L .. 3L != !range0.contains(0)) throw AssertionError() - if (!(0 in 1L .. 3L) != !range0.contains(0)) throw AssertionError() - if (!(0 !in 1L .. 3L) != range0.contains(0)) throw AssertionError() - // no local optimizations - if (element6 in 1L .. 3L != range0.contains(element6)) throw AssertionError() - if (element6 !in 1L .. 3L != !range0.contains(element6)) throw AssertionError() - if (!(element6 in 1L .. 3L) != !range0.contains(element6)) throw AssertionError() - if (!(element6 !in 1L .. 3L) != range0.contains(element6)) throw AssertionError() -} - -fun testR0xE7() { - // with possible local optimizations - if (0.toLong() in 1L .. 3L != range0.contains(0.toLong())) throw AssertionError() - if (0.toLong() !in 1L .. 3L != !range0.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() in 1L .. 3L) != !range0.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() !in 1L .. 3L) != range0.contains(0.toLong())) throw AssertionError() - // no local optimizations - if (element7 in 1L .. 3L != range0.contains(element7)) throw AssertionError() - if (element7 !in 1L .. 3L != !range0.contains(element7)) throw AssertionError() - if (!(element7 in 1L .. 3L) != !range0.contains(element7)) throw AssertionError() - if (!(element7 !in 1L .. 3L) != range0.contains(element7)) throw AssertionError() -} - -fun testR0xE8() { - // with possible local optimizations - if (1.toByte() in 1L .. 3L != range0.contains(1.toByte())) throw AssertionError() - if (1.toByte() !in 1L .. 3L != !range0.contains(1.toByte())) throw AssertionError() - if (!(1.toByte() in 1L .. 3L) != !range0.contains(1.toByte())) throw AssertionError() - if (!(1.toByte() !in 1L .. 3L) != range0.contains(1.toByte())) throw AssertionError() - // no local optimizations - if (element8 in 1L .. 3L != range0.contains(element8)) throw AssertionError() - if (element8 !in 1L .. 3L != !range0.contains(element8)) throw AssertionError() - if (!(element8 in 1L .. 3L) != !range0.contains(element8)) throw AssertionError() - if (!(element8 !in 1L .. 3L) != range0.contains(element8)) throw AssertionError() -} - -fun testR0xE9() { - // with possible local optimizations - if (1.toShort() in 1L .. 3L != range0.contains(1.toShort())) throw AssertionError() - if (1.toShort() !in 1L .. 3L != !range0.contains(1.toShort())) throw AssertionError() - if (!(1.toShort() in 1L .. 3L) != !range0.contains(1.toShort())) throw AssertionError() - if (!(1.toShort() !in 1L .. 3L) != range0.contains(1.toShort())) throw AssertionError() - // no local optimizations - if (element9 in 1L .. 3L != range0.contains(element9)) throw AssertionError() - if (element9 !in 1L .. 3L != !range0.contains(element9)) throw AssertionError() - if (!(element9 in 1L .. 3L) != !range0.contains(element9)) throw AssertionError() - if (!(element9 !in 1L .. 3L) != range0.contains(element9)) throw AssertionError() -} - -fun testR0xE10() { - // with possible local optimizations - if (1 in 1L .. 3L != range0.contains(1)) throw AssertionError() - if (1 !in 1L .. 3L != !range0.contains(1)) throw AssertionError() - if (!(1 in 1L .. 3L) != !range0.contains(1)) throw AssertionError() - if (!(1 !in 1L .. 3L) != range0.contains(1)) throw AssertionError() - // no local optimizations - if (element10 in 1L .. 3L != range0.contains(element10)) throw AssertionError() - if (element10 !in 1L .. 3L != !range0.contains(element10)) throw AssertionError() - if (!(element10 in 1L .. 3L) != !range0.contains(element10)) throw AssertionError() - if (!(element10 !in 1L .. 3L) != range0.contains(element10)) throw AssertionError() -} - -fun testR0xE11() { - // with possible local optimizations - if (1.toLong() in 1L .. 3L != range0.contains(1.toLong())) throw AssertionError() - if (1.toLong() !in 1L .. 3L != !range0.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() in 1L .. 3L) != !range0.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() !in 1L .. 3L) != range0.contains(1.toLong())) throw AssertionError() - // no local optimizations - if (element11 in 1L .. 3L != range0.contains(element11)) throw AssertionError() - if (element11 !in 1L .. 3L != !range0.contains(element11)) throw AssertionError() - if (!(element11 in 1L .. 3L) != !range0.contains(element11)) throw AssertionError() - if (!(element11 !in 1L .. 3L) != range0.contains(element11)) throw AssertionError() -} - -fun testR0xE12() { - // with possible local optimizations - if (2.toByte() in 1L .. 3L != range0.contains(2.toByte())) throw AssertionError() - if (2.toByte() !in 1L .. 3L != !range0.contains(2.toByte())) throw AssertionError() - if (!(2.toByte() in 1L .. 3L) != !range0.contains(2.toByte())) throw AssertionError() - if (!(2.toByte() !in 1L .. 3L) != range0.contains(2.toByte())) throw AssertionError() - // no local optimizations - if (element12 in 1L .. 3L != range0.contains(element12)) throw AssertionError() - if (element12 !in 1L .. 3L != !range0.contains(element12)) throw AssertionError() - if (!(element12 in 1L .. 3L) != !range0.contains(element12)) throw AssertionError() - if (!(element12 !in 1L .. 3L) != range0.contains(element12)) throw AssertionError() -} - -fun testR0xE13() { - // with possible local optimizations - if (2.toShort() in 1L .. 3L != range0.contains(2.toShort())) throw AssertionError() - if (2.toShort() !in 1L .. 3L != !range0.contains(2.toShort())) throw AssertionError() - if (!(2.toShort() in 1L .. 3L) != !range0.contains(2.toShort())) throw AssertionError() - if (!(2.toShort() !in 1L .. 3L) != range0.contains(2.toShort())) throw AssertionError() - // no local optimizations - if (element13 in 1L .. 3L != range0.contains(element13)) throw AssertionError() - if (element13 !in 1L .. 3L != !range0.contains(element13)) throw AssertionError() - if (!(element13 in 1L .. 3L) != !range0.contains(element13)) throw AssertionError() - if (!(element13 !in 1L .. 3L) != range0.contains(element13)) throw AssertionError() -} - -fun testR0xE14() { - // with possible local optimizations - if (2 in 1L .. 3L != range0.contains(2)) throw AssertionError() - if (2 !in 1L .. 3L != !range0.contains(2)) throw AssertionError() - if (!(2 in 1L .. 3L) != !range0.contains(2)) throw AssertionError() - if (!(2 !in 1L .. 3L) != range0.contains(2)) throw AssertionError() - // no local optimizations - if (element14 in 1L .. 3L != range0.contains(element14)) throw AssertionError() - if (element14 !in 1L .. 3L != !range0.contains(element14)) throw AssertionError() - if (!(element14 in 1L .. 3L) != !range0.contains(element14)) throw AssertionError() - if (!(element14 !in 1L .. 3L) != range0.contains(element14)) throw AssertionError() -} - -fun testR0xE15() { - // with possible local optimizations - if (2.toLong() in 1L .. 3L != range0.contains(2.toLong())) throw AssertionError() - if (2.toLong() !in 1L .. 3L != !range0.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() in 1L .. 3L) != !range0.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() !in 1L .. 3L) != range0.contains(2.toLong())) throw AssertionError() - // no local optimizations - if (element15 in 1L .. 3L != range0.contains(element15)) throw AssertionError() - if (element15 !in 1L .. 3L != !range0.contains(element15)) throw AssertionError() - if (!(element15 in 1L .. 3L) != !range0.contains(element15)) throw AssertionError() - if (!(element15 !in 1L .. 3L) != range0.contains(element15)) throw AssertionError() -} - -fun testR0xE16() { - // with possible local optimizations - if (3.toByte() in 1L .. 3L != range0.contains(3.toByte())) throw AssertionError() - if (3.toByte() !in 1L .. 3L != !range0.contains(3.toByte())) throw AssertionError() - if (!(3.toByte() in 1L .. 3L) != !range0.contains(3.toByte())) throw AssertionError() - if (!(3.toByte() !in 1L .. 3L) != range0.contains(3.toByte())) throw AssertionError() - // no local optimizations - if (element16 in 1L .. 3L != range0.contains(element16)) throw AssertionError() - if (element16 !in 1L .. 3L != !range0.contains(element16)) throw AssertionError() - if (!(element16 in 1L .. 3L) != !range0.contains(element16)) throw AssertionError() - if (!(element16 !in 1L .. 3L) != range0.contains(element16)) throw AssertionError() -} - -fun testR0xE17() { - // with possible local optimizations - if (3.toShort() in 1L .. 3L != range0.contains(3.toShort())) throw AssertionError() - if (3.toShort() !in 1L .. 3L != !range0.contains(3.toShort())) throw AssertionError() - if (!(3.toShort() in 1L .. 3L) != !range0.contains(3.toShort())) throw AssertionError() - if (!(3.toShort() !in 1L .. 3L) != range0.contains(3.toShort())) throw AssertionError() - // no local optimizations - if (element17 in 1L .. 3L != range0.contains(element17)) throw AssertionError() - if (element17 !in 1L .. 3L != !range0.contains(element17)) throw AssertionError() - if (!(element17 in 1L .. 3L) != !range0.contains(element17)) throw AssertionError() - if (!(element17 !in 1L .. 3L) != range0.contains(element17)) throw AssertionError() -} - -fun testR0xE18() { - // with possible local optimizations - if (3 in 1L .. 3L != range0.contains(3)) throw AssertionError() - if (3 !in 1L .. 3L != !range0.contains(3)) throw AssertionError() - if (!(3 in 1L .. 3L) != !range0.contains(3)) throw AssertionError() - if (!(3 !in 1L .. 3L) != range0.contains(3)) throw AssertionError() - // no local optimizations - if (element18 in 1L .. 3L != range0.contains(element18)) throw AssertionError() - if (element18 !in 1L .. 3L != !range0.contains(element18)) throw AssertionError() - if (!(element18 in 1L .. 3L) != !range0.contains(element18)) throw AssertionError() - if (!(element18 !in 1L .. 3L) != range0.contains(element18)) throw AssertionError() -} - -fun testR0xE19() { - // with possible local optimizations - if (3.toLong() in 1L .. 3L != range0.contains(3.toLong())) throw AssertionError() - if (3.toLong() !in 1L .. 3L != !range0.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() in 1L .. 3L) != !range0.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() !in 1L .. 3L) != range0.contains(3.toLong())) throw AssertionError() - // no local optimizations - if (element19 in 1L .. 3L != range0.contains(element19)) throw AssertionError() - if (element19 !in 1L .. 3L != !range0.contains(element19)) throw AssertionError() - if (!(element19 in 1L .. 3L) != !range0.contains(element19)) throw AssertionError() - if (!(element19 !in 1L .. 3L) != range0.contains(element19)) throw AssertionError() -} - -fun testR0xE20() { - // with possible local optimizations - if (4.toByte() in 1L .. 3L != range0.contains(4.toByte())) throw AssertionError() - if (4.toByte() !in 1L .. 3L != !range0.contains(4.toByte())) throw AssertionError() - if (!(4.toByte() in 1L .. 3L) != !range0.contains(4.toByte())) throw AssertionError() - if (!(4.toByte() !in 1L .. 3L) != range0.contains(4.toByte())) throw AssertionError() - // no local optimizations - if (element20 in 1L .. 3L != range0.contains(element20)) throw AssertionError() - if (element20 !in 1L .. 3L != !range0.contains(element20)) throw AssertionError() - if (!(element20 in 1L .. 3L) != !range0.contains(element20)) throw AssertionError() - if (!(element20 !in 1L .. 3L) != range0.contains(element20)) throw AssertionError() -} - -fun testR0xE21() { - // with possible local optimizations - if (4.toShort() in 1L .. 3L != range0.contains(4.toShort())) throw AssertionError() - if (4.toShort() !in 1L .. 3L != !range0.contains(4.toShort())) throw AssertionError() - if (!(4.toShort() in 1L .. 3L) != !range0.contains(4.toShort())) throw AssertionError() - if (!(4.toShort() !in 1L .. 3L) != range0.contains(4.toShort())) throw AssertionError() - // no local optimizations - if (element21 in 1L .. 3L != range0.contains(element21)) throw AssertionError() - if (element21 !in 1L .. 3L != !range0.contains(element21)) throw AssertionError() - if (!(element21 in 1L .. 3L) != !range0.contains(element21)) throw AssertionError() - if (!(element21 !in 1L .. 3L) != range0.contains(element21)) throw AssertionError() -} - -fun testR0xE22() { - // with possible local optimizations - if (4 in 1L .. 3L != range0.contains(4)) throw AssertionError() - if (4 !in 1L .. 3L != !range0.contains(4)) throw AssertionError() - if (!(4 in 1L .. 3L) != !range0.contains(4)) throw AssertionError() - if (!(4 !in 1L .. 3L) != range0.contains(4)) throw AssertionError() - // no local optimizations - if (element22 in 1L .. 3L != range0.contains(element22)) throw AssertionError() - if (element22 !in 1L .. 3L != !range0.contains(element22)) throw AssertionError() - if (!(element22 in 1L .. 3L) != !range0.contains(element22)) throw AssertionError() - if (!(element22 !in 1L .. 3L) != range0.contains(element22)) throw AssertionError() -} - -fun testR0xE23() { - // with possible local optimizations - if (4.toLong() in 1L .. 3L != range0.contains(4.toLong())) throw AssertionError() - if (4.toLong() !in 1L .. 3L != !range0.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() in 1L .. 3L) != !range0.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() !in 1L .. 3L) != range0.contains(4.toLong())) throw AssertionError() - // no local optimizations - if (element23 in 1L .. 3L != range0.contains(element23)) throw AssertionError() - if (element23 !in 1L .. 3L != !range0.contains(element23)) throw AssertionError() - if (!(element23 in 1L .. 3L) != !range0.contains(element23)) throw AssertionError() - if (!(element23 !in 1L .. 3L) != range0.contains(element23)) throw AssertionError() -} - -fun testR1xE0() { - // with possible local optimizations - if ((-1).toByte() in 3L .. 1L != range1.contains((-1).toByte())) throw AssertionError() - if ((-1).toByte() !in 3L .. 1L != !range1.contains((-1).toByte())) throw AssertionError() - if (!((-1).toByte() in 3L .. 1L) != !range1.contains((-1).toByte())) throw AssertionError() - if (!((-1).toByte() !in 3L .. 1L) != range1.contains((-1).toByte())) throw AssertionError() - // no local optimizations - if (element0 in 3L .. 1L != range1.contains(element0)) throw AssertionError() - if (element0 !in 3L .. 1L != !range1.contains(element0)) throw AssertionError() - if (!(element0 in 3L .. 1L) != !range1.contains(element0)) throw AssertionError() - if (!(element0 !in 3L .. 1L) != range1.contains(element0)) throw AssertionError() -} - -fun testR1xE1() { - // with possible local optimizations - if ((-1).toShort() in 3L .. 1L != range1.contains((-1).toShort())) throw AssertionError() - if ((-1).toShort() !in 3L .. 1L != !range1.contains((-1).toShort())) throw AssertionError() - if (!((-1).toShort() in 3L .. 1L) != !range1.contains((-1).toShort())) throw AssertionError() - if (!((-1).toShort() !in 3L .. 1L) != range1.contains((-1).toShort())) throw AssertionError() - // no local optimizations - if (element1 in 3L .. 1L != range1.contains(element1)) throw AssertionError() - if (element1 !in 3L .. 1L != !range1.contains(element1)) throw AssertionError() - if (!(element1 in 3L .. 1L) != !range1.contains(element1)) throw AssertionError() - if (!(element1 !in 3L .. 1L) != range1.contains(element1)) throw AssertionError() -} - -fun testR1xE2() { - // with possible local optimizations - if ((-1) in 3L .. 1L != range1.contains((-1))) throw AssertionError() - if ((-1) !in 3L .. 1L != !range1.contains((-1))) throw AssertionError() - if (!((-1) in 3L .. 1L) != !range1.contains((-1))) throw AssertionError() - if (!((-1) !in 3L .. 1L) != range1.contains((-1))) throw AssertionError() - // no local optimizations - if (element2 in 3L .. 1L != range1.contains(element2)) throw AssertionError() - if (element2 !in 3L .. 1L != !range1.contains(element2)) throw AssertionError() - if (!(element2 in 3L .. 1L) != !range1.contains(element2)) throw AssertionError() - if (!(element2 !in 3L .. 1L) != range1.contains(element2)) throw AssertionError() -} - -fun testR1xE3() { - // with possible local optimizations - if ((-1).toLong() in 3L .. 1L != range1.contains((-1).toLong())) throw AssertionError() - if ((-1).toLong() !in 3L .. 1L != !range1.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() in 3L .. 1L) != !range1.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() !in 3L .. 1L) != range1.contains((-1).toLong())) throw AssertionError() - // no local optimizations - if (element3 in 3L .. 1L != range1.contains(element3)) throw AssertionError() - if (element3 !in 3L .. 1L != !range1.contains(element3)) throw AssertionError() - if (!(element3 in 3L .. 1L) != !range1.contains(element3)) throw AssertionError() - if (!(element3 !in 3L .. 1L) != range1.contains(element3)) throw AssertionError() -} - -fun testR1xE4() { - // with possible local optimizations - if (0.toByte() in 3L .. 1L != range1.contains(0.toByte())) throw AssertionError() - if (0.toByte() !in 3L .. 1L != !range1.contains(0.toByte())) throw AssertionError() - if (!(0.toByte() in 3L .. 1L) != !range1.contains(0.toByte())) throw AssertionError() - if (!(0.toByte() !in 3L .. 1L) != range1.contains(0.toByte())) throw AssertionError() - // no local optimizations - if (element4 in 3L .. 1L != range1.contains(element4)) throw AssertionError() - if (element4 !in 3L .. 1L != !range1.contains(element4)) throw AssertionError() - if (!(element4 in 3L .. 1L) != !range1.contains(element4)) throw AssertionError() - if (!(element4 !in 3L .. 1L) != range1.contains(element4)) throw AssertionError() -} - -fun testR1xE5() { - // with possible local optimizations - if (0.toShort() in 3L .. 1L != range1.contains(0.toShort())) throw AssertionError() - if (0.toShort() !in 3L .. 1L != !range1.contains(0.toShort())) throw AssertionError() - if (!(0.toShort() in 3L .. 1L) != !range1.contains(0.toShort())) throw AssertionError() - if (!(0.toShort() !in 3L .. 1L) != range1.contains(0.toShort())) throw AssertionError() - // no local optimizations - if (element5 in 3L .. 1L != range1.contains(element5)) throw AssertionError() - if (element5 !in 3L .. 1L != !range1.contains(element5)) throw AssertionError() - if (!(element5 in 3L .. 1L) != !range1.contains(element5)) throw AssertionError() - if (!(element5 !in 3L .. 1L) != range1.contains(element5)) throw AssertionError() -} - -fun testR1xE6() { - // with possible local optimizations - if (0 in 3L .. 1L != range1.contains(0)) throw AssertionError() - if (0 !in 3L .. 1L != !range1.contains(0)) throw AssertionError() - if (!(0 in 3L .. 1L) != !range1.contains(0)) throw AssertionError() - if (!(0 !in 3L .. 1L) != range1.contains(0)) throw AssertionError() - // no local optimizations - if (element6 in 3L .. 1L != range1.contains(element6)) throw AssertionError() - if (element6 !in 3L .. 1L != !range1.contains(element6)) throw AssertionError() - if (!(element6 in 3L .. 1L) != !range1.contains(element6)) throw AssertionError() - if (!(element6 !in 3L .. 1L) != range1.contains(element6)) throw AssertionError() -} - -fun testR1xE7() { - // with possible local optimizations - if (0.toLong() in 3L .. 1L != range1.contains(0.toLong())) throw AssertionError() - if (0.toLong() !in 3L .. 1L != !range1.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() in 3L .. 1L) != !range1.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() !in 3L .. 1L) != range1.contains(0.toLong())) throw AssertionError() - // no local optimizations - if (element7 in 3L .. 1L != range1.contains(element7)) throw AssertionError() - if (element7 !in 3L .. 1L != !range1.contains(element7)) throw AssertionError() - if (!(element7 in 3L .. 1L) != !range1.contains(element7)) throw AssertionError() - if (!(element7 !in 3L .. 1L) != range1.contains(element7)) throw AssertionError() -} - -fun testR1xE8() { - // with possible local optimizations - if (1.toByte() in 3L .. 1L != range1.contains(1.toByte())) throw AssertionError() - if (1.toByte() !in 3L .. 1L != !range1.contains(1.toByte())) throw AssertionError() - if (!(1.toByte() in 3L .. 1L) != !range1.contains(1.toByte())) throw AssertionError() - if (!(1.toByte() !in 3L .. 1L) != range1.contains(1.toByte())) throw AssertionError() - // no local optimizations - if (element8 in 3L .. 1L != range1.contains(element8)) throw AssertionError() - if (element8 !in 3L .. 1L != !range1.contains(element8)) throw AssertionError() - if (!(element8 in 3L .. 1L) != !range1.contains(element8)) throw AssertionError() - if (!(element8 !in 3L .. 1L) != range1.contains(element8)) throw AssertionError() -} - -fun testR1xE9() { - // with possible local optimizations - if (1.toShort() in 3L .. 1L != range1.contains(1.toShort())) throw AssertionError() - if (1.toShort() !in 3L .. 1L != !range1.contains(1.toShort())) throw AssertionError() - if (!(1.toShort() in 3L .. 1L) != !range1.contains(1.toShort())) throw AssertionError() - if (!(1.toShort() !in 3L .. 1L) != range1.contains(1.toShort())) throw AssertionError() - // no local optimizations - if (element9 in 3L .. 1L != range1.contains(element9)) throw AssertionError() - if (element9 !in 3L .. 1L != !range1.contains(element9)) throw AssertionError() - if (!(element9 in 3L .. 1L) != !range1.contains(element9)) throw AssertionError() - if (!(element9 !in 3L .. 1L) != range1.contains(element9)) throw AssertionError() -} - -fun testR1xE10() { - // with possible local optimizations - if (1 in 3L .. 1L != range1.contains(1)) throw AssertionError() - if (1 !in 3L .. 1L != !range1.contains(1)) throw AssertionError() - if (!(1 in 3L .. 1L) != !range1.contains(1)) throw AssertionError() - if (!(1 !in 3L .. 1L) != range1.contains(1)) throw AssertionError() - // no local optimizations - if (element10 in 3L .. 1L != range1.contains(element10)) throw AssertionError() - if (element10 !in 3L .. 1L != !range1.contains(element10)) throw AssertionError() - if (!(element10 in 3L .. 1L) != !range1.contains(element10)) throw AssertionError() - if (!(element10 !in 3L .. 1L) != range1.contains(element10)) throw AssertionError() -} - -fun testR1xE11() { - // with possible local optimizations - if (1.toLong() in 3L .. 1L != range1.contains(1.toLong())) throw AssertionError() - if (1.toLong() !in 3L .. 1L != !range1.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() in 3L .. 1L) != !range1.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() !in 3L .. 1L) != range1.contains(1.toLong())) throw AssertionError() - // no local optimizations - if (element11 in 3L .. 1L != range1.contains(element11)) throw AssertionError() - if (element11 !in 3L .. 1L != !range1.contains(element11)) throw AssertionError() - if (!(element11 in 3L .. 1L) != !range1.contains(element11)) throw AssertionError() - if (!(element11 !in 3L .. 1L) != range1.contains(element11)) throw AssertionError() -} - -fun testR1xE12() { - // with possible local optimizations - if (2.toByte() in 3L .. 1L != range1.contains(2.toByte())) throw AssertionError() - if (2.toByte() !in 3L .. 1L != !range1.contains(2.toByte())) throw AssertionError() - if (!(2.toByte() in 3L .. 1L) != !range1.contains(2.toByte())) throw AssertionError() - if (!(2.toByte() !in 3L .. 1L) != range1.contains(2.toByte())) throw AssertionError() - // no local optimizations - if (element12 in 3L .. 1L != range1.contains(element12)) throw AssertionError() - if (element12 !in 3L .. 1L != !range1.contains(element12)) throw AssertionError() - if (!(element12 in 3L .. 1L) != !range1.contains(element12)) throw AssertionError() - if (!(element12 !in 3L .. 1L) != range1.contains(element12)) throw AssertionError() -} - -fun testR1xE13() { - // with possible local optimizations - if (2.toShort() in 3L .. 1L != range1.contains(2.toShort())) throw AssertionError() - if (2.toShort() !in 3L .. 1L != !range1.contains(2.toShort())) throw AssertionError() - if (!(2.toShort() in 3L .. 1L) != !range1.contains(2.toShort())) throw AssertionError() - if (!(2.toShort() !in 3L .. 1L) != range1.contains(2.toShort())) throw AssertionError() - // no local optimizations - if (element13 in 3L .. 1L != range1.contains(element13)) throw AssertionError() - if (element13 !in 3L .. 1L != !range1.contains(element13)) throw AssertionError() - if (!(element13 in 3L .. 1L) != !range1.contains(element13)) throw AssertionError() - if (!(element13 !in 3L .. 1L) != range1.contains(element13)) throw AssertionError() -} - -fun testR1xE14() { - // with possible local optimizations - if (2 in 3L .. 1L != range1.contains(2)) throw AssertionError() - if (2 !in 3L .. 1L != !range1.contains(2)) throw AssertionError() - if (!(2 in 3L .. 1L) != !range1.contains(2)) throw AssertionError() - if (!(2 !in 3L .. 1L) != range1.contains(2)) throw AssertionError() - // no local optimizations - if (element14 in 3L .. 1L != range1.contains(element14)) throw AssertionError() - if (element14 !in 3L .. 1L != !range1.contains(element14)) throw AssertionError() - if (!(element14 in 3L .. 1L) != !range1.contains(element14)) throw AssertionError() - if (!(element14 !in 3L .. 1L) != range1.contains(element14)) throw AssertionError() -} - -fun testR1xE15() { - // with possible local optimizations - if (2.toLong() in 3L .. 1L != range1.contains(2.toLong())) throw AssertionError() - if (2.toLong() !in 3L .. 1L != !range1.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() in 3L .. 1L) != !range1.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() !in 3L .. 1L) != range1.contains(2.toLong())) throw AssertionError() - // no local optimizations - if (element15 in 3L .. 1L != range1.contains(element15)) throw AssertionError() - if (element15 !in 3L .. 1L != !range1.contains(element15)) throw AssertionError() - if (!(element15 in 3L .. 1L) != !range1.contains(element15)) throw AssertionError() - if (!(element15 !in 3L .. 1L) != range1.contains(element15)) throw AssertionError() -} - -fun testR1xE16() { - // with possible local optimizations - if (3.toByte() in 3L .. 1L != range1.contains(3.toByte())) throw AssertionError() - if (3.toByte() !in 3L .. 1L != !range1.contains(3.toByte())) throw AssertionError() - if (!(3.toByte() in 3L .. 1L) != !range1.contains(3.toByte())) throw AssertionError() - if (!(3.toByte() !in 3L .. 1L) != range1.contains(3.toByte())) throw AssertionError() - // no local optimizations - if (element16 in 3L .. 1L != range1.contains(element16)) throw AssertionError() - if (element16 !in 3L .. 1L != !range1.contains(element16)) throw AssertionError() - if (!(element16 in 3L .. 1L) != !range1.contains(element16)) throw AssertionError() - if (!(element16 !in 3L .. 1L) != range1.contains(element16)) throw AssertionError() -} - -fun testR1xE17() { - // with possible local optimizations - if (3.toShort() in 3L .. 1L != range1.contains(3.toShort())) throw AssertionError() - if (3.toShort() !in 3L .. 1L != !range1.contains(3.toShort())) throw AssertionError() - if (!(3.toShort() in 3L .. 1L) != !range1.contains(3.toShort())) throw AssertionError() - if (!(3.toShort() !in 3L .. 1L) != range1.contains(3.toShort())) throw AssertionError() - // no local optimizations - if (element17 in 3L .. 1L != range1.contains(element17)) throw AssertionError() - if (element17 !in 3L .. 1L != !range1.contains(element17)) throw AssertionError() - if (!(element17 in 3L .. 1L) != !range1.contains(element17)) throw AssertionError() - if (!(element17 !in 3L .. 1L) != range1.contains(element17)) throw AssertionError() -} - -fun testR1xE18() { - // with possible local optimizations - if (3 in 3L .. 1L != range1.contains(3)) throw AssertionError() - if (3 !in 3L .. 1L != !range1.contains(3)) throw AssertionError() - if (!(3 in 3L .. 1L) != !range1.contains(3)) throw AssertionError() - if (!(3 !in 3L .. 1L) != range1.contains(3)) throw AssertionError() - // no local optimizations - if (element18 in 3L .. 1L != range1.contains(element18)) throw AssertionError() - if (element18 !in 3L .. 1L != !range1.contains(element18)) throw AssertionError() - if (!(element18 in 3L .. 1L) != !range1.contains(element18)) throw AssertionError() - if (!(element18 !in 3L .. 1L) != range1.contains(element18)) throw AssertionError() -} - -fun testR1xE19() { - // with possible local optimizations - if (3.toLong() in 3L .. 1L != range1.contains(3.toLong())) throw AssertionError() - if (3.toLong() !in 3L .. 1L != !range1.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() in 3L .. 1L) != !range1.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() !in 3L .. 1L) != range1.contains(3.toLong())) throw AssertionError() - // no local optimizations - if (element19 in 3L .. 1L != range1.contains(element19)) throw AssertionError() - if (element19 !in 3L .. 1L != !range1.contains(element19)) throw AssertionError() - if (!(element19 in 3L .. 1L) != !range1.contains(element19)) throw AssertionError() - if (!(element19 !in 3L .. 1L) != range1.contains(element19)) throw AssertionError() -} - -fun testR1xE20() { - // with possible local optimizations - if (4.toByte() in 3L .. 1L != range1.contains(4.toByte())) throw AssertionError() - if (4.toByte() !in 3L .. 1L != !range1.contains(4.toByte())) throw AssertionError() - if (!(4.toByte() in 3L .. 1L) != !range1.contains(4.toByte())) throw AssertionError() - if (!(4.toByte() !in 3L .. 1L) != range1.contains(4.toByte())) throw AssertionError() - // no local optimizations - if (element20 in 3L .. 1L != range1.contains(element20)) throw AssertionError() - if (element20 !in 3L .. 1L != !range1.contains(element20)) throw AssertionError() - if (!(element20 in 3L .. 1L) != !range1.contains(element20)) throw AssertionError() - if (!(element20 !in 3L .. 1L) != range1.contains(element20)) throw AssertionError() -} - -fun testR1xE21() { - // with possible local optimizations - if (4.toShort() in 3L .. 1L != range1.contains(4.toShort())) throw AssertionError() - if (4.toShort() !in 3L .. 1L != !range1.contains(4.toShort())) throw AssertionError() - if (!(4.toShort() in 3L .. 1L) != !range1.contains(4.toShort())) throw AssertionError() - if (!(4.toShort() !in 3L .. 1L) != range1.contains(4.toShort())) throw AssertionError() - // no local optimizations - if (element21 in 3L .. 1L != range1.contains(element21)) throw AssertionError() - if (element21 !in 3L .. 1L != !range1.contains(element21)) throw AssertionError() - if (!(element21 in 3L .. 1L) != !range1.contains(element21)) throw AssertionError() - if (!(element21 !in 3L .. 1L) != range1.contains(element21)) throw AssertionError() -} - -fun testR1xE22() { - // with possible local optimizations - if (4 in 3L .. 1L != range1.contains(4)) throw AssertionError() - if (4 !in 3L .. 1L != !range1.contains(4)) throw AssertionError() - if (!(4 in 3L .. 1L) != !range1.contains(4)) throw AssertionError() - if (!(4 !in 3L .. 1L) != range1.contains(4)) throw AssertionError() - // no local optimizations - if (element22 in 3L .. 1L != range1.contains(element22)) throw AssertionError() - if (element22 !in 3L .. 1L != !range1.contains(element22)) throw AssertionError() - if (!(element22 in 3L .. 1L) != !range1.contains(element22)) throw AssertionError() - if (!(element22 !in 3L .. 1L) != range1.contains(element22)) throw AssertionError() -} - -fun testR1xE23() { - // with possible local optimizations - if (4.toLong() in 3L .. 1L != range1.contains(4.toLong())) throw AssertionError() - if (4.toLong() !in 3L .. 1L != !range1.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() in 3L .. 1L) != !range1.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() !in 3L .. 1L) != range1.contains(4.toLong())) throw AssertionError() - // no local optimizations - if (element23 in 3L .. 1L != range1.contains(element23)) throw AssertionError() - if (element23 !in 3L .. 1L != !range1.contains(element23)) throw AssertionError() - if (!(element23 in 3L .. 1L) != !range1.contains(element23)) throw AssertionError() - if (!(element23 !in 3L .. 1L) != range1.contains(element23)) throw AssertionError() -} - - diff --git a/compiler/testData/codegen/box/ranges/contains/generated/longRangeTo.kt b/compiler/testData/codegen/box/ranges/contains/generated/longRangeTo.kt new file mode 100644 index 00000000000..a92d49c5b6b --- /dev/null +++ b/compiler/testData/codegen/box/ranges/contains/generated/longRangeTo.kt @@ -0,0 +1,710 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_STDLIB + + + +val range0 = 1L..3L +val range1 = 3L..1L + +val element0 = (-1).toByte() +val element1 = (-1).toShort() +val element2 = -1 +val element3 = -1L +val element4 = 0.toByte() +val element5 = 0.toShort() +val element6 = 0 +val element7 = 0L +val element8 = 1.toByte() +val element9 = 1.toShort() +val element10 = 1 +val element11 = 1L +val element12 = 2.toByte() +val element13 = 2.toShort() +val element14 = 2 +val element15 = 2L +val element16 = 3.toByte() +val element17 = 3.toShort() +val element18 = 3 +val element19 = 3L +val element20 = 4.toByte() +val element21 = 4.toShort() +val element22 = 4 +val element23 = 4L + +fun box(): String { + testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR0xE5() + testR0xE6() + testR0xE7() + testR0xE8() + testR0xE9() + testR0xE10() + testR0xE11() + testR0xE12() + testR0xE13() + testR0xE14() + testR0xE15() + testR0xE16() + testR0xE17() + testR0xE18() + testR0xE19() + testR0xE20() + testR0xE21() + testR0xE22() + testR0xE23() + testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + testR1xE5() + testR1xE6() + testR1xE7() + testR1xE8() + testR1xE9() + testR1xE10() + testR1xE11() + testR1xE12() + testR1xE13() + testR1xE14() + testR1xE15() + testR1xE16() + testR1xE17() + testR1xE18() + testR1xE19() + testR1xE20() + testR1xE21() + testR1xE22() + testR1xE23() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if ((-1).toByte() in 1L..3L != range0.contains((-1).toByte())) throw AssertionError() + if ((-1).toByte() !in 1L..3L != !range0.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() in 1L..3L) != !range0.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() !in 1L..3L) != range0.contains((-1).toByte())) throw AssertionError() + // no local optimizations + if (element0 in 1L..3L != range0.contains(element0)) throw AssertionError() + if (element0 !in 1L..3L != !range0.contains(element0)) throw AssertionError() + if (!(element0 in 1L..3L) != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in 1L..3L) != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if ((-1).toShort() in 1L..3L != range0.contains((-1).toShort())) throw AssertionError() + if ((-1).toShort() !in 1L..3L != !range0.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() in 1L..3L) != !range0.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() !in 1L..3L) != range0.contains((-1).toShort())) throw AssertionError() + // no local optimizations + if (element1 in 1L..3L != range0.contains(element1)) throw AssertionError() + if (element1 !in 1L..3L != !range0.contains(element1)) throw AssertionError() + if (!(element1 in 1L..3L) != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in 1L..3L) != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if (-1 in 1L..3L != range0.contains(-1)) throw AssertionError() + if (-1 !in 1L..3L != !range0.contains(-1)) throw AssertionError() + if (!(-1 in 1L..3L) != !range0.contains(-1)) throw AssertionError() + if (!(-1 !in 1L..3L) != range0.contains(-1)) throw AssertionError() + // no local optimizations + if (element2 in 1L..3L != range0.contains(element2)) throw AssertionError() + if (element2 !in 1L..3L != !range0.contains(element2)) throw AssertionError() + if (!(element2 in 1L..3L) != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in 1L..3L) != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if (-1L in 1L..3L != range0.contains(-1L)) throw AssertionError() + if (-1L !in 1L..3L != !range0.contains(-1L)) throw AssertionError() + if (!(-1L in 1L..3L) != !range0.contains(-1L)) throw AssertionError() + if (!(-1L !in 1L..3L) != range0.contains(-1L)) throw AssertionError() + // no local optimizations + if (element3 in 1L..3L != range0.contains(element3)) throw AssertionError() + if (element3 !in 1L..3L != !range0.contains(element3)) throw AssertionError() + if (!(element3 in 1L..3L) != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in 1L..3L) != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if (0.toByte() in 1L..3L != range0.contains(0.toByte())) throw AssertionError() + if (0.toByte() !in 1L..3L != !range0.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() in 1L..3L) != !range0.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() !in 1L..3L) != range0.contains(0.toByte())) throw AssertionError() + // no local optimizations + if (element4 in 1L..3L != range0.contains(element4)) throw AssertionError() + if (element4 !in 1L..3L != !range0.contains(element4)) throw AssertionError() + if (!(element4 in 1L..3L) != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in 1L..3L) != range0.contains(element4)) throw AssertionError() +} + +fun testR0xE5() { + // with possible local optimizations + if (0.toShort() in 1L..3L != range0.contains(0.toShort())) throw AssertionError() + if (0.toShort() !in 1L..3L != !range0.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() in 1L..3L) != !range0.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() !in 1L..3L) != range0.contains(0.toShort())) throw AssertionError() + // no local optimizations + if (element5 in 1L..3L != range0.contains(element5)) throw AssertionError() + if (element5 !in 1L..3L != !range0.contains(element5)) throw AssertionError() + if (!(element5 in 1L..3L) != !range0.contains(element5)) throw AssertionError() + if (!(element5 !in 1L..3L) != range0.contains(element5)) throw AssertionError() +} + +fun testR0xE6() { + // with possible local optimizations + if (0 in 1L..3L != range0.contains(0)) throw AssertionError() + if (0 !in 1L..3L != !range0.contains(0)) throw AssertionError() + if (!(0 in 1L..3L) != !range0.contains(0)) throw AssertionError() + if (!(0 !in 1L..3L) != range0.contains(0)) throw AssertionError() + // no local optimizations + if (element6 in 1L..3L != range0.contains(element6)) throw AssertionError() + if (element6 !in 1L..3L != !range0.contains(element6)) throw AssertionError() + if (!(element6 in 1L..3L) != !range0.contains(element6)) throw AssertionError() + if (!(element6 !in 1L..3L) != range0.contains(element6)) throw AssertionError() +} + +fun testR0xE7() { + // with possible local optimizations + if (0L in 1L..3L != range0.contains(0L)) throw AssertionError() + if (0L !in 1L..3L != !range0.contains(0L)) throw AssertionError() + if (!(0L in 1L..3L) != !range0.contains(0L)) throw AssertionError() + if (!(0L !in 1L..3L) != range0.contains(0L)) throw AssertionError() + // no local optimizations + if (element7 in 1L..3L != range0.contains(element7)) throw AssertionError() + if (element7 !in 1L..3L != !range0.contains(element7)) throw AssertionError() + if (!(element7 in 1L..3L) != !range0.contains(element7)) throw AssertionError() + if (!(element7 !in 1L..3L) != range0.contains(element7)) throw AssertionError() +} + +fun testR0xE8() { + // with possible local optimizations + if (1.toByte() in 1L..3L != range0.contains(1.toByte())) throw AssertionError() + if (1.toByte() !in 1L..3L != !range0.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() in 1L..3L) != !range0.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() !in 1L..3L) != range0.contains(1.toByte())) throw AssertionError() + // no local optimizations + if (element8 in 1L..3L != range0.contains(element8)) throw AssertionError() + if (element8 !in 1L..3L != !range0.contains(element8)) throw AssertionError() + if (!(element8 in 1L..3L) != !range0.contains(element8)) throw AssertionError() + if (!(element8 !in 1L..3L) != range0.contains(element8)) throw AssertionError() +} + +fun testR0xE9() { + // with possible local optimizations + if (1.toShort() in 1L..3L != range0.contains(1.toShort())) throw AssertionError() + if (1.toShort() !in 1L..3L != !range0.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() in 1L..3L) != !range0.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() !in 1L..3L) != range0.contains(1.toShort())) throw AssertionError() + // no local optimizations + if (element9 in 1L..3L != range0.contains(element9)) throw AssertionError() + if (element9 !in 1L..3L != !range0.contains(element9)) throw AssertionError() + if (!(element9 in 1L..3L) != !range0.contains(element9)) throw AssertionError() + if (!(element9 !in 1L..3L) != range0.contains(element9)) throw AssertionError() +} + +fun testR0xE10() { + // with possible local optimizations + if (1 in 1L..3L != range0.contains(1)) throw AssertionError() + if (1 !in 1L..3L != !range0.contains(1)) throw AssertionError() + if (!(1 in 1L..3L) != !range0.contains(1)) throw AssertionError() + if (!(1 !in 1L..3L) != range0.contains(1)) throw AssertionError() + // no local optimizations + if (element10 in 1L..3L != range0.contains(element10)) throw AssertionError() + if (element10 !in 1L..3L != !range0.contains(element10)) throw AssertionError() + if (!(element10 in 1L..3L) != !range0.contains(element10)) throw AssertionError() + if (!(element10 !in 1L..3L) != range0.contains(element10)) throw AssertionError() +} + +fun testR0xE11() { + // with possible local optimizations + if (1L in 1L..3L != range0.contains(1L)) throw AssertionError() + if (1L !in 1L..3L != !range0.contains(1L)) throw AssertionError() + if (!(1L in 1L..3L) != !range0.contains(1L)) throw AssertionError() + if (!(1L !in 1L..3L) != range0.contains(1L)) throw AssertionError() + // no local optimizations + if (element11 in 1L..3L != range0.contains(element11)) throw AssertionError() + if (element11 !in 1L..3L != !range0.contains(element11)) throw AssertionError() + if (!(element11 in 1L..3L) != !range0.contains(element11)) throw AssertionError() + if (!(element11 !in 1L..3L) != range0.contains(element11)) throw AssertionError() +} + +fun testR0xE12() { + // with possible local optimizations + if (2.toByte() in 1L..3L != range0.contains(2.toByte())) throw AssertionError() + if (2.toByte() !in 1L..3L != !range0.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() in 1L..3L) != !range0.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() !in 1L..3L) != range0.contains(2.toByte())) throw AssertionError() + // no local optimizations + if (element12 in 1L..3L != range0.contains(element12)) throw AssertionError() + if (element12 !in 1L..3L != !range0.contains(element12)) throw AssertionError() + if (!(element12 in 1L..3L) != !range0.contains(element12)) throw AssertionError() + if (!(element12 !in 1L..3L) != range0.contains(element12)) throw AssertionError() +} + +fun testR0xE13() { + // with possible local optimizations + if (2.toShort() in 1L..3L != range0.contains(2.toShort())) throw AssertionError() + if (2.toShort() !in 1L..3L != !range0.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() in 1L..3L) != !range0.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() !in 1L..3L) != range0.contains(2.toShort())) throw AssertionError() + // no local optimizations + if (element13 in 1L..3L != range0.contains(element13)) throw AssertionError() + if (element13 !in 1L..3L != !range0.contains(element13)) throw AssertionError() + if (!(element13 in 1L..3L) != !range0.contains(element13)) throw AssertionError() + if (!(element13 !in 1L..3L) != range0.contains(element13)) throw AssertionError() +} + +fun testR0xE14() { + // with possible local optimizations + if (2 in 1L..3L != range0.contains(2)) throw AssertionError() + if (2 !in 1L..3L != !range0.contains(2)) throw AssertionError() + if (!(2 in 1L..3L) != !range0.contains(2)) throw AssertionError() + if (!(2 !in 1L..3L) != range0.contains(2)) throw AssertionError() + // no local optimizations + if (element14 in 1L..3L != range0.contains(element14)) throw AssertionError() + if (element14 !in 1L..3L != !range0.contains(element14)) throw AssertionError() + if (!(element14 in 1L..3L) != !range0.contains(element14)) throw AssertionError() + if (!(element14 !in 1L..3L) != range0.contains(element14)) throw AssertionError() +} + +fun testR0xE15() { + // with possible local optimizations + if (2L in 1L..3L != range0.contains(2L)) throw AssertionError() + if (2L !in 1L..3L != !range0.contains(2L)) throw AssertionError() + if (!(2L in 1L..3L) != !range0.contains(2L)) throw AssertionError() + if (!(2L !in 1L..3L) != range0.contains(2L)) throw AssertionError() + // no local optimizations + if (element15 in 1L..3L != range0.contains(element15)) throw AssertionError() + if (element15 !in 1L..3L != !range0.contains(element15)) throw AssertionError() + if (!(element15 in 1L..3L) != !range0.contains(element15)) throw AssertionError() + if (!(element15 !in 1L..3L) != range0.contains(element15)) throw AssertionError() +} + +fun testR0xE16() { + // with possible local optimizations + if (3.toByte() in 1L..3L != range0.contains(3.toByte())) throw AssertionError() + if (3.toByte() !in 1L..3L != !range0.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() in 1L..3L) != !range0.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() !in 1L..3L) != range0.contains(3.toByte())) throw AssertionError() + // no local optimizations + if (element16 in 1L..3L != range0.contains(element16)) throw AssertionError() + if (element16 !in 1L..3L != !range0.contains(element16)) throw AssertionError() + if (!(element16 in 1L..3L) != !range0.contains(element16)) throw AssertionError() + if (!(element16 !in 1L..3L) != range0.contains(element16)) throw AssertionError() +} + +fun testR0xE17() { + // with possible local optimizations + if (3.toShort() in 1L..3L != range0.contains(3.toShort())) throw AssertionError() + if (3.toShort() !in 1L..3L != !range0.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() in 1L..3L) != !range0.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() !in 1L..3L) != range0.contains(3.toShort())) throw AssertionError() + // no local optimizations + if (element17 in 1L..3L != range0.contains(element17)) throw AssertionError() + if (element17 !in 1L..3L != !range0.contains(element17)) throw AssertionError() + if (!(element17 in 1L..3L) != !range0.contains(element17)) throw AssertionError() + if (!(element17 !in 1L..3L) != range0.contains(element17)) throw AssertionError() +} + +fun testR0xE18() { + // with possible local optimizations + if (3 in 1L..3L != range0.contains(3)) throw AssertionError() + if (3 !in 1L..3L != !range0.contains(3)) throw AssertionError() + if (!(3 in 1L..3L) != !range0.contains(3)) throw AssertionError() + if (!(3 !in 1L..3L) != range0.contains(3)) throw AssertionError() + // no local optimizations + if (element18 in 1L..3L != range0.contains(element18)) throw AssertionError() + if (element18 !in 1L..3L != !range0.contains(element18)) throw AssertionError() + if (!(element18 in 1L..3L) != !range0.contains(element18)) throw AssertionError() + if (!(element18 !in 1L..3L) != range0.contains(element18)) throw AssertionError() +} + +fun testR0xE19() { + // with possible local optimizations + if (3L in 1L..3L != range0.contains(3L)) throw AssertionError() + if (3L !in 1L..3L != !range0.contains(3L)) throw AssertionError() + if (!(3L in 1L..3L) != !range0.contains(3L)) throw AssertionError() + if (!(3L !in 1L..3L) != range0.contains(3L)) throw AssertionError() + // no local optimizations + if (element19 in 1L..3L != range0.contains(element19)) throw AssertionError() + if (element19 !in 1L..3L != !range0.contains(element19)) throw AssertionError() + if (!(element19 in 1L..3L) != !range0.contains(element19)) throw AssertionError() + if (!(element19 !in 1L..3L) != range0.contains(element19)) throw AssertionError() +} + +fun testR0xE20() { + // with possible local optimizations + if (4.toByte() in 1L..3L != range0.contains(4.toByte())) throw AssertionError() + if (4.toByte() !in 1L..3L != !range0.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() in 1L..3L) != !range0.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() !in 1L..3L) != range0.contains(4.toByte())) throw AssertionError() + // no local optimizations + if (element20 in 1L..3L != range0.contains(element20)) throw AssertionError() + if (element20 !in 1L..3L != !range0.contains(element20)) throw AssertionError() + if (!(element20 in 1L..3L) != !range0.contains(element20)) throw AssertionError() + if (!(element20 !in 1L..3L) != range0.contains(element20)) throw AssertionError() +} + +fun testR0xE21() { + // with possible local optimizations + if (4.toShort() in 1L..3L != range0.contains(4.toShort())) throw AssertionError() + if (4.toShort() !in 1L..3L != !range0.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() in 1L..3L) != !range0.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() !in 1L..3L) != range0.contains(4.toShort())) throw AssertionError() + // no local optimizations + if (element21 in 1L..3L != range0.contains(element21)) throw AssertionError() + if (element21 !in 1L..3L != !range0.contains(element21)) throw AssertionError() + if (!(element21 in 1L..3L) != !range0.contains(element21)) throw AssertionError() + if (!(element21 !in 1L..3L) != range0.contains(element21)) throw AssertionError() +} + +fun testR0xE22() { + // with possible local optimizations + if (4 in 1L..3L != range0.contains(4)) throw AssertionError() + if (4 !in 1L..3L != !range0.contains(4)) throw AssertionError() + if (!(4 in 1L..3L) != !range0.contains(4)) throw AssertionError() + if (!(4 !in 1L..3L) != range0.contains(4)) throw AssertionError() + // no local optimizations + if (element22 in 1L..3L != range0.contains(element22)) throw AssertionError() + if (element22 !in 1L..3L != !range0.contains(element22)) throw AssertionError() + if (!(element22 in 1L..3L) != !range0.contains(element22)) throw AssertionError() + if (!(element22 !in 1L..3L) != range0.contains(element22)) throw AssertionError() +} + +fun testR0xE23() { + // with possible local optimizations + if (4L in 1L..3L != range0.contains(4L)) throw AssertionError() + if (4L !in 1L..3L != !range0.contains(4L)) throw AssertionError() + if (!(4L in 1L..3L) != !range0.contains(4L)) throw AssertionError() + if (!(4L !in 1L..3L) != range0.contains(4L)) throw AssertionError() + // no local optimizations + if (element23 in 1L..3L != range0.contains(element23)) throw AssertionError() + if (element23 !in 1L..3L != !range0.contains(element23)) throw AssertionError() + if (!(element23 in 1L..3L) != !range0.contains(element23)) throw AssertionError() + if (!(element23 !in 1L..3L) != range0.contains(element23)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if ((-1).toByte() in 3L..1L != range1.contains((-1).toByte())) throw AssertionError() + if ((-1).toByte() !in 3L..1L != !range1.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() in 3L..1L) != !range1.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() !in 3L..1L) != range1.contains((-1).toByte())) throw AssertionError() + // no local optimizations + if (element0 in 3L..1L != range1.contains(element0)) throw AssertionError() + if (element0 !in 3L..1L != !range1.contains(element0)) throw AssertionError() + if (!(element0 in 3L..1L) != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in 3L..1L) != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if ((-1).toShort() in 3L..1L != range1.contains((-1).toShort())) throw AssertionError() + if ((-1).toShort() !in 3L..1L != !range1.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() in 3L..1L) != !range1.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() !in 3L..1L) != range1.contains((-1).toShort())) throw AssertionError() + // no local optimizations + if (element1 in 3L..1L != range1.contains(element1)) throw AssertionError() + if (element1 !in 3L..1L != !range1.contains(element1)) throw AssertionError() + if (!(element1 in 3L..1L) != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in 3L..1L) != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if (-1 in 3L..1L != range1.contains(-1)) throw AssertionError() + if (-1 !in 3L..1L != !range1.contains(-1)) throw AssertionError() + if (!(-1 in 3L..1L) != !range1.contains(-1)) throw AssertionError() + if (!(-1 !in 3L..1L) != range1.contains(-1)) throw AssertionError() + // no local optimizations + if (element2 in 3L..1L != range1.contains(element2)) throw AssertionError() + if (element2 !in 3L..1L != !range1.contains(element2)) throw AssertionError() + if (!(element2 in 3L..1L) != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in 3L..1L) != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if (-1L in 3L..1L != range1.contains(-1L)) throw AssertionError() + if (-1L !in 3L..1L != !range1.contains(-1L)) throw AssertionError() + if (!(-1L in 3L..1L) != !range1.contains(-1L)) throw AssertionError() + if (!(-1L !in 3L..1L) != range1.contains(-1L)) throw AssertionError() + // no local optimizations + if (element3 in 3L..1L != range1.contains(element3)) throw AssertionError() + if (element3 !in 3L..1L != !range1.contains(element3)) throw AssertionError() + if (!(element3 in 3L..1L) != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in 3L..1L) != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if (0.toByte() in 3L..1L != range1.contains(0.toByte())) throw AssertionError() + if (0.toByte() !in 3L..1L != !range1.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() in 3L..1L) != !range1.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() !in 3L..1L) != range1.contains(0.toByte())) throw AssertionError() + // no local optimizations + if (element4 in 3L..1L != range1.contains(element4)) throw AssertionError() + if (element4 !in 3L..1L != !range1.contains(element4)) throw AssertionError() + if (!(element4 in 3L..1L) != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in 3L..1L) != range1.contains(element4)) throw AssertionError() +} + +fun testR1xE5() { + // with possible local optimizations + if (0.toShort() in 3L..1L != range1.contains(0.toShort())) throw AssertionError() + if (0.toShort() !in 3L..1L != !range1.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() in 3L..1L) != !range1.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() !in 3L..1L) != range1.contains(0.toShort())) throw AssertionError() + // no local optimizations + if (element5 in 3L..1L != range1.contains(element5)) throw AssertionError() + if (element5 !in 3L..1L != !range1.contains(element5)) throw AssertionError() + if (!(element5 in 3L..1L) != !range1.contains(element5)) throw AssertionError() + if (!(element5 !in 3L..1L) != range1.contains(element5)) throw AssertionError() +} + +fun testR1xE6() { + // with possible local optimizations + if (0 in 3L..1L != range1.contains(0)) throw AssertionError() + if (0 !in 3L..1L != !range1.contains(0)) throw AssertionError() + if (!(0 in 3L..1L) != !range1.contains(0)) throw AssertionError() + if (!(0 !in 3L..1L) != range1.contains(0)) throw AssertionError() + // no local optimizations + if (element6 in 3L..1L != range1.contains(element6)) throw AssertionError() + if (element6 !in 3L..1L != !range1.contains(element6)) throw AssertionError() + if (!(element6 in 3L..1L) != !range1.contains(element6)) throw AssertionError() + if (!(element6 !in 3L..1L) != range1.contains(element6)) throw AssertionError() +} + +fun testR1xE7() { + // with possible local optimizations + if (0L in 3L..1L != range1.contains(0L)) throw AssertionError() + if (0L !in 3L..1L != !range1.contains(0L)) throw AssertionError() + if (!(0L in 3L..1L) != !range1.contains(0L)) throw AssertionError() + if (!(0L !in 3L..1L) != range1.contains(0L)) throw AssertionError() + // no local optimizations + if (element7 in 3L..1L != range1.contains(element7)) throw AssertionError() + if (element7 !in 3L..1L != !range1.contains(element7)) throw AssertionError() + if (!(element7 in 3L..1L) != !range1.contains(element7)) throw AssertionError() + if (!(element7 !in 3L..1L) != range1.contains(element7)) throw AssertionError() +} + +fun testR1xE8() { + // with possible local optimizations + if (1.toByte() in 3L..1L != range1.contains(1.toByte())) throw AssertionError() + if (1.toByte() !in 3L..1L != !range1.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() in 3L..1L) != !range1.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() !in 3L..1L) != range1.contains(1.toByte())) throw AssertionError() + // no local optimizations + if (element8 in 3L..1L != range1.contains(element8)) throw AssertionError() + if (element8 !in 3L..1L != !range1.contains(element8)) throw AssertionError() + if (!(element8 in 3L..1L) != !range1.contains(element8)) throw AssertionError() + if (!(element8 !in 3L..1L) != range1.contains(element8)) throw AssertionError() +} + +fun testR1xE9() { + // with possible local optimizations + if (1.toShort() in 3L..1L != range1.contains(1.toShort())) throw AssertionError() + if (1.toShort() !in 3L..1L != !range1.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() in 3L..1L) != !range1.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() !in 3L..1L) != range1.contains(1.toShort())) throw AssertionError() + // no local optimizations + if (element9 in 3L..1L != range1.contains(element9)) throw AssertionError() + if (element9 !in 3L..1L != !range1.contains(element9)) throw AssertionError() + if (!(element9 in 3L..1L) != !range1.contains(element9)) throw AssertionError() + if (!(element9 !in 3L..1L) != range1.contains(element9)) throw AssertionError() +} + +fun testR1xE10() { + // with possible local optimizations + if (1 in 3L..1L != range1.contains(1)) throw AssertionError() + if (1 !in 3L..1L != !range1.contains(1)) throw AssertionError() + if (!(1 in 3L..1L) != !range1.contains(1)) throw AssertionError() + if (!(1 !in 3L..1L) != range1.contains(1)) throw AssertionError() + // no local optimizations + if (element10 in 3L..1L != range1.contains(element10)) throw AssertionError() + if (element10 !in 3L..1L != !range1.contains(element10)) throw AssertionError() + if (!(element10 in 3L..1L) != !range1.contains(element10)) throw AssertionError() + if (!(element10 !in 3L..1L) != range1.contains(element10)) throw AssertionError() +} + +fun testR1xE11() { + // with possible local optimizations + if (1L in 3L..1L != range1.contains(1L)) throw AssertionError() + if (1L !in 3L..1L != !range1.contains(1L)) throw AssertionError() + if (!(1L in 3L..1L) != !range1.contains(1L)) throw AssertionError() + if (!(1L !in 3L..1L) != range1.contains(1L)) throw AssertionError() + // no local optimizations + if (element11 in 3L..1L != range1.contains(element11)) throw AssertionError() + if (element11 !in 3L..1L != !range1.contains(element11)) throw AssertionError() + if (!(element11 in 3L..1L) != !range1.contains(element11)) throw AssertionError() + if (!(element11 !in 3L..1L) != range1.contains(element11)) throw AssertionError() +} + +fun testR1xE12() { + // with possible local optimizations + if (2.toByte() in 3L..1L != range1.contains(2.toByte())) throw AssertionError() + if (2.toByte() !in 3L..1L != !range1.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() in 3L..1L) != !range1.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() !in 3L..1L) != range1.contains(2.toByte())) throw AssertionError() + // no local optimizations + if (element12 in 3L..1L != range1.contains(element12)) throw AssertionError() + if (element12 !in 3L..1L != !range1.contains(element12)) throw AssertionError() + if (!(element12 in 3L..1L) != !range1.contains(element12)) throw AssertionError() + if (!(element12 !in 3L..1L) != range1.contains(element12)) throw AssertionError() +} + +fun testR1xE13() { + // with possible local optimizations + if (2.toShort() in 3L..1L != range1.contains(2.toShort())) throw AssertionError() + if (2.toShort() !in 3L..1L != !range1.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() in 3L..1L) != !range1.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() !in 3L..1L) != range1.contains(2.toShort())) throw AssertionError() + // no local optimizations + if (element13 in 3L..1L != range1.contains(element13)) throw AssertionError() + if (element13 !in 3L..1L != !range1.contains(element13)) throw AssertionError() + if (!(element13 in 3L..1L) != !range1.contains(element13)) throw AssertionError() + if (!(element13 !in 3L..1L) != range1.contains(element13)) throw AssertionError() +} + +fun testR1xE14() { + // with possible local optimizations + if (2 in 3L..1L != range1.contains(2)) throw AssertionError() + if (2 !in 3L..1L != !range1.contains(2)) throw AssertionError() + if (!(2 in 3L..1L) != !range1.contains(2)) throw AssertionError() + if (!(2 !in 3L..1L) != range1.contains(2)) throw AssertionError() + // no local optimizations + if (element14 in 3L..1L != range1.contains(element14)) throw AssertionError() + if (element14 !in 3L..1L != !range1.contains(element14)) throw AssertionError() + if (!(element14 in 3L..1L) != !range1.contains(element14)) throw AssertionError() + if (!(element14 !in 3L..1L) != range1.contains(element14)) throw AssertionError() +} + +fun testR1xE15() { + // with possible local optimizations + if (2L in 3L..1L != range1.contains(2L)) throw AssertionError() + if (2L !in 3L..1L != !range1.contains(2L)) throw AssertionError() + if (!(2L in 3L..1L) != !range1.contains(2L)) throw AssertionError() + if (!(2L !in 3L..1L) != range1.contains(2L)) throw AssertionError() + // no local optimizations + if (element15 in 3L..1L != range1.contains(element15)) throw AssertionError() + if (element15 !in 3L..1L != !range1.contains(element15)) throw AssertionError() + if (!(element15 in 3L..1L) != !range1.contains(element15)) throw AssertionError() + if (!(element15 !in 3L..1L) != range1.contains(element15)) throw AssertionError() +} + +fun testR1xE16() { + // with possible local optimizations + if (3.toByte() in 3L..1L != range1.contains(3.toByte())) throw AssertionError() + if (3.toByte() !in 3L..1L != !range1.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() in 3L..1L) != !range1.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() !in 3L..1L) != range1.contains(3.toByte())) throw AssertionError() + // no local optimizations + if (element16 in 3L..1L != range1.contains(element16)) throw AssertionError() + if (element16 !in 3L..1L != !range1.contains(element16)) throw AssertionError() + if (!(element16 in 3L..1L) != !range1.contains(element16)) throw AssertionError() + if (!(element16 !in 3L..1L) != range1.contains(element16)) throw AssertionError() +} + +fun testR1xE17() { + // with possible local optimizations + if (3.toShort() in 3L..1L != range1.contains(3.toShort())) throw AssertionError() + if (3.toShort() !in 3L..1L != !range1.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() in 3L..1L) != !range1.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() !in 3L..1L) != range1.contains(3.toShort())) throw AssertionError() + // no local optimizations + if (element17 in 3L..1L != range1.contains(element17)) throw AssertionError() + if (element17 !in 3L..1L != !range1.contains(element17)) throw AssertionError() + if (!(element17 in 3L..1L) != !range1.contains(element17)) throw AssertionError() + if (!(element17 !in 3L..1L) != range1.contains(element17)) throw AssertionError() +} + +fun testR1xE18() { + // with possible local optimizations + if (3 in 3L..1L != range1.contains(3)) throw AssertionError() + if (3 !in 3L..1L != !range1.contains(3)) throw AssertionError() + if (!(3 in 3L..1L) != !range1.contains(3)) throw AssertionError() + if (!(3 !in 3L..1L) != range1.contains(3)) throw AssertionError() + // no local optimizations + if (element18 in 3L..1L != range1.contains(element18)) throw AssertionError() + if (element18 !in 3L..1L != !range1.contains(element18)) throw AssertionError() + if (!(element18 in 3L..1L) != !range1.contains(element18)) throw AssertionError() + if (!(element18 !in 3L..1L) != range1.contains(element18)) throw AssertionError() +} + +fun testR1xE19() { + // with possible local optimizations + if (3L in 3L..1L != range1.contains(3L)) throw AssertionError() + if (3L !in 3L..1L != !range1.contains(3L)) throw AssertionError() + if (!(3L in 3L..1L) != !range1.contains(3L)) throw AssertionError() + if (!(3L !in 3L..1L) != range1.contains(3L)) throw AssertionError() + // no local optimizations + if (element19 in 3L..1L != range1.contains(element19)) throw AssertionError() + if (element19 !in 3L..1L != !range1.contains(element19)) throw AssertionError() + if (!(element19 in 3L..1L) != !range1.contains(element19)) throw AssertionError() + if (!(element19 !in 3L..1L) != range1.contains(element19)) throw AssertionError() +} + +fun testR1xE20() { + // with possible local optimizations + if (4.toByte() in 3L..1L != range1.contains(4.toByte())) throw AssertionError() + if (4.toByte() !in 3L..1L != !range1.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() in 3L..1L) != !range1.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() !in 3L..1L) != range1.contains(4.toByte())) throw AssertionError() + // no local optimizations + if (element20 in 3L..1L != range1.contains(element20)) throw AssertionError() + if (element20 !in 3L..1L != !range1.contains(element20)) throw AssertionError() + if (!(element20 in 3L..1L) != !range1.contains(element20)) throw AssertionError() + if (!(element20 !in 3L..1L) != range1.contains(element20)) throw AssertionError() +} + +fun testR1xE21() { + // with possible local optimizations + if (4.toShort() in 3L..1L != range1.contains(4.toShort())) throw AssertionError() + if (4.toShort() !in 3L..1L != !range1.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() in 3L..1L) != !range1.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() !in 3L..1L) != range1.contains(4.toShort())) throw AssertionError() + // no local optimizations + if (element21 in 3L..1L != range1.contains(element21)) throw AssertionError() + if (element21 !in 3L..1L != !range1.contains(element21)) throw AssertionError() + if (!(element21 in 3L..1L) != !range1.contains(element21)) throw AssertionError() + if (!(element21 !in 3L..1L) != range1.contains(element21)) throw AssertionError() +} + +fun testR1xE22() { + // with possible local optimizations + if (4 in 3L..1L != range1.contains(4)) throw AssertionError() + if (4 !in 3L..1L != !range1.contains(4)) throw AssertionError() + if (!(4 in 3L..1L) != !range1.contains(4)) throw AssertionError() + if (!(4 !in 3L..1L) != range1.contains(4)) throw AssertionError() + // no local optimizations + if (element22 in 3L..1L != range1.contains(element22)) throw AssertionError() + if (element22 !in 3L..1L != !range1.contains(element22)) throw AssertionError() + if (!(element22 in 3L..1L) != !range1.contains(element22)) throw AssertionError() + if (!(element22 !in 3L..1L) != range1.contains(element22)) throw AssertionError() +} + +fun testR1xE23() { + // with possible local optimizations + if (4L in 3L..1L != range1.contains(4L)) throw AssertionError() + if (4L !in 3L..1L != !range1.contains(4L)) throw AssertionError() + if (!(4L in 3L..1L) != !range1.contains(4L)) throw AssertionError() + if (!(4L !in 3L..1L) != range1.contains(4L)) throw AssertionError() + // no local optimizations + if (element23 in 3L..1L != range1.contains(element23)) throw AssertionError() + if (element23 !in 3L..1L != !range1.contains(element23)) throw AssertionError() + if (!(element23 in 3L..1L) != !range1.contains(element23)) throw AssertionError() + if (!(element23 !in 3L..1L) != range1.contains(element23)) throw AssertionError() +} + + diff --git a/compiler/testData/codegen/box/ranges/contains/generated/longRangeUntil.kt b/compiler/testData/codegen/box/ranges/contains/generated/longRangeUntil.kt new file mode 100644 index 00000000000..ee7be940dac --- /dev/null +++ b/compiler/testData/codegen/box/ranges/contains/generated/longRangeUntil.kt @@ -0,0 +1,713 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_STDLIB +// DONT_TARGET_EXACT_BACKEND: JVM +// !LANGUAGE: +RangeUntilOperator +@file:OptIn(ExperimentalStdlibApi::class) + + + +val range0 = 1L..<3L +val range1 = 3L..<1L + +val element0 = (-1).toByte() +val element1 = (-1).toShort() +val element2 = -1 +val element3 = -1L +val element4 = 0.toByte() +val element5 = 0.toShort() +val element6 = 0 +val element7 = 0L +val element8 = 1.toByte() +val element9 = 1.toShort() +val element10 = 1 +val element11 = 1L +val element12 = 2.toByte() +val element13 = 2.toShort() +val element14 = 2 +val element15 = 2L +val element16 = 3.toByte() +val element17 = 3.toShort() +val element18 = 3 +val element19 = 3L +val element20 = 4.toByte() +val element21 = 4.toShort() +val element22 = 4 +val element23 = 4L + +fun box(): String { + testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR0xE5() + testR0xE6() + testR0xE7() + testR0xE8() + testR0xE9() + testR0xE10() + testR0xE11() + testR0xE12() + testR0xE13() + testR0xE14() + testR0xE15() + testR0xE16() + testR0xE17() + testR0xE18() + testR0xE19() + testR0xE20() + testR0xE21() + testR0xE22() + testR0xE23() + testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + testR1xE5() + testR1xE6() + testR1xE7() + testR1xE8() + testR1xE9() + testR1xE10() + testR1xE11() + testR1xE12() + testR1xE13() + testR1xE14() + testR1xE15() + testR1xE16() + testR1xE17() + testR1xE18() + testR1xE19() + testR1xE20() + testR1xE21() + testR1xE22() + testR1xE23() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if ((-1).toByte() in 1L..<3L != range0.contains((-1).toByte())) throw AssertionError() + if ((-1).toByte() !in 1L..<3L != !range0.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() in 1L..<3L) != !range0.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() !in 1L..<3L) != range0.contains((-1).toByte())) throw AssertionError() + // no local optimizations + if (element0 in 1L..<3L != range0.contains(element0)) throw AssertionError() + if (element0 !in 1L..<3L != !range0.contains(element0)) throw AssertionError() + if (!(element0 in 1L..<3L) != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in 1L..<3L) != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if ((-1).toShort() in 1L..<3L != range0.contains((-1).toShort())) throw AssertionError() + if ((-1).toShort() !in 1L..<3L != !range0.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() in 1L..<3L) != !range0.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() !in 1L..<3L) != range0.contains((-1).toShort())) throw AssertionError() + // no local optimizations + if (element1 in 1L..<3L != range0.contains(element1)) throw AssertionError() + if (element1 !in 1L..<3L != !range0.contains(element1)) throw AssertionError() + if (!(element1 in 1L..<3L) != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in 1L..<3L) != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if (-1 in 1L..<3L != range0.contains(-1)) throw AssertionError() + if (-1 !in 1L..<3L != !range0.contains(-1)) throw AssertionError() + if (!(-1 in 1L..<3L) != !range0.contains(-1)) throw AssertionError() + if (!(-1 !in 1L..<3L) != range0.contains(-1)) throw AssertionError() + // no local optimizations + if (element2 in 1L..<3L != range0.contains(element2)) throw AssertionError() + if (element2 !in 1L..<3L != !range0.contains(element2)) throw AssertionError() + if (!(element2 in 1L..<3L) != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in 1L..<3L) != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if (-1L in 1L..<3L != range0.contains(-1L)) throw AssertionError() + if (-1L !in 1L..<3L != !range0.contains(-1L)) throw AssertionError() + if (!(-1L in 1L..<3L) != !range0.contains(-1L)) throw AssertionError() + if (!(-1L !in 1L..<3L) != range0.contains(-1L)) throw AssertionError() + // no local optimizations + if (element3 in 1L..<3L != range0.contains(element3)) throw AssertionError() + if (element3 !in 1L..<3L != !range0.contains(element3)) throw AssertionError() + if (!(element3 in 1L..<3L) != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in 1L..<3L) != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if (0.toByte() in 1L..<3L != range0.contains(0.toByte())) throw AssertionError() + if (0.toByte() !in 1L..<3L != !range0.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() in 1L..<3L) != !range0.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() !in 1L..<3L) != range0.contains(0.toByte())) throw AssertionError() + // no local optimizations + if (element4 in 1L..<3L != range0.contains(element4)) throw AssertionError() + if (element4 !in 1L..<3L != !range0.contains(element4)) throw AssertionError() + if (!(element4 in 1L..<3L) != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in 1L..<3L) != range0.contains(element4)) throw AssertionError() +} + +fun testR0xE5() { + // with possible local optimizations + if (0.toShort() in 1L..<3L != range0.contains(0.toShort())) throw AssertionError() + if (0.toShort() !in 1L..<3L != !range0.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() in 1L..<3L) != !range0.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() !in 1L..<3L) != range0.contains(0.toShort())) throw AssertionError() + // no local optimizations + if (element5 in 1L..<3L != range0.contains(element5)) throw AssertionError() + if (element5 !in 1L..<3L != !range0.contains(element5)) throw AssertionError() + if (!(element5 in 1L..<3L) != !range0.contains(element5)) throw AssertionError() + if (!(element5 !in 1L..<3L) != range0.contains(element5)) throw AssertionError() +} + +fun testR0xE6() { + // with possible local optimizations + if (0 in 1L..<3L != range0.contains(0)) throw AssertionError() + if (0 !in 1L..<3L != !range0.contains(0)) throw AssertionError() + if (!(0 in 1L..<3L) != !range0.contains(0)) throw AssertionError() + if (!(0 !in 1L..<3L) != range0.contains(0)) throw AssertionError() + // no local optimizations + if (element6 in 1L..<3L != range0.contains(element6)) throw AssertionError() + if (element6 !in 1L..<3L != !range0.contains(element6)) throw AssertionError() + if (!(element6 in 1L..<3L) != !range0.contains(element6)) throw AssertionError() + if (!(element6 !in 1L..<3L) != range0.contains(element6)) throw AssertionError() +} + +fun testR0xE7() { + // with possible local optimizations + if (0L in 1L..<3L != range0.contains(0L)) throw AssertionError() + if (0L !in 1L..<3L != !range0.contains(0L)) throw AssertionError() + if (!(0L in 1L..<3L) != !range0.contains(0L)) throw AssertionError() + if (!(0L !in 1L..<3L) != range0.contains(0L)) throw AssertionError() + // no local optimizations + if (element7 in 1L..<3L != range0.contains(element7)) throw AssertionError() + if (element7 !in 1L..<3L != !range0.contains(element7)) throw AssertionError() + if (!(element7 in 1L..<3L) != !range0.contains(element7)) throw AssertionError() + if (!(element7 !in 1L..<3L) != range0.contains(element7)) throw AssertionError() +} + +fun testR0xE8() { + // with possible local optimizations + if (1.toByte() in 1L..<3L != range0.contains(1.toByte())) throw AssertionError() + if (1.toByte() !in 1L..<3L != !range0.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() in 1L..<3L) != !range0.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() !in 1L..<3L) != range0.contains(1.toByte())) throw AssertionError() + // no local optimizations + if (element8 in 1L..<3L != range0.contains(element8)) throw AssertionError() + if (element8 !in 1L..<3L != !range0.contains(element8)) throw AssertionError() + if (!(element8 in 1L..<3L) != !range0.contains(element8)) throw AssertionError() + if (!(element8 !in 1L..<3L) != range0.contains(element8)) throw AssertionError() +} + +fun testR0xE9() { + // with possible local optimizations + if (1.toShort() in 1L..<3L != range0.contains(1.toShort())) throw AssertionError() + if (1.toShort() !in 1L..<3L != !range0.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() in 1L..<3L) != !range0.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() !in 1L..<3L) != range0.contains(1.toShort())) throw AssertionError() + // no local optimizations + if (element9 in 1L..<3L != range0.contains(element9)) throw AssertionError() + if (element9 !in 1L..<3L != !range0.contains(element9)) throw AssertionError() + if (!(element9 in 1L..<3L) != !range0.contains(element9)) throw AssertionError() + if (!(element9 !in 1L..<3L) != range0.contains(element9)) throw AssertionError() +} + +fun testR0xE10() { + // with possible local optimizations + if (1 in 1L..<3L != range0.contains(1)) throw AssertionError() + if (1 !in 1L..<3L != !range0.contains(1)) throw AssertionError() + if (!(1 in 1L..<3L) != !range0.contains(1)) throw AssertionError() + if (!(1 !in 1L..<3L) != range0.contains(1)) throw AssertionError() + // no local optimizations + if (element10 in 1L..<3L != range0.contains(element10)) throw AssertionError() + if (element10 !in 1L..<3L != !range0.contains(element10)) throw AssertionError() + if (!(element10 in 1L..<3L) != !range0.contains(element10)) throw AssertionError() + if (!(element10 !in 1L..<3L) != range0.contains(element10)) throw AssertionError() +} + +fun testR0xE11() { + // with possible local optimizations + if (1L in 1L..<3L != range0.contains(1L)) throw AssertionError() + if (1L !in 1L..<3L != !range0.contains(1L)) throw AssertionError() + if (!(1L in 1L..<3L) != !range0.contains(1L)) throw AssertionError() + if (!(1L !in 1L..<3L) != range0.contains(1L)) throw AssertionError() + // no local optimizations + if (element11 in 1L..<3L != range0.contains(element11)) throw AssertionError() + if (element11 !in 1L..<3L != !range0.contains(element11)) throw AssertionError() + if (!(element11 in 1L..<3L) != !range0.contains(element11)) throw AssertionError() + if (!(element11 !in 1L..<3L) != range0.contains(element11)) throw AssertionError() +} + +fun testR0xE12() { + // with possible local optimizations + if (2.toByte() in 1L..<3L != range0.contains(2.toByte())) throw AssertionError() + if (2.toByte() !in 1L..<3L != !range0.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() in 1L..<3L) != !range0.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() !in 1L..<3L) != range0.contains(2.toByte())) throw AssertionError() + // no local optimizations + if (element12 in 1L..<3L != range0.contains(element12)) throw AssertionError() + if (element12 !in 1L..<3L != !range0.contains(element12)) throw AssertionError() + if (!(element12 in 1L..<3L) != !range0.contains(element12)) throw AssertionError() + if (!(element12 !in 1L..<3L) != range0.contains(element12)) throw AssertionError() +} + +fun testR0xE13() { + // with possible local optimizations + if (2.toShort() in 1L..<3L != range0.contains(2.toShort())) throw AssertionError() + if (2.toShort() !in 1L..<3L != !range0.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() in 1L..<3L) != !range0.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() !in 1L..<3L) != range0.contains(2.toShort())) throw AssertionError() + // no local optimizations + if (element13 in 1L..<3L != range0.contains(element13)) throw AssertionError() + if (element13 !in 1L..<3L != !range0.contains(element13)) throw AssertionError() + if (!(element13 in 1L..<3L) != !range0.contains(element13)) throw AssertionError() + if (!(element13 !in 1L..<3L) != range0.contains(element13)) throw AssertionError() +} + +fun testR0xE14() { + // with possible local optimizations + if (2 in 1L..<3L != range0.contains(2)) throw AssertionError() + if (2 !in 1L..<3L != !range0.contains(2)) throw AssertionError() + if (!(2 in 1L..<3L) != !range0.contains(2)) throw AssertionError() + if (!(2 !in 1L..<3L) != range0.contains(2)) throw AssertionError() + // no local optimizations + if (element14 in 1L..<3L != range0.contains(element14)) throw AssertionError() + if (element14 !in 1L..<3L != !range0.contains(element14)) throw AssertionError() + if (!(element14 in 1L..<3L) != !range0.contains(element14)) throw AssertionError() + if (!(element14 !in 1L..<3L) != range0.contains(element14)) throw AssertionError() +} + +fun testR0xE15() { + // with possible local optimizations + if (2L in 1L..<3L != range0.contains(2L)) throw AssertionError() + if (2L !in 1L..<3L != !range0.contains(2L)) throw AssertionError() + if (!(2L in 1L..<3L) != !range0.contains(2L)) throw AssertionError() + if (!(2L !in 1L..<3L) != range0.contains(2L)) throw AssertionError() + // no local optimizations + if (element15 in 1L..<3L != range0.contains(element15)) throw AssertionError() + if (element15 !in 1L..<3L != !range0.contains(element15)) throw AssertionError() + if (!(element15 in 1L..<3L) != !range0.contains(element15)) throw AssertionError() + if (!(element15 !in 1L..<3L) != range0.contains(element15)) throw AssertionError() +} + +fun testR0xE16() { + // with possible local optimizations + if (3.toByte() in 1L..<3L != range0.contains(3.toByte())) throw AssertionError() + if (3.toByte() !in 1L..<3L != !range0.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() in 1L..<3L) != !range0.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() !in 1L..<3L) != range0.contains(3.toByte())) throw AssertionError() + // no local optimizations + if (element16 in 1L..<3L != range0.contains(element16)) throw AssertionError() + if (element16 !in 1L..<3L != !range0.contains(element16)) throw AssertionError() + if (!(element16 in 1L..<3L) != !range0.contains(element16)) throw AssertionError() + if (!(element16 !in 1L..<3L) != range0.contains(element16)) throw AssertionError() +} + +fun testR0xE17() { + // with possible local optimizations + if (3.toShort() in 1L..<3L != range0.contains(3.toShort())) throw AssertionError() + if (3.toShort() !in 1L..<3L != !range0.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() in 1L..<3L) != !range0.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() !in 1L..<3L) != range0.contains(3.toShort())) throw AssertionError() + // no local optimizations + if (element17 in 1L..<3L != range0.contains(element17)) throw AssertionError() + if (element17 !in 1L..<3L != !range0.contains(element17)) throw AssertionError() + if (!(element17 in 1L..<3L) != !range0.contains(element17)) throw AssertionError() + if (!(element17 !in 1L..<3L) != range0.contains(element17)) throw AssertionError() +} + +fun testR0xE18() { + // with possible local optimizations + if (3 in 1L..<3L != range0.contains(3)) throw AssertionError() + if (3 !in 1L..<3L != !range0.contains(3)) throw AssertionError() + if (!(3 in 1L..<3L) != !range0.contains(3)) throw AssertionError() + if (!(3 !in 1L..<3L) != range0.contains(3)) throw AssertionError() + // no local optimizations + if (element18 in 1L..<3L != range0.contains(element18)) throw AssertionError() + if (element18 !in 1L..<3L != !range0.contains(element18)) throw AssertionError() + if (!(element18 in 1L..<3L) != !range0.contains(element18)) throw AssertionError() + if (!(element18 !in 1L..<3L) != range0.contains(element18)) throw AssertionError() +} + +fun testR0xE19() { + // with possible local optimizations + if (3L in 1L..<3L != range0.contains(3L)) throw AssertionError() + if (3L !in 1L..<3L != !range0.contains(3L)) throw AssertionError() + if (!(3L in 1L..<3L) != !range0.contains(3L)) throw AssertionError() + if (!(3L !in 1L..<3L) != range0.contains(3L)) throw AssertionError() + // no local optimizations + if (element19 in 1L..<3L != range0.contains(element19)) throw AssertionError() + if (element19 !in 1L..<3L != !range0.contains(element19)) throw AssertionError() + if (!(element19 in 1L..<3L) != !range0.contains(element19)) throw AssertionError() + if (!(element19 !in 1L..<3L) != range0.contains(element19)) throw AssertionError() +} + +fun testR0xE20() { + // with possible local optimizations + if (4.toByte() in 1L..<3L != range0.contains(4.toByte())) throw AssertionError() + if (4.toByte() !in 1L..<3L != !range0.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() in 1L..<3L) != !range0.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() !in 1L..<3L) != range0.contains(4.toByte())) throw AssertionError() + // no local optimizations + if (element20 in 1L..<3L != range0.contains(element20)) throw AssertionError() + if (element20 !in 1L..<3L != !range0.contains(element20)) throw AssertionError() + if (!(element20 in 1L..<3L) != !range0.contains(element20)) throw AssertionError() + if (!(element20 !in 1L..<3L) != range0.contains(element20)) throw AssertionError() +} + +fun testR0xE21() { + // with possible local optimizations + if (4.toShort() in 1L..<3L != range0.contains(4.toShort())) throw AssertionError() + if (4.toShort() !in 1L..<3L != !range0.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() in 1L..<3L) != !range0.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() !in 1L..<3L) != range0.contains(4.toShort())) throw AssertionError() + // no local optimizations + if (element21 in 1L..<3L != range0.contains(element21)) throw AssertionError() + if (element21 !in 1L..<3L != !range0.contains(element21)) throw AssertionError() + if (!(element21 in 1L..<3L) != !range0.contains(element21)) throw AssertionError() + if (!(element21 !in 1L..<3L) != range0.contains(element21)) throw AssertionError() +} + +fun testR0xE22() { + // with possible local optimizations + if (4 in 1L..<3L != range0.contains(4)) throw AssertionError() + if (4 !in 1L..<3L != !range0.contains(4)) throw AssertionError() + if (!(4 in 1L..<3L) != !range0.contains(4)) throw AssertionError() + if (!(4 !in 1L..<3L) != range0.contains(4)) throw AssertionError() + // no local optimizations + if (element22 in 1L..<3L != range0.contains(element22)) throw AssertionError() + if (element22 !in 1L..<3L != !range0.contains(element22)) throw AssertionError() + if (!(element22 in 1L..<3L) != !range0.contains(element22)) throw AssertionError() + if (!(element22 !in 1L..<3L) != range0.contains(element22)) throw AssertionError() +} + +fun testR0xE23() { + // with possible local optimizations + if (4L in 1L..<3L != range0.contains(4L)) throw AssertionError() + if (4L !in 1L..<3L != !range0.contains(4L)) throw AssertionError() + if (!(4L in 1L..<3L) != !range0.contains(4L)) throw AssertionError() + if (!(4L !in 1L..<3L) != range0.contains(4L)) throw AssertionError() + // no local optimizations + if (element23 in 1L..<3L != range0.contains(element23)) throw AssertionError() + if (element23 !in 1L..<3L != !range0.contains(element23)) throw AssertionError() + if (!(element23 in 1L..<3L) != !range0.contains(element23)) throw AssertionError() + if (!(element23 !in 1L..<3L) != range0.contains(element23)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if ((-1).toByte() in 3L..<1L != range1.contains((-1).toByte())) throw AssertionError() + if ((-1).toByte() !in 3L..<1L != !range1.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() in 3L..<1L) != !range1.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() !in 3L..<1L) != range1.contains((-1).toByte())) throw AssertionError() + // no local optimizations + if (element0 in 3L..<1L != range1.contains(element0)) throw AssertionError() + if (element0 !in 3L..<1L != !range1.contains(element0)) throw AssertionError() + if (!(element0 in 3L..<1L) != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in 3L..<1L) != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if ((-1).toShort() in 3L..<1L != range1.contains((-1).toShort())) throw AssertionError() + if ((-1).toShort() !in 3L..<1L != !range1.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() in 3L..<1L) != !range1.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() !in 3L..<1L) != range1.contains((-1).toShort())) throw AssertionError() + // no local optimizations + if (element1 in 3L..<1L != range1.contains(element1)) throw AssertionError() + if (element1 !in 3L..<1L != !range1.contains(element1)) throw AssertionError() + if (!(element1 in 3L..<1L) != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in 3L..<1L) != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if (-1 in 3L..<1L != range1.contains(-1)) throw AssertionError() + if (-1 !in 3L..<1L != !range1.contains(-1)) throw AssertionError() + if (!(-1 in 3L..<1L) != !range1.contains(-1)) throw AssertionError() + if (!(-1 !in 3L..<1L) != range1.contains(-1)) throw AssertionError() + // no local optimizations + if (element2 in 3L..<1L != range1.contains(element2)) throw AssertionError() + if (element2 !in 3L..<1L != !range1.contains(element2)) throw AssertionError() + if (!(element2 in 3L..<1L) != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in 3L..<1L) != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if (-1L in 3L..<1L != range1.contains(-1L)) throw AssertionError() + if (-1L !in 3L..<1L != !range1.contains(-1L)) throw AssertionError() + if (!(-1L in 3L..<1L) != !range1.contains(-1L)) throw AssertionError() + if (!(-1L !in 3L..<1L) != range1.contains(-1L)) throw AssertionError() + // no local optimizations + if (element3 in 3L..<1L != range1.contains(element3)) throw AssertionError() + if (element3 !in 3L..<1L != !range1.contains(element3)) throw AssertionError() + if (!(element3 in 3L..<1L) != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in 3L..<1L) != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if (0.toByte() in 3L..<1L != range1.contains(0.toByte())) throw AssertionError() + if (0.toByte() !in 3L..<1L != !range1.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() in 3L..<1L) != !range1.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() !in 3L..<1L) != range1.contains(0.toByte())) throw AssertionError() + // no local optimizations + if (element4 in 3L..<1L != range1.contains(element4)) throw AssertionError() + if (element4 !in 3L..<1L != !range1.contains(element4)) throw AssertionError() + if (!(element4 in 3L..<1L) != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in 3L..<1L) != range1.contains(element4)) throw AssertionError() +} + +fun testR1xE5() { + // with possible local optimizations + if (0.toShort() in 3L..<1L != range1.contains(0.toShort())) throw AssertionError() + if (0.toShort() !in 3L..<1L != !range1.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() in 3L..<1L) != !range1.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() !in 3L..<1L) != range1.contains(0.toShort())) throw AssertionError() + // no local optimizations + if (element5 in 3L..<1L != range1.contains(element5)) throw AssertionError() + if (element5 !in 3L..<1L != !range1.contains(element5)) throw AssertionError() + if (!(element5 in 3L..<1L) != !range1.contains(element5)) throw AssertionError() + if (!(element5 !in 3L..<1L) != range1.contains(element5)) throw AssertionError() +} + +fun testR1xE6() { + // with possible local optimizations + if (0 in 3L..<1L != range1.contains(0)) throw AssertionError() + if (0 !in 3L..<1L != !range1.contains(0)) throw AssertionError() + if (!(0 in 3L..<1L) != !range1.contains(0)) throw AssertionError() + if (!(0 !in 3L..<1L) != range1.contains(0)) throw AssertionError() + // no local optimizations + if (element6 in 3L..<1L != range1.contains(element6)) throw AssertionError() + if (element6 !in 3L..<1L != !range1.contains(element6)) throw AssertionError() + if (!(element6 in 3L..<1L) != !range1.contains(element6)) throw AssertionError() + if (!(element6 !in 3L..<1L) != range1.contains(element6)) throw AssertionError() +} + +fun testR1xE7() { + // with possible local optimizations + if (0L in 3L..<1L != range1.contains(0L)) throw AssertionError() + if (0L !in 3L..<1L != !range1.contains(0L)) throw AssertionError() + if (!(0L in 3L..<1L) != !range1.contains(0L)) throw AssertionError() + if (!(0L !in 3L..<1L) != range1.contains(0L)) throw AssertionError() + // no local optimizations + if (element7 in 3L..<1L != range1.contains(element7)) throw AssertionError() + if (element7 !in 3L..<1L != !range1.contains(element7)) throw AssertionError() + if (!(element7 in 3L..<1L) != !range1.contains(element7)) throw AssertionError() + if (!(element7 !in 3L..<1L) != range1.contains(element7)) throw AssertionError() +} + +fun testR1xE8() { + // with possible local optimizations + if (1.toByte() in 3L..<1L != range1.contains(1.toByte())) throw AssertionError() + if (1.toByte() !in 3L..<1L != !range1.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() in 3L..<1L) != !range1.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() !in 3L..<1L) != range1.contains(1.toByte())) throw AssertionError() + // no local optimizations + if (element8 in 3L..<1L != range1.contains(element8)) throw AssertionError() + if (element8 !in 3L..<1L != !range1.contains(element8)) throw AssertionError() + if (!(element8 in 3L..<1L) != !range1.contains(element8)) throw AssertionError() + if (!(element8 !in 3L..<1L) != range1.contains(element8)) throw AssertionError() +} + +fun testR1xE9() { + // with possible local optimizations + if (1.toShort() in 3L..<1L != range1.contains(1.toShort())) throw AssertionError() + if (1.toShort() !in 3L..<1L != !range1.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() in 3L..<1L) != !range1.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() !in 3L..<1L) != range1.contains(1.toShort())) throw AssertionError() + // no local optimizations + if (element9 in 3L..<1L != range1.contains(element9)) throw AssertionError() + if (element9 !in 3L..<1L != !range1.contains(element9)) throw AssertionError() + if (!(element9 in 3L..<1L) != !range1.contains(element9)) throw AssertionError() + if (!(element9 !in 3L..<1L) != range1.contains(element9)) throw AssertionError() +} + +fun testR1xE10() { + // with possible local optimizations + if (1 in 3L..<1L != range1.contains(1)) throw AssertionError() + if (1 !in 3L..<1L != !range1.contains(1)) throw AssertionError() + if (!(1 in 3L..<1L) != !range1.contains(1)) throw AssertionError() + if (!(1 !in 3L..<1L) != range1.contains(1)) throw AssertionError() + // no local optimizations + if (element10 in 3L..<1L != range1.contains(element10)) throw AssertionError() + if (element10 !in 3L..<1L != !range1.contains(element10)) throw AssertionError() + if (!(element10 in 3L..<1L) != !range1.contains(element10)) throw AssertionError() + if (!(element10 !in 3L..<1L) != range1.contains(element10)) throw AssertionError() +} + +fun testR1xE11() { + // with possible local optimizations + if (1L in 3L..<1L != range1.contains(1L)) throw AssertionError() + if (1L !in 3L..<1L != !range1.contains(1L)) throw AssertionError() + if (!(1L in 3L..<1L) != !range1.contains(1L)) throw AssertionError() + if (!(1L !in 3L..<1L) != range1.contains(1L)) throw AssertionError() + // no local optimizations + if (element11 in 3L..<1L != range1.contains(element11)) throw AssertionError() + if (element11 !in 3L..<1L != !range1.contains(element11)) throw AssertionError() + if (!(element11 in 3L..<1L) != !range1.contains(element11)) throw AssertionError() + if (!(element11 !in 3L..<1L) != range1.contains(element11)) throw AssertionError() +} + +fun testR1xE12() { + // with possible local optimizations + if (2.toByte() in 3L..<1L != range1.contains(2.toByte())) throw AssertionError() + if (2.toByte() !in 3L..<1L != !range1.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() in 3L..<1L) != !range1.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() !in 3L..<1L) != range1.contains(2.toByte())) throw AssertionError() + // no local optimizations + if (element12 in 3L..<1L != range1.contains(element12)) throw AssertionError() + if (element12 !in 3L..<1L != !range1.contains(element12)) throw AssertionError() + if (!(element12 in 3L..<1L) != !range1.contains(element12)) throw AssertionError() + if (!(element12 !in 3L..<1L) != range1.contains(element12)) throw AssertionError() +} + +fun testR1xE13() { + // with possible local optimizations + if (2.toShort() in 3L..<1L != range1.contains(2.toShort())) throw AssertionError() + if (2.toShort() !in 3L..<1L != !range1.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() in 3L..<1L) != !range1.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() !in 3L..<1L) != range1.contains(2.toShort())) throw AssertionError() + // no local optimizations + if (element13 in 3L..<1L != range1.contains(element13)) throw AssertionError() + if (element13 !in 3L..<1L != !range1.contains(element13)) throw AssertionError() + if (!(element13 in 3L..<1L) != !range1.contains(element13)) throw AssertionError() + if (!(element13 !in 3L..<1L) != range1.contains(element13)) throw AssertionError() +} + +fun testR1xE14() { + // with possible local optimizations + if (2 in 3L..<1L != range1.contains(2)) throw AssertionError() + if (2 !in 3L..<1L != !range1.contains(2)) throw AssertionError() + if (!(2 in 3L..<1L) != !range1.contains(2)) throw AssertionError() + if (!(2 !in 3L..<1L) != range1.contains(2)) throw AssertionError() + // no local optimizations + if (element14 in 3L..<1L != range1.contains(element14)) throw AssertionError() + if (element14 !in 3L..<1L != !range1.contains(element14)) throw AssertionError() + if (!(element14 in 3L..<1L) != !range1.contains(element14)) throw AssertionError() + if (!(element14 !in 3L..<1L) != range1.contains(element14)) throw AssertionError() +} + +fun testR1xE15() { + // with possible local optimizations + if (2L in 3L..<1L != range1.contains(2L)) throw AssertionError() + if (2L !in 3L..<1L != !range1.contains(2L)) throw AssertionError() + if (!(2L in 3L..<1L) != !range1.contains(2L)) throw AssertionError() + if (!(2L !in 3L..<1L) != range1.contains(2L)) throw AssertionError() + // no local optimizations + if (element15 in 3L..<1L != range1.contains(element15)) throw AssertionError() + if (element15 !in 3L..<1L != !range1.contains(element15)) throw AssertionError() + if (!(element15 in 3L..<1L) != !range1.contains(element15)) throw AssertionError() + if (!(element15 !in 3L..<1L) != range1.contains(element15)) throw AssertionError() +} + +fun testR1xE16() { + // with possible local optimizations + if (3.toByte() in 3L..<1L != range1.contains(3.toByte())) throw AssertionError() + if (3.toByte() !in 3L..<1L != !range1.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() in 3L..<1L) != !range1.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() !in 3L..<1L) != range1.contains(3.toByte())) throw AssertionError() + // no local optimizations + if (element16 in 3L..<1L != range1.contains(element16)) throw AssertionError() + if (element16 !in 3L..<1L != !range1.contains(element16)) throw AssertionError() + if (!(element16 in 3L..<1L) != !range1.contains(element16)) throw AssertionError() + if (!(element16 !in 3L..<1L) != range1.contains(element16)) throw AssertionError() +} + +fun testR1xE17() { + // with possible local optimizations + if (3.toShort() in 3L..<1L != range1.contains(3.toShort())) throw AssertionError() + if (3.toShort() !in 3L..<1L != !range1.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() in 3L..<1L) != !range1.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() !in 3L..<1L) != range1.contains(3.toShort())) throw AssertionError() + // no local optimizations + if (element17 in 3L..<1L != range1.contains(element17)) throw AssertionError() + if (element17 !in 3L..<1L != !range1.contains(element17)) throw AssertionError() + if (!(element17 in 3L..<1L) != !range1.contains(element17)) throw AssertionError() + if (!(element17 !in 3L..<1L) != range1.contains(element17)) throw AssertionError() +} + +fun testR1xE18() { + // with possible local optimizations + if (3 in 3L..<1L != range1.contains(3)) throw AssertionError() + if (3 !in 3L..<1L != !range1.contains(3)) throw AssertionError() + if (!(3 in 3L..<1L) != !range1.contains(3)) throw AssertionError() + if (!(3 !in 3L..<1L) != range1.contains(3)) throw AssertionError() + // no local optimizations + if (element18 in 3L..<1L != range1.contains(element18)) throw AssertionError() + if (element18 !in 3L..<1L != !range1.contains(element18)) throw AssertionError() + if (!(element18 in 3L..<1L) != !range1.contains(element18)) throw AssertionError() + if (!(element18 !in 3L..<1L) != range1.contains(element18)) throw AssertionError() +} + +fun testR1xE19() { + // with possible local optimizations + if (3L in 3L..<1L != range1.contains(3L)) throw AssertionError() + if (3L !in 3L..<1L != !range1.contains(3L)) throw AssertionError() + if (!(3L in 3L..<1L) != !range1.contains(3L)) throw AssertionError() + if (!(3L !in 3L..<1L) != range1.contains(3L)) throw AssertionError() + // no local optimizations + if (element19 in 3L..<1L != range1.contains(element19)) throw AssertionError() + if (element19 !in 3L..<1L != !range1.contains(element19)) throw AssertionError() + if (!(element19 in 3L..<1L) != !range1.contains(element19)) throw AssertionError() + if (!(element19 !in 3L..<1L) != range1.contains(element19)) throw AssertionError() +} + +fun testR1xE20() { + // with possible local optimizations + if (4.toByte() in 3L..<1L != range1.contains(4.toByte())) throw AssertionError() + if (4.toByte() !in 3L..<1L != !range1.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() in 3L..<1L) != !range1.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() !in 3L..<1L) != range1.contains(4.toByte())) throw AssertionError() + // no local optimizations + if (element20 in 3L..<1L != range1.contains(element20)) throw AssertionError() + if (element20 !in 3L..<1L != !range1.contains(element20)) throw AssertionError() + if (!(element20 in 3L..<1L) != !range1.contains(element20)) throw AssertionError() + if (!(element20 !in 3L..<1L) != range1.contains(element20)) throw AssertionError() +} + +fun testR1xE21() { + // with possible local optimizations + if (4.toShort() in 3L..<1L != range1.contains(4.toShort())) throw AssertionError() + if (4.toShort() !in 3L..<1L != !range1.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() in 3L..<1L) != !range1.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() !in 3L..<1L) != range1.contains(4.toShort())) throw AssertionError() + // no local optimizations + if (element21 in 3L..<1L != range1.contains(element21)) throw AssertionError() + if (element21 !in 3L..<1L != !range1.contains(element21)) throw AssertionError() + if (!(element21 in 3L..<1L) != !range1.contains(element21)) throw AssertionError() + if (!(element21 !in 3L..<1L) != range1.contains(element21)) throw AssertionError() +} + +fun testR1xE22() { + // with possible local optimizations + if (4 in 3L..<1L != range1.contains(4)) throw AssertionError() + if (4 !in 3L..<1L != !range1.contains(4)) throw AssertionError() + if (!(4 in 3L..<1L) != !range1.contains(4)) throw AssertionError() + if (!(4 !in 3L..<1L) != range1.contains(4)) throw AssertionError() + // no local optimizations + if (element22 in 3L..<1L != range1.contains(element22)) throw AssertionError() + if (element22 !in 3L..<1L != !range1.contains(element22)) throw AssertionError() + if (!(element22 in 3L..<1L) != !range1.contains(element22)) throw AssertionError() + if (!(element22 !in 3L..<1L) != range1.contains(element22)) throw AssertionError() +} + +fun testR1xE23() { + // with possible local optimizations + if (4L in 3L..<1L != range1.contains(4L)) throw AssertionError() + if (4L !in 3L..<1L != !range1.contains(4L)) throw AssertionError() + if (!(4L in 3L..<1L) != !range1.contains(4L)) throw AssertionError() + if (!(4L !in 3L..<1L) != range1.contains(4L)) throw AssertionError() + // no local optimizations + if (element23 in 3L..<1L != range1.contains(element23)) throw AssertionError() + if (element23 !in 3L..<1L != !range1.contains(element23)) throw AssertionError() + if (!(element23 in 3L..<1L) != !range1.contains(element23)) throw AssertionError() + if (!(element23 !in 3L..<1L) != range1.contains(element23)) throw AssertionError() +} + + diff --git a/compiler/testData/codegen/box/ranges/contains/generated/longUntil.kt b/compiler/testData/codegen/box/ranges/contains/generated/longUntil.kt index 4e6f20f2b44..376b8f68ed5 100644 --- a/compiler/testData/codegen/box/ranges/contains/generated/longUntil.kt +++ b/compiler/testData/codegen/box/ranges/contains/generated/longUntil.kt @@ -8,28 +8,28 @@ val range1 = 3L until 1L val element0 = (-1).toByte() val element1 = (-1).toShort() -val element2 = (-1) -val element3 = (-1).toLong() +val element2 = -1 +val element3 = -1L val element4 = 0.toByte() val element5 = 0.toShort() val element6 = 0 -val element7 = 0.toLong() +val element7 = 0L val element8 = 1.toByte() val element9 = 1.toShort() val element10 = 1 -val element11 = 1.toLong() +val element11 = 1L val element12 = 2.toByte() val element13 = 2.toShort() val element14 = 2 -val element15 = 2.toLong() +val element15 = 2L val element16 = 3.toByte() val element17 = 3.toShort() val element18 = 3 -val element19 = 3.toLong() +val element19 = 3L val element20 = 4.toByte() val element21 = 4.toShort() val element22 = 4 -val element23 = 4.toLong() +val element23 = 4L fun box(): String { testR0xE0() @@ -111,10 +111,10 @@ fun testR0xE1() { fun testR0xE2() { // with possible local optimizations - if ((-1) in 1L until 3L != range0.contains((-1))) throw AssertionError() - if ((-1) !in 1L until 3L != !range0.contains((-1))) throw AssertionError() - if (!((-1) in 1L until 3L) != !range0.contains((-1))) throw AssertionError() - if (!((-1) !in 1L until 3L) != range0.contains((-1))) throw AssertionError() + if (-1 in 1L until 3L != range0.contains(-1)) throw AssertionError() + if (-1 !in 1L until 3L != !range0.contains(-1)) throw AssertionError() + if (!(-1 in 1L until 3L) != !range0.contains(-1)) throw AssertionError() + if (!(-1 !in 1L until 3L) != range0.contains(-1)) throw AssertionError() // no local optimizations if (element2 in 1L until 3L != range0.contains(element2)) throw AssertionError() if (element2 !in 1L until 3L != !range0.contains(element2)) throw AssertionError() @@ -124,10 +124,10 @@ fun testR0xE2() { fun testR0xE3() { // with possible local optimizations - if ((-1).toLong() in 1L until 3L != range0.contains((-1).toLong())) throw AssertionError() - if ((-1).toLong() !in 1L until 3L != !range0.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() in 1L until 3L) != !range0.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() !in 1L until 3L) != range0.contains((-1).toLong())) throw AssertionError() + if (-1L in 1L until 3L != range0.contains(-1L)) throw AssertionError() + if (-1L !in 1L until 3L != !range0.contains(-1L)) throw AssertionError() + if (!(-1L in 1L until 3L) != !range0.contains(-1L)) throw AssertionError() + if (!(-1L !in 1L until 3L) != range0.contains(-1L)) throw AssertionError() // no local optimizations if (element3 in 1L until 3L != range0.contains(element3)) throw AssertionError() if (element3 !in 1L until 3L != !range0.contains(element3)) throw AssertionError() @@ -176,10 +176,10 @@ fun testR0xE6() { fun testR0xE7() { // with possible local optimizations - if (0.toLong() in 1L until 3L != range0.contains(0.toLong())) throw AssertionError() - if (0.toLong() !in 1L until 3L != !range0.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() in 1L until 3L) != !range0.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() !in 1L until 3L) != range0.contains(0.toLong())) throw AssertionError() + if (0L in 1L until 3L != range0.contains(0L)) throw AssertionError() + if (0L !in 1L until 3L != !range0.contains(0L)) throw AssertionError() + if (!(0L in 1L until 3L) != !range0.contains(0L)) throw AssertionError() + if (!(0L !in 1L until 3L) != range0.contains(0L)) throw AssertionError() // no local optimizations if (element7 in 1L until 3L != range0.contains(element7)) throw AssertionError() if (element7 !in 1L until 3L != !range0.contains(element7)) throw AssertionError() @@ -228,10 +228,10 @@ fun testR0xE10() { fun testR0xE11() { // with possible local optimizations - if (1.toLong() in 1L until 3L != range0.contains(1.toLong())) throw AssertionError() - if (1.toLong() !in 1L until 3L != !range0.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() in 1L until 3L) != !range0.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() !in 1L until 3L) != range0.contains(1.toLong())) throw AssertionError() + if (1L in 1L until 3L != range0.contains(1L)) throw AssertionError() + if (1L !in 1L until 3L != !range0.contains(1L)) throw AssertionError() + if (!(1L in 1L until 3L) != !range0.contains(1L)) throw AssertionError() + if (!(1L !in 1L until 3L) != range0.contains(1L)) throw AssertionError() // no local optimizations if (element11 in 1L until 3L != range0.contains(element11)) throw AssertionError() if (element11 !in 1L until 3L != !range0.contains(element11)) throw AssertionError() @@ -280,10 +280,10 @@ fun testR0xE14() { fun testR0xE15() { // with possible local optimizations - if (2.toLong() in 1L until 3L != range0.contains(2.toLong())) throw AssertionError() - if (2.toLong() !in 1L until 3L != !range0.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() in 1L until 3L) != !range0.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() !in 1L until 3L) != range0.contains(2.toLong())) throw AssertionError() + if (2L in 1L until 3L != range0.contains(2L)) throw AssertionError() + if (2L !in 1L until 3L != !range0.contains(2L)) throw AssertionError() + if (!(2L in 1L until 3L) != !range0.contains(2L)) throw AssertionError() + if (!(2L !in 1L until 3L) != range0.contains(2L)) throw AssertionError() // no local optimizations if (element15 in 1L until 3L != range0.contains(element15)) throw AssertionError() if (element15 !in 1L until 3L != !range0.contains(element15)) throw AssertionError() @@ -332,10 +332,10 @@ fun testR0xE18() { fun testR0xE19() { // with possible local optimizations - if (3.toLong() in 1L until 3L != range0.contains(3.toLong())) throw AssertionError() - if (3.toLong() !in 1L until 3L != !range0.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() in 1L until 3L) != !range0.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() !in 1L until 3L) != range0.contains(3.toLong())) throw AssertionError() + if (3L in 1L until 3L != range0.contains(3L)) throw AssertionError() + if (3L !in 1L until 3L != !range0.contains(3L)) throw AssertionError() + if (!(3L in 1L until 3L) != !range0.contains(3L)) throw AssertionError() + if (!(3L !in 1L until 3L) != range0.contains(3L)) throw AssertionError() // no local optimizations if (element19 in 1L until 3L != range0.contains(element19)) throw AssertionError() if (element19 !in 1L until 3L != !range0.contains(element19)) throw AssertionError() @@ -384,10 +384,10 @@ fun testR0xE22() { fun testR0xE23() { // with possible local optimizations - if (4.toLong() in 1L until 3L != range0.contains(4.toLong())) throw AssertionError() - if (4.toLong() !in 1L until 3L != !range0.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() in 1L until 3L) != !range0.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() !in 1L until 3L) != range0.contains(4.toLong())) throw AssertionError() + if (4L in 1L until 3L != range0.contains(4L)) throw AssertionError() + if (4L !in 1L until 3L != !range0.contains(4L)) throw AssertionError() + if (!(4L in 1L until 3L) != !range0.contains(4L)) throw AssertionError() + if (!(4L !in 1L until 3L) != range0.contains(4L)) throw AssertionError() // no local optimizations if (element23 in 1L until 3L != range0.contains(element23)) throw AssertionError() if (element23 !in 1L until 3L != !range0.contains(element23)) throw AssertionError() @@ -423,10 +423,10 @@ fun testR1xE1() { fun testR1xE2() { // with possible local optimizations - if ((-1) in 3L until 1L != range1.contains((-1))) throw AssertionError() - if ((-1) !in 3L until 1L != !range1.contains((-1))) throw AssertionError() - if (!((-1) in 3L until 1L) != !range1.contains((-1))) throw AssertionError() - if (!((-1) !in 3L until 1L) != range1.contains((-1))) throw AssertionError() + if (-1 in 3L until 1L != range1.contains(-1)) throw AssertionError() + if (-1 !in 3L until 1L != !range1.contains(-1)) throw AssertionError() + if (!(-1 in 3L until 1L) != !range1.contains(-1)) throw AssertionError() + if (!(-1 !in 3L until 1L) != range1.contains(-1)) throw AssertionError() // no local optimizations if (element2 in 3L until 1L != range1.contains(element2)) throw AssertionError() if (element2 !in 3L until 1L != !range1.contains(element2)) throw AssertionError() @@ -436,10 +436,10 @@ fun testR1xE2() { fun testR1xE3() { // with possible local optimizations - if ((-1).toLong() in 3L until 1L != range1.contains((-1).toLong())) throw AssertionError() - if ((-1).toLong() !in 3L until 1L != !range1.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() in 3L until 1L) != !range1.contains((-1).toLong())) throw AssertionError() - if (!((-1).toLong() !in 3L until 1L) != range1.contains((-1).toLong())) throw AssertionError() + if (-1L in 3L until 1L != range1.contains(-1L)) throw AssertionError() + if (-1L !in 3L until 1L != !range1.contains(-1L)) throw AssertionError() + if (!(-1L in 3L until 1L) != !range1.contains(-1L)) throw AssertionError() + if (!(-1L !in 3L until 1L) != range1.contains(-1L)) throw AssertionError() // no local optimizations if (element3 in 3L until 1L != range1.contains(element3)) throw AssertionError() if (element3 !in 3L until 1L != !range1.contains(element3)) throw AssertionError() @@ -488,10 +488,10 @@ fun testR1xE6() { fun testR1xE7() { // with possible local optimizations - if (0.toLong() in 3L until 1L != range1.contains(0.toLong())) throw AssertionError() - if (0.toLong() !in 3L until 1L != !range1.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() in 3L until 1L) != !range1.contains(0.toLong())) throw AssertionError() - if (!(0.toLong() !in 3L until 1L) != range1.contains(0.toLong())) throw AssertionError() + if (0L in 3L until 1L != range1.contains(0L)) throw AssertionError() + if (0L !in 3L until 1L != !range1.contains(0L)) throw AssertionError() + if (!(0L in 3L until 1L) != !range1.contains(0L)) throw AssertionError() + if (!(0L !in 3L until 1L) != range1.contains(0L)) throw AssertionError() // no local optimizations if (element7 in 3L until 1L != range1.contains(element7)) throw AssertionError() if (element7 !in 3L until 1L != !range1.contains(element7)) throw AssertionError() @@ -540,10 +540,10 @@ fun testR1xE10() { fun testR1xE11() { // with possible local optimizations - if (1.toLong() in 3L until 1L != range1.contains(1.toLong())) throw AssertionError() - if (1.toLong() !in 3L until 1L != !range1.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() in 3L until 1L) != !range1.contains(1.toLong())) throw AssertionError() - if (!(1.toLong() !in 3L until 1L) != range1.contains(1.toLong())) throw AssertionError() + if (1L in 3L until 1L != range1.contains(1L)) throw AssertionError() + if (1L !in 3L until 1L != !range1.contains(1L)) throw AssertionError() + if (!(1L in 3L until 1L) != !range1.contains(1L)) throw AssertionError() + if (!(1L !in 3L until 1L) != range1.contains(1L)) throw AssertionError() // no local optimizations if (element11 in 3L until 1L != range1.contains(element11)) throw AssertionError() if (element11 !in 3L until 1L != !range1.contains(element11)) throw AssertionError() @@ -592,10 +592,10 @@ fun testR1xE14() { fun testR1xE15() { // with possible local optimizations - if (2.toLong() in 3L until 1L != range1.contains(2.toLong())) throw AssertionError() - if (2.toLong() !in 3L until 1L != !range1.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() in 3L until 1L) != !range1.contains(2.toLong())) throw AssertionError() - if (!(2.toLong() !in 3L until 1L) != range1.contains(2.toLong())) throw AssertionError() + if (2L in 3L until 1L != range1.contains(2L)) throw AssertionError() + if (2L !in 3L until 1L != !range1.contains(2L)) throw AssertionError() + if (!(2L in 3L until 1L) != !range1.contains(2L)) throw AssertionError() + if (!(2L !in 3L until 1L) != range1.contains(2L)) throw AssertionError() // no local optimizations if (element15 in 3L until 1L != range1.contains(element15)) throw AssertionError() if (element15 !in 3L until 1L != !range1.contains(element15)) throw AssertionError() @@ -644,10 +644,10 @@ fun testR1xE18() { fun testR1xE19() { // with possible local optimizations - if (3.toLong() in 3L until 1L != range1.contains(3.toLong())) throw AssertionError() - if (3.toLong() !in 3L until 1L != !range1.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() in 3L until 1L) != !range1.contains(3.toLong())) throw AssertionError() - if (!(3.toLong() !in 3L until 1L) != range1.contains(3.toLong())) throw AssertionError() + if (3L in 3L until 1L != range1.contains(3L)) throw AssertionError() + if (3L !in 3L until 1L != !range1.contains(3L)) throw AssertionError() + if (!(3L in 3L until 1L) != !range1.contains(3L)) throw AssertionError() + if (!(3L !in 3L until 1L) != range1.contains(3L)) throw AssertionError() // no local optimizations if (element19 in 3L until 1L != range1.contains(element19)) throw AssertionError() if (element19 !in 3L until 1L != !range1.contains(element19)) throw AssertionError() @@ -696,10 +696,10 @@ fun testR1xE22() { fun testR1xE23() { // with possible local optimizations - if (4.toLong() in 3L until 1L != range1.contains(4.toLong())) throw AssertionError() - if (4.toLong() !in 3L until 1L != !range1.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() in 3L until 1L) != !range1.contains(4.toLong())) throw AssertionError() - if (!(4.toLong() !in 3L until 1L) != range1.contains(4.toLong())) throw AssertionError() + if (4L in 3L until 1L != range1.contains(4L)) throw AssertionError() + if (4L !in 3L until 1L != !range1.contains(4L)) throw AssertionError() + if (!(4L in 3L until 1L) != !range1.contains(4L)) throw AssertionError() + if (!(4L !in 3L until 1L) != range1.contains(4L)) throw AssertionError() // no local optimizations if (element23 in 3L until 1L != range1.contains(element23)) throw AssertionError() if (element23 !in 3L until 1L != !range1.contains(element23)) throw AssertionError() diff --git a/compiler/testData/codegen/box/ranges/contains/generated/uintDownTo.kt b/compiler/testData/codegen/box/ranges/contains/generated/uintDownTo.kt new file mode 100644 index 00000000000..d1e392618e6 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/contains/generated/uintDownTo.kt @@ -0,0 +1,159 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_STDLIB + + + +val range0 = 1u downTo 3u +val range1 = 3u downTo 1u + +val element0 = 0u +val element1 = 1u +val element2 = 2u +val element3 = 3u +val element4 = 4u + +fun box(): String { + testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if (0u in 1u downTo 3u != range0.contains(0u)) throw AssertionError() + if (0u !in 1u downTo 3u != !range0.contains(0u)) throw AssertionError() + if (!(0u in 1u downTo 3u) != !range0.contains(0u)) throw AssertionError() + if (!(0u !in 1u downTo 3u) != range0.contains(0u)) throw AssertionError() + // no local optimizations + if (element0 in 1u downTo 3u != range0.contains(element0)) throw AssertionError() + if (element0 !in 1u downTo 3u != !range0.contains(element0)) throw AssertionError() + if (!(element0 in 1u downTo 3u) != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in 1u downTo 3u) != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if (1u in 1u downTo 3u != range0.contains(1u)) throw AssertionError() + if (1u !in 1u downTo 3u != !range0.contains(1u)) throw AssertionError() + if (!(1u in 1u downTo 3u) != !range0.contains(1u)) throw AssertionError() + if (!(1u !in 1u downTo 3u) != range0.contains(1u)) throw AssertionError() + // no local optimizations + if (element1 in 1u downTo 3u != range0.contains(element1)) throw AssertionError() + if (element1 !in 1u downTo 3u != !range0.contains(element1)) throw AssertionError() + if (!(element1 in 1u downTo 3u) != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in 1u downTo 3u) != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if (2u in 1u downTo 3u != range0.contains(2u)) throw AssertionError() + if (2u !in 1u downTo 3u != !range0.contains(2u)) throw AssertionError() + if (!(2u in 1u downTo 3u) != !range0.contains(2u)) throw AssertionError() + if (!(2u !in 1u downTo 3u) != range0.contains(2u)) throw AssertionError() + // no local optimizations + if (element2 in 1u downTo 3u != range0.contains(element2)) throw AssertionError() + if (element2 !in 1u downTo 3u != !range0.contains(element2)) throw AssertionError() + if (!(element2 in 1u downTo 3u) != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in 1u downTo 3u) != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if (3u in 1u downTo 3u != range0.contains(3u)) throw AssertionError() + if (3u !in 1u downTo 3u != !range0.contains(3u)) throw AssertionError() + if (!(3u in 1u downTo 3u) != !range0.contains(3u)) throw AssertionError() + if (!(3u !in 1u downTo 3u) != range0.contains(3u)) throw AssertionError() + // no local optimizations + if (element3 in 1u downTo 3u != range0.contains(element3)) throw AssertionError() + if (element3 !in 1u downTo 3u != !range0.contains(element3)) throw AssertionError() + if (!(element3 in 1u downTo 3u) != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in 1u downTo 3u) != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if (4u in 1u downTo 3u != range0.contains(4u)) throw AssertionError() + if (4u !in 1u downTo 3u != !range0.contains(4u)) throw AssertionError() + if (!(4u in 1u downTo 3u) != !range0.contains(4u)) throw AssertionError() + if (!(4u !in 1u downTo 3u) != range0.contains(4u)) throw AssertionError() + // no local optimizations + if (element4 in 1u downTo 3u != range0.contains(element4)) throw AssertionError() + if (element4 !in 1u downTo 3u != !range0.contains(element4)) throw AssertionError() + if (!(element4 in 1u downTo 3u) != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in 1u downTo 3u) != range0.contains(element4)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if (0u in 3u downTo 1u != range1.contains(0u)) throw AssertionError() + if (0u !in 3u downTo 1u != !range1.contains(0u)) throw AssertionError() + if (!(0u in 3u downTo 1u) != !range1.contains(0u)) throw AssertionError() + if (!(0u !in 3u downTo 1u) != range1.contains(0u)) throw AssertionError() + // no local optimizations + if (element0 in 3u downTo 1u != range1.contains(element0)) throw AssertionError() + if (element0 !in 3u downTo 1u != !range1.contains(element0)) throw AssertionError() + if (!(element0 in 3u downTo 1u) != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in 3u downTo 1u) != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if (1u in 3u downTo 1u != range1.contains(1u)) throw AssertionError() + if (1u !in 3u downTo 1u != !range1.contains(1u)) throw AssertionError() + if (!(1u in 3u downTo 1u) != !range1.contains(1u)) throw AssertionError() + if (!(1u !in 3u downTo 1u) != range1.contains(1u)) throw AssertionError() + // no local optimizations + if (element1 in 3u downTo 1u != range1.contains(element1)) throw AssertionError() + if (element1 !in 3u downTo 1u != !range1.contains(element1)) throw AssertionError() + if (!(element1 in 3u downTo 1u) != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in 3u downTo 1u) != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if (2u in 3u downTo 1u != range1.contains(2u)) throw AssertionError() + if (2u !in 3u downTo 1u != !range1.contains(2u)) throw AssertionError() + if (!(2u in 3u downTo 1u) != !range1.contains(2u)) throw AssertionError() + if (!(2u !in 3u downTo 1u) != range1.contains(2u)) throw AssertionError() + // no local optimizations + if (element2 in 3u downTo 1u != range1.contains(element2)) throw AssertionError() + if (element2 !in 3u downTo 1u != !range1.contains(element2)) throw AssertionError() + if (!(element2 in 3u downTo 1u) != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in 3u downTo 1u) != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if (3u in 3u downTo 1u != range1.contains(3u)) throw AssertionError() + if (3u !in 3u downTo 1u != !range1.contains(3u)) throw AssertionError() + if (!(3u in 3u downTo 1u) != !range1.contains(3u)) throw AssertionError() + if (!(3u !in 3u downTo 1u) != range1.contains(3u)) throw AssertionError() + // no local optimizations + if (element3 in 3u downTo 1u != range1.contains(element3)) throw AssertionError() + if (element3 !in 3u downTo 1u != !range1.contains(element3)) throw AssertionError() + if (!(element3 in 3u downTo 1u) != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in 3u downTo 1u) != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if (4u in 3u downTo 1u != range1.contains(4u)) throw AssertionError() + if (4u !in 3u downTo 1u != !range1.contains(4u)) throw AssertionError() + if (!(4u in 3u downTo 1u) != !range1.contains(4u)) throw AssertionError() + if (!(4u !in 3u downTo 1u) != range1.contains(4u)) throw AssertionError() + // no local optimizations + if (element4 in 3u downTo 1u != range1.contains(element4)) throw AssertionError() + if (element4 !in 3u downTo 1u != !range1.contains(element4)) throw AssertionError() + if (!(element4 in 3u downTo 1u) != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in 3u downTo 1u) != range1.contains(element4)) throw AssertionError() +} + + diff --git a/compiler/testData/codegen/box/ranges/contains/generated/uintRangeTo.kt b/compiler/testData/codegen/box/ranges/contains/generated/uintRangeTo.kt new file mode 100644 index 00000000000..e02d014f790 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/contains/generated/uintRangeTo.kt @@ -0,0 +1,159 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_STDLIB + + + +val range0 = 1u..3u +val range1 = 3u..1u + +val element0 = 0u +val element1 = 1u +val element2 = 2u +val element3 = 3u +val element4 = 4u + +fun box(): String { + testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if (0u in 1u..3u != range0.contains(0u)) throw AssertionError() + if (0u !in 1u..3u != !range0.contains(0u)) throw AssertionError() + if (!(0u in 1u..3u) != !range0.contains(0u)) throw AssertionError() + if (!(0u !in 1u..3u) != range0.contains(0u)) throw AssertionError() + // no local optimizations + if (element0 in 1u..3u != range0.contains(element0)) throw AssertionError() + if (element0 !in 1u..3u != !range0.contains(element0)) throw AssertionError() + if (!(element0 in 1u..3u) != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in 1u..3u) != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if (1u in 1u..3u != range0.contains(1u)) throw AssertionError() + if (1u !in 1u..3u != !range0.contains(1u)) throw AssertionError() + if (!(1u in 1u..3u) != !range0.contains(1u)) throw AssertionError() + if (!(1u !in 1u..3u) != range0.contains(1u)) throw AssertionError() + // no local optimizations + if (element1 in 1u..3u != range0.contains(element1)) throw AssertionError() + if (element1 !in 1u..3u != !range0.contains(element1)) throw AssertionError() + if (!(element1 in 1u..3u) != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in 1u..3u) != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if (2u in 1u..3u != range0.contains(2u)) throw AssertionError() + if (2u !in 1u..3u != !range0.contains(2u)) throw AssertionError() + if (!(2u in 1u..3u) != !range0.contains(2u)) throw AssertionError() + if (!(2u !in 1u..3u) != range0.contains(2u)) throw AssertionError() + // no local optimizations + if (element2 in 1u..3u != range0.contains(element2)) throw AssertionError() + if (element2 !in 1u..3u != !range0.contains(element2)) throw AssertionError() + if (!(element2 in 1u..3u) != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in 1u..3u) != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if (3u in 1u..3u != range0.contains(3u)) throw AssertionError() + if (3u !in 1u..3u != !range0.contains(3u)) throw AssertionError() + if (!(3u in 1u..3u) != !range0.contains(3u)) throw AssertionError() + if (!(3u !in 1u..3u) != range0.contains(3u)) throw AssertionError() + // no local optimizations + if (element3 in 1u..3u != range0.contains(element3)) throw AssertionError() + if (element3 !in 1u..3u != !range0.contains(element3)) throw AssertionError() + if (!(element3 in 1u..3u) != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in 1u..3u) != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if (4u in 1u..3u != range0.contains(4u)) throw AssertionError() + if (4u !in 1u..3u != !range0.contains(4u)) throw AssertionError() + if (!(4u in 1u..3u) != !range0.contains(4u)) throw AssertionError() + if (!(4u !in 1u..3u) != range0.contains(4u)) throw AssertionError() + // no local optimizations + if (element4 in 1u..3u != range0.contains(element4)) throw AssertionError() + if (element4 !in 1u..3u != !range0.contains(element4)) throw AssertionError() + if (!(element4 in 1u..3u) != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in 1u..3u) != range0.contains(element4)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if (0u in 3u..1u != range1.contains(0u)) throw AssertionError() + if (0u !in 3u..1u != !range1.contains(0u)) throw AssertionError() + if (!(0u in 3u..1u) != !range1.contains(0u)) throw AssertionError() + if (!(0u !in 3u..1u) != range1.contains(0u)) throw AssertionError() + // no local optimizations + if (element0 in 3u..1u != range1.contains(element0)) throw AssertionError() + if (element0 !in 3u..1u != !range1.contains(element0)) throw AssertionError() + if (!(element0 in 3u..1u) != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in 3u..1u) != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if (1u in 3u..1u != range1.contains(1u)) throw AssertionError() + if (1u !in 3u..1u != !range1.contains(1u)) throw AssertionError() + if (!(1u in 3u..1u) != !range1.contains(1u)) throw AssertionError() + if (!(1u !in 3u..1u) != range1.contains(1u)) throw AssertionError() + // no local optimizations + if (element1 in 3u..1u != range1.contains(element1)) throw AssertionError() + if (element1 !in 3u..1u != !range1.contains(element1)) throw AssertionError() + if (!(element1 in 3u..1u) != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in 3u..1u) != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if (2u in 3u..1u != range1.contains(2u)) throw AssertionError() + if (2u !in 3u..1u != !range1.contains(2u)) throw AssertionError() + if (!(2u in 3u..1u) != !range1.contains(2u)) throw AssertionError() + if (!(2u !in 3u..1u) != range1.contains(2u)) throw AssertionError() + // no local optimizations + if (element2 in 3u..1u != range1.contains(element2)) throw AssertionError() + if (element2 !in 3u..1u != !range1.contains(element2)) throw AssertionError() + if (!(element2 in 3u..1u) != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in 3u..1u) != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if (3u in 3u..1u != range1.contains(3u)) throw AssertionError() + if (3u !in 3u..1u != !range1.contains(3u)) throw AssertionError() + if (!(3u in 3u..1u) != !range1.contains(3u)) throw AssertionError() + if (!(3u !in 3u..1u) != range1.contains(3u)) throw AssertionError() + // no local optimizations + if (element3 in 3u..1u != range1.contains(element3)) throw AssertionError() + if (element3 !in 3u..1u != !range1.contains(element3)) throw AssertionError() + if (!(element3 in 3u..1u) != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in 3u..1u) != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if (4u in 3u..1u != range1.contains(4u)) throw AssertionError() + if (4u !in 3u..1u != !range1.contains(4u)) throw AssertionError() + if (!(4u in 3u..1u) != !range1.contains(4u)) throw AssertionError() + if (!(4u !in 3u..1u) != range1.contains(4u)) throw AssertionError() + // no local optimizations + if (element4 in 3u..1u != range1.contains(element4)) throw AssertionError() + if (element4 !in 3u..1u != !range1.contains(element4)) throw AssertionError() + if (!(element4 in 3u..1u) != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in 3u..1u) != range1.contains(element4)) throw AssertionError() +} + + diff --git a/compiler/testData/codegen/box/ranges/contains/generated/uintRangeUntil.kt b/compiler/testData/codegen/box/ranges/contains/generated/uintRangeUntil.kt new file mode 100644 index 00000000000..574473caa3d --- /dev/null +++ b/compiler/testData/codegen/box/ranges/contains/generated/uintRangeUntil.kt @@ -0,0 +1,162 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_STDLIB +// DONT_TARGET_EXACT_BACKEND: JVM +// !LANGUAGE: +RangeUntilOperator +@file:OptIn(ExperimentalStdlibApi::class) + + + +val range0 = 1u..<3u +val range1 = 3u..<1u + +val element0 = 0u +val element1 = 1u +val element2 = 2u +val element3 = 3u +val element4 = 4u + +fun box(): String { + testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if (0u in 1u..<3u != range0.contains(0u)) throw AssertionError() + if (0u !in 1u..<3u != !range0.contains(0u)) throw AssertionError() + if (!(0u in 1u..<3u) != !range0.contains(0u)) throw AssertionError() + if (!(0u !in 1u..<3u) != range0.contains(0u)) throw AssertionError() + // no local optimizations + if (element0 in 1u..<3u != range0.contains(element0)) throw AssertionError() + if (element0 !in 1u..<3u != !range0.contains(element0)) throw AssertionError() + if (!(element0 in 1u..<3u) != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in 1u..<3u) != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if (1u in 1u..<3u != range0.contains(1u)) throw AssertionError() + if (1u !in 1u..<3u != !range0.contains(1u)) throw AssertionError() + if (!(1u in 1u..<3u) != !range0.contains(1u)) throw AssertionError() + if (!(1u !in 1u..<3u) != range0.contains(1u)) throw AssertionError() + // no local optimizations + if (element1 in 1u..<3u != range0.contains(element1)) throw AssertionError() + if (element1 !in 1u..<3u != !range0.contains(element1)) throw AssertionError() + if (!(element1 in 1u..<3u) != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in 1u..<3u) != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if (2u in 1u..<3u != range0.contains(2u)) throw AssertionError() + if (2u !in 1u..<3u != !range0.contains(2u)) throw AssertionError() + if (!(2u in 1u..<3u) != !range0.contains(2u)) throw AssertionError() + if (!(2u !in 1u..<3u) != range0.contains(2u)) throw AssertionError() + // no local optimizations + if (element2 in 1u..<3u != range0.contains(element2)) throw AssertionError() + if (element2 !in 1u..<3u != !range0.contains(element2)) throw AssertionError() + if (!(element2 in 1u..<3u) != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in 1u..<3u) != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if (3u in 1u..<3u != range0.contains(3u)) throw AssertionError() + if (3u !in 1u..<3u != !range0.contains(3u)) throw AssertionError() + if (!(3u in 1u..<3u) != !range0.contains(3u)) throw AssertionError() + if (!(3u !in 1u..<3u) != range0.contains(3u)) throw AssertionError() + // no local optimizations + if (element3 in 1u..<3u != range0.contains(element3)) throw AssertionError() + if (element3 !in 1u..<3u != !range0.contains(element3)) throw AssertionError() + if (!(element3 in 1u..<3u) != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in 1u..<3u) != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if (4u in 1u..<3u != range0.contains(4u)) throw AssertionError() + if (4u !in 1u..<3u != !range0.contains(4u)) throw AssertionError() + if (!(4u in 1u..<3u) != !range0.contains(4u)) throw AssertionError() + if (!(4u !in 1u..<3u) != range0.contains(4u)) throw AssertionError() + // no local optimizations + if (element4 in 1u..<3u != range0.contains(element4)) throw AssertionError() + if (element4 !in 1u..<3u != !range0.contains(element4)) throw AssertionError() + if (!(element4 in 1u..<3u) != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in 1u..<3u) != range0.contains(element4)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if (0u in 3u..<1u != range1.contains(0u)) throw AssertionError() + if (0u !in 3u..<1u != !range1.contains(0u)) throw AssertionError() + if (!(0u in 3u..<1u) != !range1.contains(0u)) throw AssertionError() + if (!(0u !in 3u..<1u) != range1.contains(0u)) throw AssertionError() + // no local optimizations + if (element0 in 3u..<1u != range1.contains(element0)) throw AssertionError() + if (element0 !in 3u..<1u != !range1.contains(element0)) throw AssertionError() + if (!(element0 in 3u..<1u) != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in 3u..<1u) != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if (1u in 3u..<1u != range1.contains(1u)) throw AssertionError() + if (1u !in 3u..<1u != !range1.contains(1u)) throw AssertionError() + if (!(1u in 3u..<1u) != !range1.contains(1u)) throw AssertionError() + if (!(1u !in 3u..<1u) != range1.contains(1u)) throw AssertionError() + // no local optimizations + if (element1 in 3u..<1u != range1.contains(element1)) throw AssertionError() + if (element1 !in 3u..<1u != !range1.contains(element1)) throw AssertionError() + if (!(element1 in 3u..<1u) != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in 3u..<1u) != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if (2u in 3u..<1u != range1.contains(2u)) throw AssertionError() + if (2u !in 3u..<1u != !range1.contains(2u)) throw AssertionError() + if (!(2u in 3u..<1u) != !range1.contains(2u)) throw AssertionError() + if (!(2u !in 3u..<1u) != range1.contains(2u)) throw AssertionError() + // no local optimizations + if (element2 in 3u..<1u != range1.contains(element2)) throw AssertionError() + if (element2 !in 3u..<1u != !range1.contains(element2)) throw AssertionError() + if (!(element2 in 3u..<1u) != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in 3u..<1u) != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if (3u in 3u..<1u != range1.contains(3u)) throw AssertionError() + if (3u !in 3u..<1u != !range1.contains(3u)) throw AssertionError() + if (!(3u in 3u..<1u) != !range1.contains(3u)) throw AssertionError() + if (!(3u !in 3u..<1u) != range1.contains(3u)) throw AssertionError() + // no local optimizations + if (element3 in 3u..<1u != range1.contains(element3)) throw AssertionError() + if (element3 !in 3u..<1u != !range1.contains(element3)) throw AssertionError() + if (!(element3 in 3u..<1u) != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in 3u..<1u) != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if (4u in 3u..<1u != range1.contains(4u)) throw AssertionError() + if (4u !in 3u..<1u != !range1.contains(4u)) throw AssertionError() + if (!(4u in 3u..<1u) != !range1.contains(4u)) throw AssertionError() + if (!(4u !in 3u..<1u) != range1.contains(4u)) throw AssertionError() + // no local optimizations + if (element4 in 3u..<1u != range1.contains(element4)) throw AssertionError() + if (element4 !in 3u..<1u != !range1.contains(element4)) throw AssertionError() + if (!(element4 in 3u..<1u) != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in 3u..<1u) != range1.contains(element4)) throw AssertionError() +} + + diff --git a/compiler/testData/codegen/box/ranges/contains/generated/uintUntil.kt b/compiler/testData/codegen/box/ranges/contains/generated/uintUntil.kt new file mode 100644 index 00000000000..ccdbee52e05 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/contains/generated/uintUntil.kt @@ -0,0 +1,159 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_STDLIB + + + +val range0 = 1u until 3u +val range1 = 3u until 1u + +val element0 = 0u +val element1 = 1u +val element2 = 2u +val element3 = 3u +val element4 = 4u + +fun box(): String { + testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if (0u in 1u until 3u != range0.contains(0u)) throw AssertionError() + if (0u !in 1u until 3u != !range0.contains(0u)) throw AssertionError() + if (!(0u in 1u until 3u) != !range0.contains(0u)) throw AssertionError() + if (!(0u !in 1u until 3u) != range0.contains(0u)) throw AssertionError() + // no local optimizations + if (element0 in 1u until 3u != range0.contains(element0)) throw AssertionError() + if (element0 !in 1u until 3u != !range0.contains(element0)) throw AssertionError() + if (!(element0 in 1u until 3u) != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in 1u until 3u) != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if (1u in 1u until 3u != range0.contains(1u)) throw AssertionError() + if (1u !in 1u until 3u != !range0.contains(1u)) throw AssertionError() + if (!(1u in 1u until 3u) != !range0.contains(1u)) throw AssertionError() + if (!(1u !in 1u until 3u) != range0.contains(1u)) throw AssertionError() + // no local optimizations + if (element1 in 1u until 3u != range0.contains(element1)) throw AssertionError() + if (element1 !in 1u until 3u != !range0.contains(element1)) throw AssertionError() + if (!(element1 in 1u until 3u) != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in 1u until 3u) != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if (2u in 1u until 3u != range0.contains(2u)) throw AssertionError() + if (2u !in 1u until 3u != !range0.contains(2u)) throw AssertionError() + if (!(2u in 1u until 3u) != !range0.contains(2u)) throw AssertionError() + if (!(2u !in 1u until 3u) != range0.contains(2u)) throw AssertionError() + // no local optimizations + if (element2 in 1u until 3u != range0.contains(element2)) throw AssertionError() + if (element2 !in 1u until 3u != !range0.contains(element2)) throw AssertionError() + if (!(element2 in 1u until 3u) != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in 1u until 3u) != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if (3u in 1u until 3u != range0.contains(3u)) throw AssertionError() + if (3u !in 1u until 3u != !range0.contains(3u)) throw AssertionError() + if (!(3u in 1u until 3u) != !range0.contains(3u)) throw AssertionError() + if (!(3u !in 1u until 3u) != range0.contains(3u)) throw AssertionError() + // no local optimizations + if (element3 in 1u until 3u != range0.contains(element3)) throw AssertionError() + if (element3 !in 1u until 3u != !range0.contains(element3)) throw AssertionError() + if (!(element3 in 1u until 3u) != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in 1u until 3u) != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if (4u in 1u until 3u != range0.contains(4u)) throw AssertionError() + if (4u !in 1u until 3u != !range0.contains(4u)) throw AssertionError() + if (!(4u in 1u until 3u) != !range0.contains(4u)) throw AssertionError() + if (!(4u !in 1u until 3u) != range0.contains(4u)) throw AssertionError() + // no local optimizations + if (element4 in 1u until 3u != range0.contains(element4)) throw AssertionError() + if (element4 !in 1u until 3u != !range0.contains(element4)) throw AssertionError() + if (!(element4 in 1u until 3u) != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in 1u until 3u) != range0.contains(element4)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if (0u in 3u until 1u != range1.contains(0u)) throw AssertionError() + if (0u !in 3u until 1u != !range1.contains(0u)) throw AssertionError() + if (!(0u in 3u until 1u) != !range1.contains(0u)) throw AssertionError() + if (!(0u !in 3u until 1u) != range1.contains(0u)) throw AssertionError() + // no local optimizations + if (element0 in 3u until 1u != range1.contains(element0)) throw AssertionError() + if (element0 !in 3u until 1u != !range1.contains(element0)) throw AssertionError() + if (!(element0 in 3u until 1u) != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in 3u until 1u) != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if (1u in 3u until 1u != range1.contains(1u)) throw AssertionError() + if (1u !in 3u until 1u != !range1.contains(1u)) throw AssertionError() + if (!(1u in 3u until 1u) != !range1.contains(1u)) throw AssertionError() + if (!(1u !in 3u until 1u) != range1.contains(1u)) throw AssertionError() + // no local optimizations + if (element1 in 3u until 1u != range1.contains(element1)) throw AssertionError() + if (element1 !in 3u until 1u != !range1.contains(element1)) throw AssertionError() + if (!(element1 in 3u until 1u) != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in 3u until 1u) != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if (2u in 3u until 1u != range1.contains(2u)) throw AssertionError() + if (2u !in 3u until 1u != !range1.contains(2u)) throw AssertionError() + if (!(2u in 3u until 1u) != !range1.contains(2u)) throw AssertionError() + if (!(2u !in 3u until 1u) != range1.contains(2u)) throw AssertionError() + // no local optimizations + if (element2 in 3u until 1u != range1.contains(element2)) throw AssertionError() + if (element2 !in 3u until 1u != !range1.contains(element2)) throw AssertionError() + if (!(element2 in 3u until 1u) != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in 3u until 1u) != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if (3u in 3u until 1u != range1.contains(3u)) throw AssertionError() + if (3u !in 3u until 1u != !range1.contains(3u)) throw AssertionError() + if (!(3u in 3u until 1u) != !range1.contains(3u)) throw AssertionError() + if (!(3u !in 3u until 1u) != range1.contains(3u)) throw AssertionError() + // no local optimizations + if (element3 in 3u until 1u != range1.contains(element3)) throw AssertionError() + if (element3 !in 3u until 1u != !range1.contains(element3)) throw AssertionError() + if (!(element3 in 3u until 1u) != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in 3u until 1u) != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if (4u in 3u until 1u != range1.contains(4u)) throw AssertionError() + if (4u !in 3u until 1u != !range1.contains(4u)) throw AssertionError() + if (!(4u in 3u until 1u) != !range1.contains(4u)) throw AssertionError() + if (!(4u !in 3u until 1u) != range1.contains(4u)) throw AssertionError() + // no local optimizations + if (element4 in 3u until 1u != range1.contains(element4)) throw AssertionError() + if (element4 !in 3u until 1u != !range1.contains(element4)) throw AssertionError() + if (!(element4 in 3u until 1u) != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in 3u until 1u) != range1.contains(element4)) throw AssertionError() +} + + diff --git a/compiler/testData/codegen/box/ranges/contains/generated/ulongDownTo.kt b/compiler/testData/codegen/box/ranges/contains/generated/ulongDownTo.kt new file mode 100644 index 00000000000..2db424cdddd --- /dev/null +++ b/compiler/testData/codegen/box/ranges/contains/generated/ulongDownTo.kt @@ -0,0 +1,159 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_STDLIB + + + +val range0 = 1uL downTo 3uL +val range1 = 3uL downTo 1uL + +val element0 = 0uL +val element1 = 1uL +val element2 = 2uL +val element3 = 3uL +val element4 = 4uL + +fun box(): String { + testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if (0uL in 1uL downTo 3uL != range0.contains(0uL)) throw AssertionError() + if (0uL !in 1uL downTo 3uL != !range0.contains(0uL)) throw AssertionError() + if (!(0uL in 1uL downTo 3uL) != !range0.contains(0uL)) throw AssertionError() + if (!(0uL !in 1uL downTo 3uL) != range0.contains(0uL)) throw AssertionError() + // no local optimizations + if (element0 in 1uL downTo 3uL != range0.contains(element0)) throw AssertionError() + if (element0 !in 1uL downTo 3uL != !range0.contains(element0)) throw AssertionError() + if (!(element0 in 1uL downTo 3uL) != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in 1uL downTo 3uL) != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if (1uL in 1uL downTo 3uL != range0.contains(1uL)) throw AssertionError() + if (1uL !in 1uL downTo 3uL != !range0.contains(1uL)) throw AssertionError() + if (!(1uL in 1uL downTo 3uL) != !range0.contains(1uL)) throw AssertionError() + if (!(1uL !in 1uL downTo 3uL) != range0.contains(1uL)) throw AssertionError() + // no local optimizations + if (element1 in 1uL downTo 3uL != range0.contains(element1)) throw AssertionError() + if (element1 !in 1uL downTo 3uL != !range0.contains(element1)) throw AssertionError() + if (!(element1 in 1uL downTo 3uL) != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in 1uL downTo 3uL) != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if (2uL in 1uL downTo 3uL != range0.contains(2uL)) throw AssertionError() + if (2uL !in 1uL downTo 3uL != !range0.contains(2uL)) throw AssertionError() + if (!(2uL in 1uL downTo 3uL) != !range0.contains(2uL)) throw AssertionError() + if (!(2uL !in 1uL downTo 3uL) != range0.contains(2uL)) throw AssertionError() + // no local optimizations + if (element2 in 1uL downTo 3uL != range0.contains(element2)) throw AssertionError() + if (element2 !in 1uL downTo 3uL != !range0.contains(element2)) throw AssertionError() + if (!(element2 in 1uL downTo 3uL) != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in 1uL downTo 3uL) != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if (3uL in 1uL downTo 3uL != range0.contains(3uL)) throw AssertionError() + if (3uL !in 1uL downTo 3uL != !range0.contains(3uL)) throw AssertionError() + if (!(3uL in 1uL downTo 3uL) != !range0.contains(3uL)) throw AssertionError() + if (!(3uL !in 1uL downTo 3uL) != range0.contains(3uL)) throw AssertionError() + // no local optimizations + if (element3 in 1uL downTo 3uL != range0.contains(element3)) throw AssertionError() + if (element3 !in 1uL downTo 3uL != !range0.contains(element3)) throw AssertionError() + if (!(element3 in 1uL downTo 3uL) != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in 1uL downTo 3uL) != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if (4uL in 1uL downTo 3uL != range0.contains(4uL)) throw AssertionError() + if (4uL !in 1uL downTo 3uL != !range0.contains(4uL)) throw AssertionError() + if (!(4uL in 1uL downTo 3uL) != !range0.contains(4uL)) throw AssertionError() + if (!(4uL !in 1uL downTo 3uL) != range0.contains(4uL)) throw AssertionError() + // no local optimizations + if (element4 in 1uL downTo 3uL != range0.contains(element4)) throw AssertionError() + if (element4 !in 1uL downTo 3uL != !range0.contains(element4)) throw AssertionError() + if (!(element4 in 1uL downTo 3uL) != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in 1uL downTo 3uL) != range0.contains(element4)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if (0uL in 3uL downTo 1uL != range1.contains(0uL)) throw AssertionError() + if (0uL !in 3uL downTo 1uL != !range1.contains(0uL)) throw AssertionError() + if (!(0uL in 3uL downTo 1uL) != !range1.contains(0uL)) throw AssertionError() + if (!(0uL !in 3uL downTo 1uL) != range1.contains(0uL)) throw AssertionError() + // no local optimizations + if (element0 in 3uL downTo 1uL != range1.contains(element0)) throw AssertionError() + if (element0 !in 3uL downTo 1uL != !range1.contains(element0)) throw AssertionError() + if (!(element0 in 3uL downTo 1uL) != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in 3uL downTo 1uL) != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if (1uL in 3uL downTo 1uL != range1.contains(1uL)) throw AssertionError() + if (1uL !in 3uL downTo 1uL != !range1.contains(1uL)) throw AssertionError() + if (!(1uL in 3uL downTo 1uL) != !range1.contains(1uL)) throw AssertionError() + if (!(1uL !in 3uL downTo 1uL) != range1.contains(1uL)) throw AssertionError() + // no local optimizations + if (element1 in 3uL downTo 1uL != range1.contains(element1)) throw AssertionError() + if (element1 !in 3uL downTo 1uL != !range1.contains(element1)) throw AssertionError() + if (!(element1 in 3uL downTo 1uL) != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in 3uL downTo 1uL) != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if (2uL in 3uL downTo 1uL != range1.contains(2uL)) throw AssertionError() + if (2uL !in 3uL downTo 1uL != !range1.contains(2uL)) throw AssertionError() + if (!(2uL in 3uL downTo 1uL) != !range1.contains(2uL)) throw AssertionError() + if (!(2uL !in 3uL downTo 1uL) != range1.contains(2uL)) throw AssertionError() + // no local optimizations + if (element2 in 3uL downTo 1uL != range1.contains(element2)) throw AssertionError() + if (element2 !in 3uL downTo 1uL != !range1.contains(element2)) throw AssertionError() + if (!(element2 in 3uL downTo 1uL) != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in 3uL downTo 1uL) != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if (3uL in 3uL downTo 1uL != range1.contains(3uL)) throw AssertionError() + if (3uL !in 3uL downTo 1uL != !range1.contains(3uL)) throw AssertionError() + if (!(3uL in 3uL downTo 1uL) != !range1.contains(3uL)) throw AssertionError() + if (!(3uL !in 3uL downTo 1uL) != range1.contains(3uL)) throw AssertionError() + // no local optimizations + if (element3 in 3uL downTo 1uL != range1.contains(element3)) throw AssertionError() + if (element3 !in 3uL downTo 1uL != !range1.contains(element3)) throw AssertionError() + if (!(element3 in 3uL downTo 1uL) != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in 3uL downTo 1uL) != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if (4uL in 3uL downTo 1uL != range1.contains(4uL)) throw AssertionError() + if (4uL !in 3uL downTo 1uL != !range1.contains(4uL)) throw AssertionError() + if (!(4uL in 3uL downTo 1uL) != !range1.contains(4uL)) throw AssertionError() + if (!(4uL !in 3uL downTo 1uL) != range1.contains(4uL)) throw AssertionError() + // no local optimizations + if (element4 in 3uL downTo 1uL != range1.contains(element4)) throw AssertionError() + if (element4 !in 3uL downTo 1uL != !range1.contains(element4)) throw AssertionError() + if (!(element4 in 3uL downTo 1uL) != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in 3uL downTo 1uL) != range1.contains(element4)) throw AssertionError() +} + + diff --git a/compiler/testData/codegen/box/ranges/contains/generated/ulongRangeTo.kt b/compiler/testData/codegen/box/ranges/contains/generated/ulongRangeTo.kt new file mode 100644 index 00000000000..eb046a6946d --- /dev/null +++ b/compiler/testData/codegen/box/ranges/contains/generated/ulongRangeTo.kt @@ -0,0 +1,159 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_STDLIB + + + +val range0 = 1uL..3uL +val range1 = 3uL..1uL + +val element0 = 0uL +val element1 = 1uL +val element2 = 2uL +val element3 = 3uL +val element4 = 4uL + +fun box(): String { + testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if (0uL in 1uL..3uL != range0.contains(0uL)) throw AssertionError() + if (0uL !in 1uL..3uL != !range0.contains(0uL)) throw AssertionError() + if (!(0uL in 1uL..3uL) != !range0.contains(0uL)) throw AssertionError() + if (!(0uL !in 1uL..3uL) != range0.contains(0uL)) throw AssertionError() + // no local optimizations + if (element0 in 1uL..3uL != range0.contains(element0)) throw AssertionError() + if (element0 !in 1uL..3uL != !range0.contains(element0)) throw AssertionError() + if (!(element0 in 1uL..3uL) != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in 1uL..3uL) != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if (1uL in 1uL..3uL != range0.contains(1uL)) throw AssertionError() + if (1uL !in 1uL..3uL != !range0.contains(1uL)) throw AssertionError() + if (!(1uL in 1uL..3uL) != !range0.contains(1uL)) throw AssertionError() + if (!(1uL !in 1uL..3uL) != range0.contains(1uL)) throw AssertionError() + // no local optimizations + if (element1 in 1uL..3uL != range0.contains(element1)) throw AssertionError() + if (element1 !in 1uL..3uL != !range0.contains(element1)) throw AssertionError() + if (!(element1 in 1uL..3uL) != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in 1uL..3uL) != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if (2uL in 1uL..3uL != range0.contains(2uL)) throw AssertionError() + if (2uL !in 1uL..3uL != !range0.contains(2uL)) throw AssertionError() + if (!(2uL in 1uL..3uL) != !range0.contains(2uL)) throw AssertionError() + if (!(2uL !in 1uL..3uL) != range0.contains(2uL)) throw AssertionError() + // no local optimizations + if (element2 in 1uL..3uL != range0.contains(element2)) throw AssertionError() + if (element2 !in 1uL..3uL != !range0.contains(element2)) throw AssertionError() + if (!(element2 in 1uL..3uL) != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in 1uL..3uL) != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if (3uL in 1uL..3uL != range0.contains(3uL)) throw AssertionError() + if (3uL !in 1uL..3uL != !range0.contains(3uL)) throw AssertionError() + if (!(3uL in 1uL..3uL) != !range0.contains(3uL)) throw AssertionError() + if (!(3uL !in 1uL..3uL) != range0.contains(3uL)) throw AssertionError() + // no local optimizations + if (element3 in 1uL..3uL != range0.contains(element3)) throw AssertionError() + if (element3 !in 1uL..3uL != !range0.contains(element3)) throw AssertionError() + if (!(element3 in 1uL..3uL) != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in 1uL..3uL) != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if (4uL in 1uL..3uL != range0.contains(4uL)) throw AssertionError() + if (4uL !in 1uL..3uL != !range0.contains(4uL)) throw AssertionError() + if (!(4uL in 1uL..3uL) != !range0.contains(4uL)) throw AssertionError() + if (!(4uL !in 1uL..3uL) != range0.contains(4uL)) throw AssertionError() + // no local optimizations + if (element4 in 1uL..3uL != range0.contains(element4)) throw AssertionError() + if (element4 !in 1uL..3uL != !range0.contains(element4)) throw AssertionError() + if (!(element4 in 1uL..3uL) != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in 1uL..3uL) != range0.contains(element4)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if (0uL in 3uL..1uL != range1.contains(0uL)) throw AssertionError() + if (0uL !in 3uL..1uL != !range1.contains(0uL)) throw AssertionError() + if (!(0uL in 3uL..1uL) != !range1.contains(0uL)) throw AssertionError() + if (!(0uL !in 3uL..1uL) != range1.contains(0uL)) throw AssertionError() + // no local optimizations + if (element0 in 3uL..1uL != range1.contains(element0)) throw AssertionError() + if (element0 !in 3uL..1uL != !range1.contains(element0)) throw AssertionError() + if (!(element0 in 3uL..1uL) != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in 3uL..1uL) != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if (1uL in 3uL..1uL != range1.contains(1uL)) throw AssertionError() + if (1uL !in 3uL..1uL != !range1.contains(1uL)) throw AssertionError() + if (!(1uL in 3uL..1uL) != !range1.contains(1uL)) throw AssertionError() + if (!(1uL !in 3uL..1uL) != range1.contains(1uL)) throw AssertionError() + // no local optimizations + if (element1 in 3uL..1uL != range1.contains(element1)) throw AssertionError() + if (element1 !in 3uL..1uL != !range1.contains(element1)) throw AssertionError() + if (!(element1 in 3uL..1uL) != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in 3uL..1uL) != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if (2uL in 3uL..1uL != range1.contains(2uL)) throw AssertionError() + if (2uL !in 3uL..1uL != !range1.contains(2uL)) throw AssertionError() + if (!(2uL in 3uL..1uL) != !range1.contains(2uL)) throw AssertionError() + if (!(2uL !in 3uL..1uL) != range1.contains(2uL)) throw AssertionError() + // no local optimizations + if (element2 in 3uL..1uL != range1.contains(element2)) throw AssertionError() + if (element2 !in 3uL..1uL != !range1.contains(element2)) throw AssertionError() + if (!(element2 in 3uL..1uL) != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in 3uL..1uL) != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if (3uL in 3uL..1uL != range1.contains(3uL)) throw AssertionError() + if (3uL !in 3uL..1uL != !range1.contains(3uL)) throw AssertionError() + if (!(3uL in 3uL..1uL) != !range1.contains(3uL)) throw AssertionError() + if (!(3uL !in 3uL..1uL) != range1.contains(3uL)) throw AssertionError() + // no local optimizations + if (element3 in 3uL..1uL != range1.contains(element3)) throw AssertionError() + if (element3 !in 3uL..1uL != !range1.contains(element3)) throw AssertionError() + if (!(element3 in 3uL..1uL) != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in 3uL..1uL) != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if (4uL in 3uL..1uL != range1.contains(4uL)) throw AssertionError() + if (4uL !in 3uL..1uL != !range1.contains(4uL)) throw AssertionError() + if (!(4uL in 3uL..1uL) != !range1.contains(4uL)) throw AssertionError() + if (!(4uL !in 3uL..1uL) != range1.contains(4uL)) throw AssertionError() + // no local optimizations + if (element4 in 3uL..1uL != range1.contains(element4)) throw AssertionError() + if (element4 !in 3uL..1uL != !range1.contains(element4)) throw AssertionError() + if (!(element4 in 3uL..1uL) != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in 3uL..1uL) != range1.contains(element4)) throw AssertionError() +} + + diff --git a/compiler/testData/codegen/box/ranges/contains/generated/ulongRangeUntil.kt b/compiler/testData/codegen/box/ranges/contains/generated/ulongRangeUntil.kt new file mode 100644 index 00000000000..2c42dd83377 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/contains/generated/ulongRangeUntil.kt @@ -0,0 +1,162 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_STDLIB +// DONT_TARGET_EXACT_BACKEND: JVM +// !LANGUAGE: +RangeUntilOperator +@file:OptIn(ExperimentalStdlibApi::class) + + + +val range0 = 1uL..<3uL +val range1 = 3uL..<1uL + +val element0 = 0uL +val element1 = 1uL +val element2 = 2uL +val element3 = 3uL +val element4 = 4uL + +fun box(): String { + testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if (0uL in 1uL..<3uL != range0.contains(0uL)) throw AssertionError() + if (0uL !in 1uL..<3uL != !range0.contains(0uL)) throw AssertionError() + if (!(0uL in 1uL..<3uL) != !range0.contains(0uL)) throw AssertionError() + if (!(0uL !in 1uL..<3uL) != range0.contains(0uL)) throw AssertionError() + // no local optimizations + if (element0 in 1uL..<3uL != range0.contains(element0)) throw AssertionError() + if (element0 !in 1uL..<3uL != !range0.contains(element0)) throw AssertionError() + if (!(element0 in 1uL..<3uL) != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in 1uL..<3uL) != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if (1uL in 1uL..<3uL != range0.contains(1uL)) throw AssertionError() + if (1uL !in 1uL..<3uL != !range0.contains(1uL)) throw AssertionError() + if (!(1uL in 1uL..<3uL) != !range0.contains(1uL)) throw AssertionError() + if (!(1uL !in 1uL..<3uL) != range0.contains(1uL)) throw AssertionError() + // no local optimizations + if (element1 in 1uL..<3uL != range0.contains(element1)) throw AssertionError() + if (element1 !in 1uL..<3uL != !range0.contains(element1)) throw AssertionError() + if (!(element1 in 1uL..<3uL) != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in 1uL..<3uL) != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if (2uL in 1uL..<3uL != range0.contains(2uL)) throw AssertionError() + if (2uL !in 1uL..<3uL != !range0.contains(2uL)) throw AssertionError() + if (!(2uL in 1uL..<3uL) != !range0.contains(2uL)) throw AssertionError() + if (!(2uL !in 1uL..<3uL) != range0.contains(2uL)) throw AssertionError() + // no local optimizations + if (element2 in 1uL..<3uL != range0.contains(element2)) throw AssertionError() + if (element2 !in 1uL..<3uL != !range0.contains(element2)) throw AssertionError() + if (!(element2 in 1uL..<3uL) != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in 1uL..<3uL) != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if (3uL in 1uL..<3uL != range0.contains(3uL)) throw AssertionError() + if (3uL !in 1uL..<3uL != !range0.contains(3uL)) throw AssertionError() + if (!(3uL in 1uL..<3uL) != !range0.contains(3uL)) throw AssertionError() + if (!(3uL !in 1uL..<3uL) != range0.contains(3uL)) throw AssertionError() + // no local optimizations + if (element3 in 1uL..<3uL != range0.contains(element3)) throw AssertionError() + if (element3 !in 1uL..<3uL != !range0.contains(element3)) throw AssertionError() + if (!(element3 in 1uL..<3uL) != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in 1uL..<3uL) != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if (4uL in 1uL..<3uL != range0.contains(4uL)) throw AssertionError() + if (4uL !in 1uL..<3uL != !range0.contains(4uL)) throw AssertionError() + if (!(4uL in 1uL..<3uL) != !range0.contains(4uL)) throw AssertionError() + if (!(4uL !in 1uL..<3uL) != range0.contains(4uL)) throw AssertionError() + // no local optimizations + if (element4 in 1uL..<3uL != range0.contains(element4)) throw AssertionError() + if (element4 !in 1uL..<3uL != !range0.contains(element4)) throw AssertionError() + if (!(element4 in 1uL..<3uL) != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in 1uL..<3uL) != range0.contains(element4)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if (0uL in 3uL..<1uL != range1.contains(0uL)) throw AssertionError() + if (0uL !in 3uL..<1uL != !range1.contains(0uL)) throw AssertionError() + if (!(0uL in 3uL..<1uL) != !range1.contains(0uL)) throw AssertionError() + if (!(0uL !in 3uL..<1uL) != range1.contains(0uL)) throw AssertionError() + // no local optimizations + if (element0 in 3uL..<1uL != range1.contains(element0)) throw AssertionError() + if (element0 !in 3uL..<1uL != !range1.contains(element0)) throw AssertionError() + if (!(element0 in 3uL..<1uL) != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in 3uL..<1uL) != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if (1uL in 3uL..<1uL != range1.contains(1uL)) throw AssertionError() + if (1uL !in 3uL..<1uL != !range1.contains(1uL)) throw AssertionError() + if (!(1uL in 3uL..<1uL) != !range1.contains(1uL)) throw AssertionError() + if (!(1uL !in 3uL..<1uL) != range1.contains(1uL)) throw AssertionError() + // no local optimizations + if (element1 in 3uL..<1uL != range1.contains(element1)) throw AssertionError() + if (element1 !in 3uL..<1uL != !range1.contains(element1)) throw AssertionError() + if (!(element1 in 3uL..<1uL) != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in 3uL..<1uL) != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if (2uL in 3uL..<1uL != range1.contains(2uL)) throw AssertionError() + if (2uL !in 3uL..<1uL != !range1.contains(2uL)) throw AssertionError() + if (!(2uL in 3uL..<1uL) != !range1.contains(2uL)) throw AssertionError() + if (!(2uL !in 3uL..<1uL) != range1.contains(2uL)) throw AssertionError() + // no local optimizations + if (element2 in 3uL..<1uL != range1.contains(element2)) throw AssertionError() + if (element2 !in 3uL..<1uL != !range1.contains(element2)) throw AssertionError() + if (!(element2 in 3uL..<1uL) != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in 3uL..<1uL) != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if (3uL in 3uL..<1uL != range1.contains(3uL)) throw AssertionError() + if (3uL !in 3uL..<1uL != !range1.contains(3uL)) throw AssertionError() + if (!(3uL in 3uL..<1uL) != !range1.contains(3uL)) throw AssertionError() + if (!(3uL !in 3uL..<1uL) != range1.contains(3uL)) throw AssertionError() + // no local optimizations + if (element3 in 3uL..<1uL != range1.contains(element3)) throw AssertionError() + if (element3 !in 3uL..<1uL != !range1.contains(element3)) throw AssertionError() + if (!(element3 in 3uL..<1uL) != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in 3uL..<1uL) != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if (4uL in 3uL..<1uL != range1.contains(4uL)) throw AssertionError() + if (4uL !in 3uL..<1uL != !range1.contains(4uL)) throw AssertionError() + if (!(4uL in 3uL..<1uL) != !range1.contains(4uL)) throw AssertionError() + if (!(4uL !in 3uL..<1uL) != range1.contains(4uL)) throw AssertionError() + // no local optimizations + if (element4 in 3uL..<1uL != range1.contains(element4)) throw AssertionError() + if (element4 !in 3uL..<1uL != !range1.contains(element4)) throw AssertionError() + if (!(element4 in 3uL..<1uL) != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in 3uL..<1uL) != range1.contains(element4)) throw AssertionError() +} + + diff --git a/compiler/testData/codegen/box/ranges/contains/generated/ulongUntil.kt b/compiler/testData/codegen/box/ranges/contains/generated/ulongUntil.kt new file mode 100644 index 00000000000..9864c567354 --- /dev/null +++ b/compiler/testData/codegen/box/ranges/contains/generated/ulongUntil.kt @@ -0,0 +1,159 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_STDLIB + + + +val range0 = 1uL until 3uL +val range1 = 3uL until 1uL + +val element0 = 0uL +val element1 = 1uL +val element2 = 2uL +val element3 = 3uL +val element4 = 4uL + +fun box(): String { + testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if (0uL in 1uL until 3uL != range0.contains(0uL)) throw AssertionError() + if (0uL !in 1uL until 3uL != !range0.contains(0uL)) throw AssertionError() + if (!(0uL in 1uL until 3uL) != !range0.contains(0uL)) throw AssertionError() + if (!(0uL !in 1uL until 3uL) != range0.contains(0uL)) throw AssertionError() + // no local optimizations + if (element0 in 1uL until 3uL != range0.contains(element0)) throw AssertionError() + if (element0 !in 1uL until 3uL != !range0.contains(element0)) throw AssertionError() + if (!(element0 in 1uL until 3uL) != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in 1uL until 3uL) != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if (1uL in 1uL until 3uL != range0.contains(1uL)) throw AssertionError() + if (1uL !in 1uL until 3uL != !range0.contains(1uL)) throw AssertionError() + if (!(1uL in 1uL until 3uL) != !range0.contains(1uL)) throw AssertionError() + if (!(1uL !in 1uL until 3uL) != range0.contains(1uL)) throw AssertionError() + // no local optimizations + if (element1 in 1uL until 3uL != range0.contains(element1)) throw AssertionError() + if (element1 !in 1uL until 3uL != !range0.contains(element1)) throw AssertionError() + if (!(element1 in 1uL until 3uL) != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in 1uL until 3uL) != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if (2uL in 1uL until 3uL != range0.contains(2uL)) throw AssertionError() + if (2uL !in 1uL until 3uL != !range0.contains(2uL)) throw AssertionError() + if (!(2uL in 1uL until 3uL) != !range0.contains(2uL)) throw AssertionError() + if (!(2uL !in 1uL until 3uL) != range0.contains(2uL)) throw AssertionError() + // no local optimizations + if (element2 in 1uL until 3uL != range0.contains(element2)) throw AssertionError() + if (element2 !in 1uL until 3uL != !range0.contains(element2)) throw AssertionError() + if (!(element2 in 1uL until 3uL) != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in 1uL until 3uL) != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if (3uL in 1uL until 3uL != range0.contains(3uL)) throw AssertionError() + if (3uL !in 1uL until 3uL != !range0.contains(3uL)) throw AssertionError() + if (!(3uL in 1uL until 3uL) != !range0.contains(3uL)) throw AssertionError() + if (!(3uL !in 1uL until 3uL) != range0.contains(3uL)) throw AssertionError() + // no local optimizations + if (element3 in 1uL until 3uL != range0.contains(element3)) throw AssertionError() + if (element3 !in 1uL until 3uL != !range0.contains(element3)) throw AssertionError() + if (!(element3 in 1uL until 3uL) != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in 1uL until 3uL) != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if (4uL in 1uL until 3uL != range0.contains(4uL)) throw AssertionError() + if (4uL !in 1uL until 3uL != !range0.contains(4uL)) throw AssertionError() + if (!(4uL in 1uL until 3uL) != !range0.contains(4uL)) throw AssertionError() + if (!(4uL !in 1uL until 3uL) != range0.contains(4uL)) throw AssertionError() + // no local optimizations + if (element4 in 1uL until 3uL != range0.contains(element4)) throw AssertionError() + if (element4 !in 1uL until 3uL != !range0.contains(element4)) throw AssertionError() + if (!(element4 in 1uL until 3uL) != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in 1uL until 3uL) != range0.contains(element4)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if (0uL in 3uL until 1uL != range1.contains(0uL)) throw AssertionError() + if (0uL !in 3uL until 1uL != !range1.contains(0uL)) throw AssertionError() + if (!(0uL in 3uL until 1uL) != !range1.contains(0uL)) throw AssertionError() + if (!(0uL !in 3uL until 1uL) != range1.contains(0uL)) throw AssertionError() + // no local optimizations + if (element0 in 3uL until 1uL != range1.contains(element0)) throw AssertionError() + if (element0 !in 3uL until 1uL != !range1.contains(element0)) throw AssertionError() + if (!(element0 in 3uL until 1uL) != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in 3uL until 1uL) != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if (1uL in 3uL until 1uL != range1.contains(1uL)) throw AssertionError() + if (1uL !in 3uL until 1uL != !range1.contains(1uL)) throw AssertionError() + if (!(1uL in 3uL until 1uL) != !range1.contains(1uL)) throw AssertionError() + if (!(1uL !in 3uL until 1uL) != range1.contains(1uL)) throw AssertionError() + // no local optimizations + if (element1 in 3uL until 1uL != range1.contains(element1)) throw AssertionError() + if (element1 !in 3uL until 1uL != !range1.contains(element1)) throw AssertionError() + if (!(element1 in 3uL until 1uL) != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in 3uL until 1uL) != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if (2uL in 3uL until 1uL != range1.contains(2uL)) throw AssertionError() + if (2uL !in 3uL until 1uL != !range1.contains(2uL)) throw AssertionError() + if (!(2uL in 3uL until 1uL) != !range1.contains(2uL)) throw AssertionError() + if (!(2uL !in 3uL until 1uL) != range1.contains(2uL)) throw AssertionError() + // no local optimizations + if (element2 in 3uL until 1uL != range1.contains(element2)) throw AssertionError() + if (element2 !in 3uL until 1uL != !range1.contains(element2)) throw AssertionError() + if (!(element2 in 3uL until 1uL) != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in 3uL until 1uL) != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if (3uL in 3uL until 1uL != range1.contains(3uL)) throw AssertionError() + if (3uL !in 3uL until 1uL != !range1.contains(3uL)) throw AssertionError() + if (!(3uL in 3uL until 1uL) != !range1.contains(3uL)) throw AssertionError() + if (!(3uL !in 3uL until 1uL) != range1.contains(3uL)) throw AssertionError() + // no local optimizations + if (element3 in 3uL until 1uL != range1.contains(element3)) throw AssertionError() + if (element3 !in 3uL until 1uL != !range1.contains(element3)) throw AssertionError() + if (!(element3 in 3uL until 1uL) != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in 3uL until 1uL) != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if (4uL in 3uL until 1uL != range1.contains(4uL)) throw AssertionError() + if (4uL !in 3uL until 1uL != !range1.contains(4uL)) throw AssertionError() + if (!(4uL in 3uL until 1uL) != !range1.contains(4uL)) throw AssertionError() + if (!(4uL !in 3uL until 1uL) != range1.contains(4uL)) throw AssertionError() + // no local optimizations + if (element4 in 3uL until 1uL != range1.contains(element4)) throw AssertionError() + if (element4 !in 3uL until 1uL != !range1.contains(element4)) throw AssertionError() + if (!(element4 in 3uL until 1uL) != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in 3uL until 1uL) != range1.contains(element4)) throw AssertionError() +} + + 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 c0f3b38c65d..49ba9cf3366 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 @@ -35248,9 +35248,9 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { } @Test - @TestMetadata("charRangeLiteral.kt") - public void testCharRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/charRangeLiteral.kt"); + @TestMetadata("charRangeTo.kt") + public void testCharRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/charRangeTo.kt"); } @Test @@ -35272,15 +35272,15 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { } @Test - @TestMetadata("doubleRangeLiteral.kt") - public void testDoubleRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/doubleRangeLiteral.kt"); + @TestMetadata("doubleRangeTo.kt") + public void testDoubleRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/doubleRangeTo.kt"); } @Test - @TestMetadata("floatRangeLiteral.kt") - public void testFloatRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/floatRangeLiteral.kt"); + @TestMetadata("floatRangeTo.kt") + public void testFloatRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/floatRangeTo.kt"); } @Test @@ -35290,9 +35290,9 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { } @Test - @TestMetadata("intRangeLiteral.kt") - public void testIntRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/intRangeLiteral.kt"); + @TestMetadata("intRangeTo.kt") + public void testIntRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/intRangeTo.kt"); } @Test @@ -35308,9 +35308,9 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { } @Test - @TestMetadata("longRangeLiteral.kt") - public void testLongRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/longRangeLiteral.kt"); + @TestMetadata("longRangeTo.kt") + public void testLongRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/longRangeTo.kt"); } @Test @@ -35318,6 +35318,42 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { public void testLongUntil() throws Exception { runTest("compiler/testData/codegen/box/ranges/contains/generated/longUntil.kt"); } + + @Test + @TestMetadata("uintDownTo.kt") + public void testUintDownTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/uintDownTo.kt"); + } + + @Test + @TestMetadata("uintRangeTo.kt") + public void testUintRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/uintRangeTo.kt"); + } + + @Test + @TestMetadata("uintUntil.kt") + public void testUintUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/uintUntil.kt"); + } + + @Test + @TestMetadata("ulongDownTo.kt") + public void testUlongDownTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/ulongDownTo.kt"); + } + + @Test + @TestMetadata("ulongRangeTo.kt") + public void testUlongRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/ulongRangeTo.kt"); + } + + @Test + @TestMetadata("ulongUntil.kt") + public void testUlongUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/ulongUntil.kt"); + } } } 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 7c70aeff185..c4f19bdb169 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 @@ -35872,9 +35872,15 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes } @Test - @TestMetadata("charRangeLiteral.kt") - public void testCharRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/charRangeLiteral.kt"); + @TestMetadata("charRangeTo.kt") + public void testCharRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/charRangeTo.kt"); + } + + @Test + @TestMetadata("charRangeUntil.kt") + public void testCharRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/charRangeUntil.kt"); } @Test @@ -35896,15 +35902,27 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes } @Test - @TestMetadata("doubleRangeLiteral.kt") - public void testDoubleRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/doubleRangeLiteral.kt"); + @TestMetadata("doubleRangeTo.kt") + public void testDoubleRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/doubleRangeTo.kt"); } @Test - @TestMetadata("floatRangeLiteral.kt") - public void testFloatRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/floatRangeLiteral.kt"); + @TestMetadata("doubleRangeUntil.kt") + public void testDoubleRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/doubleRangeUntil.kt"); + } + + @Test + @TestMetadata("floatRangeTo.kt") + public void testFloatRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/floatRangeTo.kt"); + } + + @Test + @TestMetadata("floatRangeUntil.kt") + public void testFloatRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/floatRangeUntil.kt"); } @Test @@ -35914,9 +35932,15 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes } @Test - @TestMetadata("intRangeLiteral.kt") - public void testIntRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/intRangeLiteral.kt"); + @TestMetadata("intRangeTo.kt") + public void testIntRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/intRangeTo.kt"); + } + + @Test + @TestMetadata("intRangeUntil.kt") + public void testIntRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/intRangeUntil.kt"); } @Test @@ -35932,9 +35956,15 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes } @Test - @TestMetadata("longRangeLiteral.kt") - public void testLongRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/longRangeLiteral.kt"); + @TestMetadata("longRangeTo.kt") + public void testLongRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/longRangeTo.kt"); + } + + @Test + @TestMetadata("longRangeUntil.kt") + public void testLongRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/longRangeUntil.kt"); } @Test @@ -35942,6 +35972,54 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes public void testLongUntil() throws Exception { runTest("compiler/testData/codegen/box/ranges/contains/generated/longUntil.kt"); } + + @Test + @TestMetadata("uintDownTo.kt") + public void testUintDownTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/uintDownTo.kt"); + } + + @Test + @TestMetadata("uintRangeTo.kt") + public void testUintRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/uintRangeTo.kt"); + } + + @Test + @TestMetadata("uintRangeUntil.kt") + public void testUintRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/uintRangeUntil.kt"); + } + + @Test + @TestMetadata("uintUntil.kt") + public void testUintUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/uintUntil.kt"); + } + + @Test + @TestMetadata("ulongDownTo.kt") + public void testUlongDownTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/ulongDownTo.kt"); + } + + @Test + @TestMetadata("ulongRangeTo.kt") + public void testUlongRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/ulongRangeTo.kt"); + } + + @Test + @TestMetadata("ulongRangeUntil.kt") + public void testUlongRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/ulongRangeUntil.kt"); + } + + @Test + @TestMetadata("ulongUntil.kt") + public void testUlongUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/ulongUntil.kt"); + } } } diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index aac2deff2cc..90b574964db 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -30093,9 +30093,9 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/ranges/contains/generated/charDownTo.kt"); } - @TestMetadata("charRangeLiteral.kt") - public void testCharRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/charRangeLiteral.kt"); + @TestMetadata("charRangeTo.kt") + public void testCharRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/charRangeTo.kt"); } @TestMetadata("charSequenceIndices.kt") @@ -30113,14 +30113,14 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/ranges/contains/generated/collectionIndices.kt"); } - @TestMetadata("doubleRangeLiteral.kt") - public void testDoubleRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/doubleRangeLiteral.kt"); + @TestMetadata("doubleRangeTo.kt") + public void testDoubleRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/doubleRangeTo.kt"); } - @TestMetadata("floatRangeLiteral.kt") - public void testFloatRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/floatRangeLiteral.kt"); + @TestMetadata("floatRangeTo.kt") + public void testFloatRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/floatRangeTo.kt"); } @TestMetadata("intDownTo.kt") @@ -30128,9 +30128,9 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/ranges/contains/generated/intDownTo.kt"); } - @TestMetadata("intRangeLiteral.kt") - public void testIntRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/intRangeLiteral.kt"); + @TestMetadata("intRangeTo.kt") + public void testIntRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/intRangeTo.kt"); } @TestMetadata("intUntil.kt") @@ -30143,15 +30143,45 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/ranges/contains/generated/longDownTo.kt"); } - @TestMetadata("longRangeLiteral.kt") - public void testLongRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/longRangeLiteral.kt"); + @TestMetadata("longRangeTo.kt") + public void testLongRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/longRangeTo.kt"); } @TestMetadata("longUntil.kt") public void testLongUntil() throws Exception { runTest("compiler/testData/codegen/box/ranges/contains/generated/longUntil.kt"); } + + @TestMetadata("uintDownTo.kt") + public void testUintDownTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/uintDownTo.kt"); + } + + @TestMetadata("uintRangeTo.kt") + public void testUintRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/uintRangeTo.kt"); + } + + @TestMetadata("uintUntil.kt") + public void testUintUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/uintUntil.kt"); + } + + @TestMetadata("ulongDownTo.kt") + public void testUlongDownTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/ulongDownTo.kt"); + } + + @TestMetadata("ulongRangeTo.kt") + public void testUlongRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/ulongRangeTo.kt"); + } + + @TestMetadata("ulongUntil.kt") + public void testUlongUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/ulongUntil.kt"); + } } } diff --git a/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateInRangeExpressionTestData.kt b/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateInRangeExpressionTestData.kt index 49f4a00fb01..cd49ba8b46a 100644 --- a/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateInRangeExpressionTestData.kt +++ b/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateInRangeExpressionTestData.kt @@ -6,6 +6,8 @@ package org.jetbrains.kotlin.generators.tests import com.intellij.openapi.util.io.FileUtil +import org.jetbrains.kotlin.generators.tests.GenerateSteppedRangesCodegenTestData.Function +import org.jetbrains.kotlin.generators.tests.GenerateSteppedRangesCodegenTestData.Function.* import java.io.File import java.io.PrintWriter import java.io.StringWriter @@ -42,6 +44,11 @@ object GenerateInRangeExpressionTestData { } println("// $PREAMBLE_MESSAGE") println("// WITH_STDLIB") + if (rangeExpressions.any { "..<" in it }) { + println("// DONT_TARGET_EXACT_BACKEND: JVM") + println("// !LANGUAGE: +RangeUntilOperator") + println("@file:OptIn(ExperimentalStdlibApi::class)") + } println() println(header) println() @@ -98,21 +105,23 @@ object GenerateInRangeExpressionTestData { println() } - private fun generateRangeOperatorTestCase( - name: String, - aExpression: String, - op: String, - bExpression: String, + private fun generateRangeOperatorTestCases( + namePrefix: String, + functions: List, + bounds: Pair, elementExpressions: List ) { - generateMatrixTestCase( - name, - listOf( - "$aExpression $op $bExpression", - "$bExpression $op $aExpression" - ), - elementExpressions - ) + val (aExpression, bExpression) = bounds + for (function in functions) { + generateMatrixTestCase( + "$namePrefix${function.subdir.replaceFirstChar(Char::uppercase)}.kt", + listOf( + "$aExpression${function.infixFunctionName}$bExpression", + "$bExpression${function.infixFunctionName}$aExpression" + ), + elementExpressions + ) + } } @JvmStatic @@ -124,96 +133,42 @@ object GenerateInRangeExpressionTestData { val charLiterals = listOf("'0'", "'1'", "'2'", "'3'", "'4'") + val numbers = listOf("-1", "0", "1", "2", "3", "4") + fun String.wrapNegative() = if (this.startsWith("-")) "($this)" else this + val integerLiterals = - listOf("(-1)", "0", "1", "2", "3", "4").flatMap { - listOf("$it.toByte()", "$it.toShort()", it, "$it.toLong()") + numbers.flatMap { + listOf("${it.wrapNegative()}.toByte()", "${it.wrapNegative()}.toShort()", it, it + "L") } val floatingPointLiterals = - listOf("(-1)", "0", "1", "2", "3", "4").flatMap { - listOf("$it.toFloat()", "$it.toDouble()") + numbers.flatMap { + listOf(it + "F", it + ".0") } - generateRangeOperatorTestCase( - "charRangeLiteral.kt", - "'1'", - "..", - "'3'", - charLiterals - ) - generateRangeOperatorTestCase( - "charUntil.kt", - "'1'", - "until", - "'3'", - charLiterals - ) - generateRangeOperatorTestCase( - "charDownTo.kt", - "'3'", - "downTo", - "'1'", - charLiterals - ) + val unsignedNumbers = numbers.drop(1).map { it + "u" } - generateRangeOperatorTestCase( - "intRangeLiteral.kt", - "1", - "..", - "3", - integerLiterals - ) - generateRangeOperatorTestCase( - "intUntil.kt", - "1", - "until", - "3", - integerLiterals - ) - generateRangeOperatorTestCase( - "intDownTo.kt", - "3", - "downTo", - "1", - listOf("1") - ) + val allFunctions = Function.values().toList() + val rangeFunctions = allFunctions - DOWN_TO - generateRangeOperatorTestCase( - "longRangeLiteral.kt", - "1L", - "..", - "3L", - integerLiterals - ) - generateRangeOperatorTestCase( - "longUntil.kt", - "1L", - "until", - "3L", - integerLiterals - ) - generateRangeOperatorTestCase( - "longDownTo.kt", - "3L", - "downTo", - "1L", - listOf("1L") - ) + generateRangeOperatorTestCases("char", allFunctions, "'1'" to "'3'", charLiterals) - generateRangeOperatorTestCase( - "floatRangeLiteral.kt", - "1.0F", - "..", - "3.0F", - floatingPointLiterals - ) + val intBounds = "1" to "3" + generateRangeOperatorTestCases("int", rangeFunctions, intBounds, integerLiterals) + generateRangeOperatorTestCases("int", listOf(DOWN_TO), intBounds, numbers) - generateRangeOperatorTestCase( - "doubleRangeLiteral.kt", - "1.0", - "..", - "3.0", - floatingPointLiterals - ) + val longBounds = "1L" to "3L" + generateRangeOperatorTestCases("long", rangeFunctions, longBounds, integerLiterals) + generateRangeOperatorTestCases("long", listOf(DOWN_TO), longBounds, numbers.map { it + "L" }) + + generateRangeOperatorTestCases("uint", allFunctions, "1u" to "3u", unsignedNumbers) + generateRangeOperatorTestCases("ulong", allFunctions, "1uL" to "3uL", unsignedNumbers.map { it + "L" }) + + generateRangeOperatorTestCases("double", listOf(RANGE_TO, RANGE_UNTIL), "1.0" to "3.0", floatingPointLiterals) + + val floatBounds = "1.0F" to "3.0F" + generateRangeOperatorTestCases("float", listOf(RANGE_TO), floatBounds, floatingPointLiterals) + // only Float in OpenEndRange operation is supported + generateRangeOperatorTestCases("float", listOf(RANGE_UNTIL), floatBounds, floatingPointLiterals.filter { "F" in it }) generateMatrixTestCase( "arrayIndices.kt", diff --git a/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateSteppedRangesCodegenTestData.kt b/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateSteppedRangesCodegenTestData.kt index f720ea0b9a3..b3266c18ae9 100644 --- a/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateSteppedRangesCodegenTestData.kt +++ b/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateSteppedRangesCodegenTestData.kt @@ -46,7 +46,7 @@ object GenerateSteppedRangesCodegenTestData { } } - private enum class Function(val infixFunctionName: String, val subdir: String) { + enum class Function(val infixFunctionName: String, val subdir: String) { RANGE_TO("..", "rangeTo"), RANGE_UNTIL("..<", "rangeUntil"), UNTIL(" until ", "until"), diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java index e5f3bea5a10..eb77bbc52ca 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java @@ -26046,9 +26046,15 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { } @Test - @TestMetadata("charRangeLiteral.kt") - public void testCharRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/charRangeLiteral.kt"); + @TestMetadata("charRangeTo.kt") + public void testCharRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/charRangeTo.kt"); + } + + @Test + @TestMetadata("charRangeUntil.kt") + public void testCharRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/charRangeUntil.kt"); } @Test @@ -26070,15 +26076,27 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { } @Test - @TestMetadata("doubleRangeLiteral.kt") - public void testDoubleRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/doubleRangeLiteral.kt"); + @TestMetadata("doubleRangeTo.kt") + public void testDoubleRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/doubleRangeTo.kt"); } @Test - @TestMetadata("floatRangeLiteral.kt") - public void testFloatRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/floatRangeLiteral.kt"); + @TestMetadata("doubleRangeUntil.kt") + public void testDoubleRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/doubleRangeUntil.kt"); + } + + @Test + @TestMetadata("floatRangeTo.kt") + public void testFloatRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/floatRangeTo.kt"); + } + + @Test + @TestMetadata("floatRangeUntil.kt") + public void testFloatRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/floatRangeUntil.kt"); } @Test @@ -26088,9 +26106,15 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { } @Test - @TestMetadata("intRangeLiteral.kt") - public void testIntRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/intRangeLiteral.kt"); + @TestMetadata("intRangeTo.kt") + public void testIntRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/intRangeTo.kt"); + } + + @Test + @TestMetadata("intRangeUntil.kt") + public void testIntRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/intRangeUntil.kt"); } @Test @@ -26106,9 +26130,15 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { } @Test - @TestMetadata("longRangeLiteral.kt") - public void testLongRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/longRangeLiteral.kt"); + @TestMetadata("longRangeTo.kt") + public void testLongRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/longRangeTo.kt"); + } + + @Test + @TestMetadata("longRangeUntil.kt") + public void testLongRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/longRangeUntil.kt"); } @Test @@ -26116,6 +26146,54 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { public void testLongUntil() throws Exception { runTest("compiler/testData/codegen/box/ranges/contains/generated/longUntil.kt"); } + + @Test + @TestMetadata("uintDownTo.kt") + public void testUintDownTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/uintDownTo.kt"); + } + + @Test + @TestMetadata("uintRangeTo.kt") + public void testUintRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/uintRangeTo.kt"); + } + + @Test + @TestMetadata("uintRangeUntil.kt") + public void testUintRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/uintRangeUntil.kt"); + } + + @Test + @TestMetadata("uintUntil.kt") + public void testUintUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/uintUntil.kt"); + } + + @Test + @TestMetadata("ulongDownTo.kt") + public void testUlongDownTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/ulongDownTo.kt"); + } + + @Test + @TestMetadata("ulongRangeTo.kt") + public void testUlongRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/ulongRangeTo.kt"); + } + + @Test + @TestMetadata("ulongRangeUntil.kt") + public void testUlongRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/ulongRangeUntil.kt"); + } + + @Test + @TestMetadata("ulongUntil.kt") + public void testUlongUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/ulongUntil.kt"); + } } } diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java index 8042aebef77..40fcd0acab1 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java @@ -26040,9 +26040,15 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { } @Test - @TestMetadata("charRangeLiteral.kt") - public void testCharRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/charRangeLiteral.kt"); + @TestMetadata("charRangeTo.kt") + public void testCharRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/charRangeTo.kt"); + } + + @Test + @TestMetadata("charRangeUntil.kt") + public void testCharRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/charRangeUntil.kt"); } @Test @@ -26064,15 +26070,27 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { } @Test - @TestMetadata("doubleRangeLiteral.kt") - public void testDoubleRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/doubleRangeLiteral.kt"); + @TestMetadata("doubleRangeTo.kt") + public void testDoubleRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/doubleRangeTo.kt"); } @Test - @TestMetadata("floatRangeLiteral.kt") - public void testFloatRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/floatRangeLiteral.kt"); + @TestMetadata("doubleRangeUntil.kt") + public void testDoubleRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/doubleRangeUntil.kt"); + } + + @Test + @TestMetadata("floatRangeTo.kt") + public void testFloatRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/floatRangeTo.kt"); + } + + @Test + @TestMetadata("floatRangeUntil.kt") + public void testFloatRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/floatRangeUntil.kt"); } @Test @@ -26082,9 +26100,15 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { } @Test - @TestMetadata("intRangeLiteral.kt") - public void testIntRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/intRangeLiteral.kt"); + @TestMetadata("intRangeTo.kt") + public void testIntRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/intRangeTo.kt"); + } + + @Test + @TestMetadata("intRangeUntil.kt") + public void testIntRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/intRangeUntil.kt"); } @Test @@ -26100,9 +26124,15 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { } @Test - @TestMetadata("longRangeLiteral.kt") - public void testLongRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/longRangeLiteral.kt"); + @TestMetadata("longRangeTo.kt") + public void testLongRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/longRangeTo.kt"); + } + + @Test + @TestMetadata("longRangeUntil.kt") + public void testLongRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/longRangeUntil.kt"); } @Test @@ -26110,6 +26140,54 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { public void testLongUntil() throws Exception { runTest("compiler/testData/codegen/box/ranges/contains/generated/longUntil.kt"); } + + @Test + @TestMetadata("uintDownTo.kt") + public void testUintDownTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/uintDownTo.kt"); + } + + @Test + @TestMetadata("uintRangeTo.kt") + public void testUintRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/uintRangeTo.kt"); + } + + @Test + @TestMetadata("uintRangeUntil.kt") + public void testUintRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/uintRangeUntil.kt"); + } + + @Test + @TestMetadata("uintUntil.kt") + public void testUintUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/uintUntil.kt"); + } + + @Test + @TestMetadata("ulongDownTo.kt") + public void testUlongDownTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/ulongDownTo.kt"); + } + + @Test + @TestMetadata("ulongRangeTo.kt") + public void testUlongRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/ulongRangeTo.kt"); + } + + @Test + @TestMetadata("ulongRangeUntil.kt") + public void testUlongRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/ulongRangeUntil.kt"); + } + + @Test + @TestMetadata("ulongUntil.kt") + public void testUlongUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/ulongUntil.kt"); + } } } diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java index c3535990f14..b17705c8a05 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java @@ -23231,9 +23231,14 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/ranges/contains/generated/charDownTo.kt"); } - @TestMetadata("charRangeLiteral.kt") - public void testCharRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/charRangeLiteral.kt"); + @TestMetadata("charRangeTo.kt") + public void testCharRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/charRangeTo.kt"); + } + + @TestMetadata("charRangeUntil.kt") + public void testCharRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/charRangeUntil.kt"); } @TestMetadata("charSequenceIndices.kt") @@ -23251,14 +23256,24 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/ranges/contains/generated/collectionIndices.kt"); } - @TestMetadata("doubleRangeLiteral.kt") - public void testDoubleRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/doubleRangeLiteral.kt"); + @TestMetadata("doubleRangeTo.kt") + public void testDoubleRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/doubleRangeTo.kt"); } - @TestMetadata("floatRangeLiteral.kt") - public void testFloatRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/floatRangeLiteral.kt"); + @TestMetadata("doubleRangeUntil.kt") + public void testDoubleRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/doubleRangeUntil.kt"); + } + + @TestMetadata("floatRangeTo.kt") + public void testFloatRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/floatRangeTo.kt"); + } + + @TestMetadata("floatRangeUntil.kt") + public void testFloatRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/floatRangeUntil.kt"); } @TestMetadata("intDownTo.kt") @@ -23266,9 +23281,14 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/ranges/contains/generated/intDownTo.kt"); } - @TestMetadata("intRangeLiteral.kt") - public void testIntRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/intRangeLiteral.kt"); + @TestMetadata("intRangeTo.kt") + public void testIntRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/intRangeTo.kt"); + } + + @TestMetadata("intRangeUntil.kt") + public void testIntRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/intRangeUntil.kt"); } @TestMetadata("intUntil.kt") @@ -23281,15 +23301,60 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/ranges/contains/generated/longDownTo.kt"); } - @TestMetadata("longRangeLiteral.kt") - public void testLongRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/longRangeLiteral.kt"); + @TestMetadata("longRangeTo.kt") + public void testLongRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/longRangeTo.kt"); + } + + @TestMetadata("longRangeUntil.kt") + public void testLongRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/longRangeUntil.kt"); } @TestMetadata("longUntil.kt") public void testLongUntil() throws Exception { runTest("compiler/testData/codegen/box/ranges/contains/generated/longUntil.kt"); } + + @TestMetadata("uintDownTo.kt") + public void testUintDownTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/uintDownTo.kt"); + } + + @TestMetadata("uintRangeTo.kt") + public void testUintRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/uintRangeTo.kt"); + } + + @TestMetadata("uintRangeUntil.kt") + public void testUintRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/uintRangeUntil.kt"); + } + + @TestMetadata("uintUntil.kt") + public void testUintUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/uintUntil.kt"); + } + + @TestMetadata("ulongDownTo.kt") + public void testUlongDownTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/ulongDownTo.kt"); + } + + @TestMetadata("ulongRangeTo.kt") + public void testUlongRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/ulongRangeTo.kt"); + } + + @TestMetadata("ulongRangeUntil.kt") + public void testUlongRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/ulongRangeUntil.kt"); + } + + @TestMetadata("ulongUntil.kt") + public void testUlongUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/ulongUntil.kt"); + } } } diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java index 1d9388a5cf0..6f925aea883 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java @@ -28867,9 +28867,15 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest } @Test - @TestMetadata("charRangeLiteral.kt") - public void testCharRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/charRangeLiteral.kt"); + @TestMetadata("charRangeTo.kt") + public void testCharRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/charRangeTo.kt"); + } + + @Test + @TestMetadata("charRangeUntil.kt") + public void testCharRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/charRangeUntil.kt"); } @Test @@ -28891,15 +28897,27 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest } @Test - @TestMetadata("doubleRangeLiteral.kt") - public void testDoubleRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/doubleRangeLiteral.kt"); + @TestMetadata("doubleRangeTo.kt") + public void testDoubleRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/doubleRangeTo.kt"); } @Test - @TestMetadata("floatRangeLiteral.kt") - public void testFloatRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/floatRangeLiteral.kt"); + @TestMetadata("doubleRangeUntil.kt") + public void testDoubleRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/doubleRangeUntil.kt"); + } + + @Test + @TestMetadata("floatRangeTo.kt") + public void testFloatRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/floatRangeTo.kt"); + } + + @Test + @TestMetadata("floatRangeUntil.kt") + public void testFloatRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/floatRangeUntil.kt"); } @Test @@ -28909,9 +28927,15 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest } @Test - @TestMetadata("intRangeLiteral.kt") - public void testIntRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/intRangeLiteral.kt"); + @TestMetadata("intRangeTo.kt") + public void testIntRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/intRangeTo.kt"); + } + + @Test + @TestMetadata("intRangeUntil.kt") + public void testIntRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/intRangeUntil.kt"); } @Test @@ -28927,9 +28951,15 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest } @Test - @TestMetadata("longRangeLiteral.kt") - public void testLongRangeLiteral() throws Exception { - runTest("compiler/testData/codegen/box/ranges/contains/generated/longRangeLiteral.kt"); + @TestMetadata("longRangeTo.kt") + public void testLongRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/longRangeTo.kt"); + } + + @Test + @TestMetadata("longRangeUntil.kt") + public void testLongRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/longRangeUntil.kt"); } @Test @@ -28937,6 +28967,54 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest public void testLongUntil() throws Exception { runTest("compiler/testData/codegen/box/ranges/contains/generated/longUntil.kt"); } + + @Test + @TestMetadata("uintDownTo.kt") + public void testUintDownTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/uintDownTo.kt"); + } + + @Test + @TestMetadata("uintRangeTo.kt") + public void testUintRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/uintRangeTo.kt"); + } + + @Test + @TestMetadata("uintRangeUntil.kt") + public void testUintRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/uintRangeUntil.kt"); + } + + @Test + @TestMetadata("uintUntil.kt") + public void testUintUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/uintUntil.kt"); + } + + @Test + @TestMetadata("ulongDownTo.kt") + public void testUlongDownTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/ulongDownTo.kt"); + } + + @Test + @TestMetadata("ulongRangeTo.kt") + public void testUlongRangeTo() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/ulongRangeTo.kt"); + } + + @Test + @TestMetadata("ulongRangeUntil.kt") + public void testUlongRangeUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/ulongRangeUntil.kt"); + } + + @Test + @TestMetadata("ulongUntil.kt") + public void testUlongUntil() throws Exception { + runTest("compiler/testData/codegen/box/ranges/contains/generated/ulongUntil.kt"); + } } }