mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
Use counter loop in intrinsic array constructors
#KT-19149 Fixed Target versions 1.1.5
This commit is contained in:
29
compiler/testData/codegen/bytecodeText/forLoop/intrinsicArrayConstructorsUseCounterLoop.kt
vendored
Normal file
29
compiler/testData/codegen/bytecodeText/forLoop/intrinsicArrayConstructorsUseCounterLoop.kt
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
fun Int.toTrue() = true
|
||||
|
||||
fun testBooleanArray(n: Int) =
|
||||
BooleanArray(n) { it.toTrue() }
|
||||
|
||||
fun testByteArray(n: Int) =
|
||||
ByteArray(n) { it.toByte() }
|
||||
|
||||
fun testShortArray(n: Int) =
|
||||
ShortArray(n) { it.toShort() }
|
||||
|
||||
fun testIntArray(n: Int) =
|
||||
IntArray(n) { it }
|
||||
|
||||
fun testLongArray(n: Int) =
|
||||
LongArray(n) { it.toLong() }
|
||||
|
||||
fun testFloatArray(n: Int) =
|
||||
FloatArray(n) { it.toFloat() }
|
||||
|
||||
fun testDoubleArray(n: Int) =
|
||||
DoubleArray(n) { it.toDouble() }
|
||||
|
||||
fun testObjectArray(n: Int) =
|
||||
Array(n) { it as Any }
|
||||
|
||||
// 0 IF_ICMPGT
|
||||
// 0 IF_CMPEQ
|
||||
// 8 IF_ICMPGE
|
||||
Reference in New Issue
Block a user