[IR] Add MFVC generation tests

#KT-1179
This commit is contained in:
Evgeniy.Zhelenskiy
2022-05-07 00:03:39 +03:00
committed by teamcity
parent 73b0fac657
commit a788433aac
23 changed files with 1399 additions and 233 deletions
@@ -0,0 +1,26 @@
// WITH_STDLIB
// TARGET_BACKEND: JVM_IR
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses
@JvmInline
value class DPoint(val x: Double, val y: Double)
class A(var x: DPoint) {
init { x = DPoint(2.0, 3.0) }
}
class B() {
var a = DPoint(4.0, 5.0)
val b = a
init { a = DPoint(6.0, 7.0) }
val c = a
}
fun box(): String {
require(A(DPoint(0.0, 1.0)).x == DPoint(2.0, 3.0)) { "No init used" }
require(B().a == DPoint(6.0, 7.0)) { "No init used" }
require(B().b == DPoint(4.0, 5.0)) { "Wrong init order used" }
require(B().c == DPoint(6.0, 7.0)) { "Wrong init order used" }
return "OK"
}