[IR][tests] Add tests for removal-of-abstract-fun IR linkage case

^KT-50771
This commit is contained in:
Dmitriy Dolovov
2022-04-25 14:55:36 +03:00
parent df909abaf5
commit 8e8ecc48ad
38 changed files with 320 additions and 0 deletions
@@ -0,0 +1,19 @@
import lib1.A
import lib2.B
fun box(): String {
val a: A = B()
try {
val answer: Int = a.foo() // <-- should throw linkage error here
println(answer)
} catch (e: Throwable) {
if (e.isLinkageError("lib2.B.foo")) return "OK"
}
return "FAIL"
}
private fun Throwable.isLinkageError(symbolName: String): Boolean =
this::class.simpleName == "IrLinkageError"
&& message == "Abstract function $symbolName is not implemented in non-abstract class ${symbolName.substringBeforeLast(".")}"
@@ -0,0 +1,2 @@
STEP 0:
dependencies: stdlib, lib1, lib2