Files
kotlin/compiler/testData/codegen/bytecodeText/ranges/inArrayIndices.kt
Dmitry Petrov aa7db727ba Fold I2L with ICONST_n when beneficial
ICONST_0; I2L -> LCONST_0
ICONST_1; I2L -> LCONST_1
2017-07-10 10:51:26 +03:00

16 lines
380 B
Kotlin
Vendored

// WITH_RUNTIME
fun testPrimitiveArray(i: Int, ints: IntArray) = i in ints.indices
fun testObjectArray(i: Int, xs: Array<Any>) = i in xs.indices
fun testLongWithPrimitiveArray(i: Long, ints: IntArray) = i in ints.indices
fun testLongWithObjectArray(i: Long, xs: Array<Any>) = i in xs.indices
// 0 getIndices
// 0 contains
// 2 I2L
// 4 ARRAYLENGTH
// 2 LCONST_0
// 6 ICONST_0