Optimize rangeUntil operator in for-loops and contains

Newly added tests are basically copies of the existing tests on `until`.
Note that this operator is optimized for all backends, but the fact that
it's optimized is only checked for the JVM backend in bytecode text
tests.

 #KT-53330 Fixed
This commit is contained in:
Alexander Udalov
2022-12-09 14:57:22 +01:00
committed by Space Team
parent bc5acb5e9d
commit 28759a3ac3
17 changed files with 611 additions and 1 deletions
@@ -0,0 +1,16 @@
// !OPT_IN: kotlin.ExperimentalStdlibApi
// IGNORE_BACKEND: JVM
fun testChar(a: Char, x: Char, y: Char) = a in x..<y
fun testByte(a: Byte, x: Byte, y: Byte) = a in x..<y
fun testShort(a: Short, x: Short, y: Short) = a in x..<y
fun testInt(a: Int, x: Int, y: Int) = a in x..<y
fun testLong(a: Long, x: Long, y: Long) = a in x..<y
// 0 until
// 0 INVOKEVIRTUAL
// 0 contains