Added linkage tests on synthetic fields

This commit is contained in:
Igor Chevdar
2018-08-01 16:56:09 +03:00
parent af841e3003
commit bde9b3e5ed
7 changed files with 79 additions and 0 deletions
+18
View File
@@ -876,6 +876,12 @@ task innerClass_secondaryConstructor(type: RunKonanTest) {
source = "codegen/innerClass/secondaryConstructor.kt"
}
task innerClass_linkTest(type: LinkKonanTest) {
goldValue = ""
source = "codegen/innerClass/linkTest_main.kt"
lib = "codegen/innerClass/linkTest_lib.kt"
}
task localClass_localHierarchy(type: RunKonanTest) {
goldValue = "OK\n"
source = "codegen/localClass/localHierarchy.kt"
@@ -1087,6 +1093,12 @@ task classDelegation_withBridge(type: RunKonanTest) {
source = "codegen/classDelegation/withBridge.kt"
}
task classDelegation_linkTest(type: LinkKonanTest) {
goldValue = "qxx\n123\n42\n117\nzzz\n"
source = "codegen/classDelegation/linkTest_main.kt"
lib = "codegen/classDelegation/linkTest_lib.kt"
}
task delegatedProperty_simpleVal(type: RunKonanTest) {
goldValue = "x\n42\n"
source = "codegen/delegatedProperty/simpleVal.kt"
@@ -1113,6 +1125,12 @@ task delegatedProperty_delegatedOverride(type: LinkKonanTest) {
lib = "codegen/delegatedProperty/delegatedOverride_lib.kt"
}
task delegatedProperty_correctFieldsOrder(type: LinkKonanTest) {
goldValue = "qxx\n117\nzzz\nqzz\n"
source = "codegen/delegatedProperty/correctFieldsOrder_main.kt"
lib = "codegen/delegatedProperty/correctFieldsOrder_lib.kt"
}
task delegatedProperty_lazy(type: RunKonanTest) {
goldValue = "computed!\nHello\nHello\n"
source = "codegen/delegatedProperty/lazy.kt"
@@ -0,0 +1,14 @@
package zzz
interface I {
fun foo(): Int
}
open class A : I {
override fun foo() = 42
}
open class B : I by A() {
val x = 117
val y = "zzz"
}
@@ -0,0 +1,15 @@
import zzz.*
class C : B() {
val a = "qxx"
val b = 123
}
fun main(args: Array<String>) {
val c = C()
println(c.a)
println(c.b)
println(c.foo())
println(c.x)
println(c.y)
}
@@ -0,0 +1,7 @@
package zzz
open class B {
val z by lazy { "qzz" }
val x = 117
val zzz = "zzz"
}
@@ -0,0 +1,13 @@
import zzz.*
class C : B() {
val a = "qxx"
}
fun main(args: Array<String>) {
val c = C()
println(c.a)
println(c.x)
println(c.zzz)
println(c.z)
}
@@ -0,0 +1,5 @@
open class A {
open inner class Inner {
val x = 42
}
}
@@ -0,0 +1,7 @@
open class B : A() {
open inner class Inner : A.Inner()
}
fun main(args: Array<String>) {
B().Inner()
}