[IR] dumpKotlinLike: add testdata for FIR tests
This commit is contained in:
committed by
teamcityserver
parent
d7bd4240e1
commit
c68040753d
@@ -0,0 +1,45 @@
|
||||
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 <<array>>: IntArray = x
|
||||
val <<index_0>>: Int = 0
|
||||
<<array>>.set(index = <<index_0>>, value = <<array>>.get(index = <<index_0>>).plus(other = 1))
|
||||
}
|
||||
}
|
||||
|
||||
fun testCall() {
|
||||
{ // BLOCK
|
||||
val <<array>>: IntArray = foo()
|
||||
val <<index_0>>: Int = bar()
|
||||
<<array>>.set(index = <<index_0>>, value = <<array>>.get(index = <<index_0>>).times(other = 2))
|
||||
}
|
||||
}
|
||||
|
||||
fun testMember(c: C) {
|
||||
val <array>: IntArray = c.<get-x>()
|
||||
val <index0>: Int = 0
|
||||
val <unary>: Int = <array>.get(index = <index0>)
|
||||
<array>.set(index = <index0>, value = <unary>.inc())
|
||||
<unary> /*~> Unit */
|
||||
}
|
||||
Reference in New Issue
Block a user