diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt index e210fc2608e..773fd97f184 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt @@ -440,7 +440,8 @@ private val nameToOperationConventionOrigin = mutableMapOf( OperatorNameConventions.DIV to IrStatementOrigin.DIV, OperatorNameConventions.MOD to IrStatementOrigin.PERC, OperatorNameConventions.REM to IrStatementOrigin.PERC, - OperatorNameConventions.RANGE_TO to IrStatementOrigin.RANGE + OperatorNameConventions.RANGE_TO to IrStatementOrigin.RANGE, + OperatorNameConventions.CONTAINS to IrStatementOrigin.IN, ) internal fun FirReference.statementOrigin(): IrStatementOrigin? { diff --git a/compiler/testData/codegen/bytecodeText/ranges/inArrayIndices.kt b/compiler/testData/codegen/bytecodeText/ranges/inArrayIndices.kt index 9b4d50fca9e..eb11afc1855 100644 --- a/compiler/testData/codegen/bytecodeText/ranges/inArrayIndices.kt +++ b/compiler/testData/codegen/bytecodeText/ranges/inArrayIndices.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun testPrimitiveArray(i: Int, ints: IntArray) = i in ints.indices fun testObjectArray(i: Int, xs: Array) = i in xs.indices diff --git a/compiler/testData/codegen/bytecodeText/ranges/inCharSequenceIndices.kt b/compiler/testData/codegen/bytecodeText/ranges/inCharSequenceIndices.kt index bc5d07b1267..9c5003f200d 100644 --- a/compiler/testData/codegen/bytecodeText/ranges/inCharSequenceIndices.kt +++ b/compiler/testData/codegen/bytecodeText/ranges/inCharSequenceIndices.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun testCharSequence(i: Int, cs: CharSequence) = i in cs.indices fun testLongWithCharSequence(i: Long, cs: CharSequence) = i in cs.indices diff --git a/compiler/testData/codegen/bytecodeText/ranges/inCollectionIndices.kt b/compiler/testData/codegen/bytecodeText/ranges/inCollectionIndices.kt index 46bbf35967a..2426d4cf79e 100644 --- a/compiler/testData/codegen/bytecodeText/ranges/inCollectionIndices.kt +++ b/compiler/testData/codegen/bytecodeText/ranges/inCollectionIndices.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun testCollection(i: Int, xs: List) = i in xs.indices fun testLongWithCollection(i: Long, xs: List) = i in xs.indices diff --git a/compiler/testData/codegen/bytecodeText/ranges/inComparableRangeLiteral.kt b/compiler/testData/codegen/bytecodeText/ranges/inComparableRangeLiteral.kt index 67062f63213..bc7e71df6fa 100644 --- a/compiler/testData/codegen/bytecodeText/ranges/inComparableRangeLiteral.kt +++ b/compiler/testData/codegen/bytecodeText/ranges/inComparableRangeLiteral.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun test1(a: String) = a in "alpha" .. "omega" fun test2(a: String) = a !in "alpha" .. "omega" fun > test3(x: T, left: T, right: T) = x in left .. right diff --git a/compiler/testData/codegen/bytecodeText/ranges/inMixedUnsignedRange.kt b/compiler/testData/codegen/bytecodeText/ranges/inMixedUnsignedRange.kt index e90524cd50a..fb5aa71caf3 100644 --- a/compiler/testData/codegen/bytecodeText/ranges/inMixedUnsignedRange.kt +++ b/compiler/testData/codegen/bytecodeText/ranges/inMixedUnsignedRange.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun ub_ub(x: UByte, a: UByte, b: UByte) = x in a..b fun ub_us(x: UByte, a: UShort, b: UShort) = x in a..b fun ub_ui(x: UByte, a: UInt, b: UInt) = x in a..b diff --git a/compiler/testData/codegen/bytecodeText/ranges/inMixedUnsignedRange_2.kt b/compiler/testData/codegen/bytecodeText/ranges/inMixedUnsignedRange_2.kt index e052056574f..b32fe700a70 100644 --- a/compiler/testData/codegen/bytecodeText/ranges/inMixedUnsignedRange_2.kt +++ b/compiler/testData/codegen/bytecodeText/ranges/inMixedUnsignedRange_2.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // ULong in range of UInt, uses non-intrinsic 'contains' for non-IR backend fun ul_ub(x: ULong, a: UByte, b: UByte) = x in a..b diff --git a/compiler/testData/codegen/bytecodeText/ranges/inNonMatchingRangeIntrinsified.kt b/compiler/testData/codegen/bytecodeText/ranges/inNonMatchingRangeIntrinsified.kt index c5bdd13cba1..b5da9fd3862 100644 --- a/compiler/testData/codegen/bytecodeText/ranges/inNonMatchingRangeIntrinsified.kt +++ b/compiler/testData/codegen/bytecodeText/ranges/inNonMatchingRangeIntrinsified.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun inInt(x: Long): Boolean { return x in 1..2 } diff --git a/compiler/testData/codegen/bytecodeText/ranges/inOptimizableRange.kt b/compiler/testData/codegen/bytecodeText/ranges/inOptimizableRange.kt index 820af418e5e..4473c174761 100644 --- a/compiler/testData/codegen/bytecodeText/ranges/inOptimizableRange.kt +++ b/compiler/testData/codegen/bytecodeText/ranges/inOptimizableRange.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun Byte.inByte(left: Byte, right: Byte) = this in left..right fun Short.inInt(left: Int, right: Int) = this in left .. right diff --git a/compiler/testData/codegen/bytecodeText/ranges/inOptimizableUnsignedRange.kt b/compiler/testData/codegen/bytecodeText/ranges/inOptimizableUnsignedRange.kt index 85a97f54c29..271b06cb0e8 100644 --- a/compiler/testData/codegen/bytecodeText/ranges/inOptimizableUnsignedRange.kt +++ b/compiler/testData/codegen/bytecodeText/ranges/inOptimizableUnsignedRange.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun testUIntRangeLiteral(a: UInt, b: UInt) = 42u in a .. b fun testULongRangeLiteral(a: ULong, b: ULong) = 42UL in a .. b diff --git a/compiler/testData/codegen/bytecodeText/ranges/inUntil.kt b/compiler/testData/codegen/bytecodeText/ranges/inUntil.kt index 14b43172c1f..06a72214abe 100644 --- a/compiler/testData/codegen/bytecodeText/ranges/inUntil.kt +++ b/compiler/testData/codegen/bytecodeText/ranges/inUntil.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun testChar(a: Char, x: Char, y: Char) = a in x until y fun testByte(a: Byte, x: Byte, y: Byte) = a in x until y diff --git a/compiler/testData/ir/irText/expressions/in.fir.ir.txt b/compiler/testData/ir/irText/expressions/in.fir.ir.txt index f6ddc9f0852..87c58f465bf 100644 --- a/compiler/testData/ir/irText/expressions/in.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/in.fir.ir.txt @@ -4,7 +4,7 @@ FILE fqName: fileName:/in.kt VALUE_PARAMETER name:x index:1 type:kotlin.collections.Collection BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test1 (a: kotlin.Any, x: kotlin.collections.Collection): kotlin.Boolean declared in ' - CALL 'public abstract fun contains (element: E of kotlin.collections.Collection): kotlin.Boolean [operator] declared in kotlin.collections.Collection' type=kotlin.Boolean origin=null + CALL 'public abstract fun contains (element: E of kotlin.collections.Collection): kotlin.Boolean [operator] declared in kotlin.collections.Collection' type=kotlin.Boolean origin=IN $this: GET_VAR 'x: kotlin.collections.Collection declared in .test1' type=kotlin.collections.Collection origin=null element: GET_VAR 'a: kotlin.Any declared in .test1' type=kotlin.Any origin=null FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.Any, x:kotlin.collections.Collection) returnType:kotlin.Boolean @@ -13,7 +13,7 @@ FILE fqName: fileName:/in.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test2 (a: kotlin.Any, x: kotlin.collections.Collection): kotlin.Boolean declared in ' CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null - $this: CALL 'public abstract fun contains (element: E of kotlin.collections.Collection): kotlin.Boolean [operator] declared in kotlin.collections.Collection' type=kotlin.Boolean origin=null + $this: CALL 'public abstract fun contains (element: E of kotlin.collections.Collection): kotlin.Boolean [operator] declared in kotlin.collections.Collection' type=kotlin.Boolean origin=IN $this: GET_VAR 'x: kotlin.collections.Collection declared in .test2' type=kotlin.collections.Collection origin=null element: GET_VAR 'a: kotlin.Any declared in .test2' type=kotlin.Any origin=null FUN name:test3 visibility:public modality:FINAL (a:T of .test3, x:kotlin.collections.Collection.test3>) returnType:kotlin.Boolean @@ -22,7 +22,7 @@ FILE fqName: fileName:/in.kt VALUE_PARAMETER name:x index:1 type:kotlin.collections.Collection.test3> BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test3 (a: T of .test3, x: kotlin.collections.Collection.test3>): kotlin.Boolean declared in ' - CALL 'public abstract fun contains (element: E of kotlin.collections.Collection): kotlin.Boolean [operator] declared in kotlin.collections.Collection' type=kotlin.Boolean origin=null + CALL 'public abstract fun contains (element: E of kotlin.collections.Collection): kotlin.Boolean [operator] declared in kotlin.collections.Collection' type=kotlin.Boolean origin=IN $this: GET_VAR 'x: kotlin.collections.Collection.test3> declared in .test3' type=kotlin.collections.Collection.test3> origin=null element: GET_VAR 'a: T of .test3 declared in .test3' type=T of .test3 origin=null FUN name:test4 visibility:public modality:FINAL (a:T of .test4, x:kotlin.collections.Collection.test4>) returnType:kotlin.Boolean @@ -32,6 +32,6 @@ FILE fqName: fileName:/in.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test4 (a: T of .test4, x: kotlin.collections.Collection.test4>): kotlin.Boolean declared in ' CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null - $this: CALL 'public abstract fun contains (element: E of kotlin.collections.Collection): kotlin.Boolean [operator] declared in kotlin.collections.Collection' type=kotlin.Boolean origin=null + $this: CALL 'public abstract fun contains (element: E of kotlin.collections.Collection): kotlin.Boolean [operator] declared in kotlin.collections.Collection' type=kotlin.Boolean origin=IN $this: GET_VAR 'x: kotlin.collections.Collection.test4> declared in .test4' type=kotlin.collections.Collection.test4> origin=null element: GET_VAR 'a: T of .test4 declared in .test4' type=T of .test4 origin=null diff --git a/compiler/testData/ir/irText/expressions/when.fir.ir.txt b/compiler/testData/ir/irText/expressions/when.fir.ir.txt index 8011d00f0d7..a253e1094fe 100644 --- a/compiler/testData/ir/irText/expressions/when.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/when.fir.ir.txt @@ -45,7 +45,7 @@ FILE fqName: fileName:/when.kt GET_VAR 'val tmp_0: kotlin.Any? [val] declared in .testWithSubject' type=kotlin.Any? origin=null then: CONST String type=kotlin.String value="!Number" BRANCH - if: CALL 'public final fun contains (element: T of kotlin.collections.CollectionsKt.contains): kotlin.Boolean [operator] declared in kotlin.collections.CollectionsKt' type=kotlin.Boolean origin=null + if: CALL 'public final fun contains (element: T of kotlin.collections.CollectionsKt.contains): kotlin.Boolean [operator] declared in kotlin.collections.CollectionsKt' type=kotlin.Boolean origin=IN : kotlin.Any? $receiver: CALL 'public final fun setOf (): kotlin.collections.Set [inline] declared in kotlin.collections.SetsKt' type=kotlin.collections.Set origin=null : kotlin.Nothing @@ -78,7 +78,7 @@ FILE fqName: fileName:/when.kt GET_VAR 'x: kotlin.Any? declared in .test' type=kotlin.Any? origin=null then: CONST String type=kotlin.String value="!Number" BRANCH - if: CALL 'public final fun contains (element: T of kotlin.collections.CollectionsKt.contains): kotlin.Boolean [operator] declared in kotlin.collections.CollectionsKt' type=kotlin.Boolean origin=null + if: CALL 'public final fun contains (element: T of kotlin.collections.CollectionsKt.contains): kotlin.Boolean [operator] declared in kotlin.collections.CollectionsKt' type=kotlin.Boolean origin=IN : kotlin.Number $receiver: CALL 'public final fun setOf (): kotlin.collections.Set [inline] declared in kotlin.collections.SetsKt' type=kotlin.collections.Set origin=null : kotlin.Nothing