[PL][tests] Keep PL test data under "testData/klib/" dir
This commit is contained in:
committed by
Space Team
parent
9e3afe7a1f
commit
5c3e63e19a
@@ -0,0 +1,23 @@
|
||||
fun function(): String = "FAIL: function"
|
||||
fun removedFunction(): String = "FAIL: removedFunction"
|
||||
val property: String get() = "FAIL: property"
|
||||
val removedProperty: String get() = "FAIL: removedProperty"
|
||||
|
||||
class A {
|
||||
fun function(): String = "FAIL: A.function"
|
||||
fun removedFunction(): String = "FAIL: A.removedFunction"
|
||||
val property1: String get() = "FAIL: property1"
|
||||
val removedProperty1: String get() = "FAIL: removedProperty1"
|
||||
val property2: String = "FAIL: property2"
|
||||
val removedProperty2: String = "FAIL: removedProperty2"
|
||||
}
|
||||
|
||||
open class C {
|
||||
open fun removedOpenFunction(): String = "FAIL: C.removedOpenFunction"
|
||||
open val removedOpenProperty: String get() = "FAIL: C.removedOpenProperty"
|
||||
}
|
||||
|
||||
interface I {
|
||||
fun removedOpenFunction(): String = "FAIL: I.removedOpenFunction"
|
||||
val removedOpenProperty: String get() = "FAIL: I.removedOpenProperty"
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
fun function(): String = "OK"
|
||||
//fun removedFunction(): String = "FAIL: removedFunction"
|
||||
val property: String get() = "OK"
|
||||
//val removedProperty: String get() = "FAIL: removedProperty"
|
||||
|
||||
class A {
|
||||
fun function(): String = "OK"
|
||||
//fun removedFunction(): String = "FAIL: A.removedFunction"
|
||||
val property1: String get() = "OK"
|
||||
//val removedProperty1: String get() = "FAIL: removedProperty1"
|
||||
val property2: String = "OK"
|
||||
//val removedProperty2: String = "FAIL: removedProperty2"
|
||||
}
|
||||
|
||||
open class C {
|
||||
//open fun removedOpenFunction(): String = "FAIL: C.removedOpenFunction"
|
||||
//open val removedOpenProperty: String get() = "FAIL: C.removedOpenProperty"
|
||||
}
|
||||
|
||||
interface I {
|
||||
//fun removedOpenFunction(): String = "FAIL: I.removedOpenFunction"
|
||||
//val removedOpenProperty: String get() = "FAIL: I.removedOpenProperty"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib
|
||||
STEP 1:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.kt.1 -> l1.kt
|
||||
@@ -0,0 +1,19 @@
|
||||
fun callRemovedOrNormalFunction(removed: Boolean): String = if (removed) removedFunction() else function()
|
||||
fun callRemovedOrNormalFunctionOnObject(removed: Boolean): String = if (removed) A().removedFunction() else A().function()
|
||||
|
||||
fun readRemovedOrNormalProperty(removed: Boolean): String = if (removed) removedProperty else property
|
||||
fun readRemovedOrNormalPropertyOnObject1(removed: Boolean): String = if (removed) A().removedProperty1 else A().property1
|
||||
fun readRemovedOrNormalPropertyOnObject2(removed: Boolean): String = if (removed) A().removedProperty2 else A().property2
|
||||
|
||||
@Suppress("NOTHING_TO_INLINE") inline fun callInlinedRemovedFunction() = removedFunction()
|
||||
@Suppress("NOTHING_TO_INLINE") inline fun readInlinedRemovedProperty() = removedProperty
|
||||
|
||||
class C2 : C() {
|
||||
override fun removedOpenFunction(): String = "O" // does not call super
|
||||
override val removedOpenProperty: String get() = "O" // does not call super
|
||||
}
|
||||
|
||||
class I2 : I {
|
||||
override fun removedOpenFunction(): String = "K" // does not call super
|
||||
override val removedOpenProperty: String get() = "K" // does not call super
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib, lib1
|
||||
@@ -0,0 +1,21 @@
|
||||
import abitestutils.abiTest
|
||||
|
||||
fun box() = abiTest {
|
||||
expectFailure(linkage("Function 'removedFunction' can not be called: No function found for symbol '/removedFunction'")) { callRemovedOrNormalFunction(removed = true) }
|
||||
expectSuccess { callRemovedOrNormalFunction(removed = false) }
|
||||
expectFailure(linkage("Function 'removedFunction' can not be called: No function found for symbol '/A.removedFunction'")) { callRemovedOrNormalFunctionOnObject(removed = true) }
|
||||
expectSuccess { callRemovedOrNormalFunctionOnObject(removed = false) }
|
||||
|
||||
expectFailure(linkage("Property accessor 'removedProperty.<get-removedProperty>' can not be called: No property accessor found for symbol '/removedProperty.<get-removedProperty>'")) { readRemovedOrNormalProperty(removed = true) }
|
||||
expectSuccess { readRemovedOrNormalProperty(removed = false) }
|
||||
expectFailure(linkage("Property accessor 'removedProperty1.<get-removedProperty1>' can not be called: No property accessor found for symbol '/A.removedProperty1.<get-removedProperty1>'")) { readRemovedOrNormalPropertyOnObject1(removed = true) }
|
||||
expectSuccess { readRemovedOrNormalPropertyOnObject1(removed = false) }
|
||||
expectFailure(linkage("Property accessor 'removedProperty2.<get-removedProperty2>' can not be called: No property accessor found for symbol '/A.removedProperty2.<get-removedProperty2>'")) { readRemovedOrNormalPropertyOnObject2(removed = true) }
|
||||
expectSuccess { readRemovedOrNormalPropertyOnObject2(removed = false) }
|
||||
|
||||
expectFailure(linkage("Function 'removedFunction' can not be called: No function found for symbol '/removedFunction'")) { callInlinedRemovedFunction() }
|
||||
expectFailure(linkage("Property accessor 'removedProperty.<get-removedProperty>' can not be called: No property accessor found for symbol '/removedProperty.<get-removedProperty>'")) { readInlinedRemovedProperty() }
|
||||
|
||||
expectSuccess { C2().removedOpenFunction() + I2().removedOpenFunction() }
|
||||
expectSuccess { C2().removedOpenProperty + I2().removedOpenProperty }
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib, lib1, lib2
|
||||
@@ -0,0 +1,7 @@
|
||||
MODULES: lib1, lib2, main
|
||||
|
||||
STEP 0:
|
||||
libs: lib1, lib2, main
|
||||
|
||||
STEP 1:
|
||||
libs: lib1
|
||||
Reference in New Issue
Block a user