Files
kotlin-fork/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.kt.txt
T
Dmitriy Novozhilov b454fcc1e0 [FIR] Save IR dumps to .ir.txt files instead of .txt in tests
This is needed to avoid clashes between different dumps from different
  handlers
2021-10-12 17:26:36 +03:00

48 lines
931 B
Kotlin
Vendored

fun foo(): IntArray {
return intArrayOf(elements = [1, 2, 3])
}
fun bar(): Int {
return 42
}
class C {
constructor(x: IntArray) /* primary */ {
super/*Any*/()
/* <init>() */
}
val x: IntArray
field = x
get
}
fun testVariable() {
var x: IntArray = foo()
{ // BLOCK
val tmp0_array: IntArray = x
val tmp1_index0: Int = 0
tmp0_array.set(index = tmp1_index0, value = tmp0_array.get(index = tmp1_index0).plus(other = 1))
}
}
fun testCall() {
{ // BLOCK
val tmp0_array: IntArray = foo()
val tmp1_index0: Int = bar()
tmp0_array.set(index = tmp1_index0, value = tmp0_array.get(index = tmp1_index0).times(other = 2))
}
}
fun testMember(c: C) {
{ // BLOCK
val tmp0_array: IntArray = c.<get-x>()
val tmp1_index0: Int = 0
val tmp2: Int = tmp0_array.get(index = tmp1_index0)
tmp0_array.set(index = tmp1_index0, value = tmp2.inc())
tmp2
} /*~> Unit */
}