[Test] Move KotlinAgainstKotlin tests under BlackBoxCodegen tests

This commit is contained in:
Dmitriy Novozhilov
2021-01-22 15:13:50 +03:00
parent 1ea4fa4464
commit 5c8d555808
147 changed files with 3749 additions and 2743 deletions
@@ -0,0 +1,61 @@
// TARGET_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
// MODULE: lib
// FILE: A.kt
object Host {
var none: Int = 0
get() = field
set(value) { field = value }
var get: Int = 0
@JvmStatic
get() = field
set(value) { field = value }
var set: Int = 0
get() = field
@JvmStatic
set(value) { field = value }
var both: Int = 0
@JvmStatic
get() = field
@JvmStatic
set(value) { field = value }
@JvmStatic
var property: Int = 0
get() = field
set(value) { field = value }
}
// MODULE: main(lib)
// FILE: B.kt
import kotlin.reflect.*
fun box(): String {
val none = Host::none as KMutableProperty0<Int>
none.set(1)
if (none.get() != 1) return "Fail none: ${none.get()}"
val get = Host::get as KMutableProperty0<Int>
get.set(1)
if (get.get() != 1) return "Fail get: ${get.get()}"
val set = Host::set as KMutableProperty0<Int>
set.set(1)
if (set.get() != 1) return "Fail set: ${set.get()}"
val both = Host::both as KMutableProperty0<Int>
both.set(1)
if (both.get() != 1) return "Fail both: ${both.get()}"
val property = Host::property as KMutableProperty0<Int>
property.set(1)
if (property.get() != 1) return "Fail property: ${property.get()}"
return "OK"
}