[FIR2IR] Fix considering of Contains intrinsic

This commit is contained in:
Ivan Kochurkin
2021-10-13 19:29:22 +03:00
committed by TeamCityServer
parent 15d23f2a72
commit 0d91e16a15
13 changed files with 8 additions and 17 deletions
@@ -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<Any>) = i in xs.indices
@@ -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
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun testCollection(i: Int, xs: List<Any>) = i in xs.indices
fun testLongWithCollection(i: Long, xs: List<Any>) = i in xs.indices
@@ -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 <T : Comparable<T>> test3(x: T, left: T, right: T) = x in left .. right
@@ -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
@@ -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
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun inInt(x: Long): Boolean {
return x in 1..2
}
@@ -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
@@ -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
@@ -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