[IR][tests] Add tests for removal-of-overridden open callable case

This commit is contained in:
Dmitriy Dolovov
2022-06-07 00:06:03 +03:00
parent 846537b367
commit 9c1c712057
18 changed files with 94 additions and 0 deletions
@@ -0,0 +1,7 @@
open class C {
open fun foo(): String = "FAIL1"
}
interface I {
fun foo(): String = "FAIL2"
}
@@ -0,0 +1,2 @@
open class C
interface I
@@ -0,0 +1,6 @@
STEP 0:
dependencies: stdlib
STEP 1:
dependencies: stdlib
modifications:
U : l1.kt.1 -> l1.kt
@@ -0,0 +1,7 @@
class C2 : C() {
override fun foo(): String = "O" // does not call super
}
class I2 : I {
override fun foo(): String = "K" // does not call super
}
@@ -0,0 +1,2 @@
STEP 0:
dependencies: stdlib, lib1
@@ -0,0 +1,3 @@
fun box(): String {
return C2().foo() + I2().foo()
}
@@ -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
@@ -0,0 +1,7 @@
open class C {
open val foo: String get() = "FAIL1"
}
interface I {
val foo: String get() = "FAIL2"
}
@@ -0,0 +1,2 @@
open class C
interface I
@@ -0,0 +1,6 @@
STEP 0:
dependencies: stdlib
STEP 1:
dependencies: stdlib
modifications:
U : l1.kt.1 -> l1.kt
@@ -0,0 +1,7 @@
class C2 : C() {
override val foo: String get() = "O" // does not call super
}
class I2 : I {
override val foo: String get() = "K" // does not call super
}
@@ -0,0 +1,2 @@
STEP 0:
dependencies: stdlib, lib1
@@ -0,0 +1,3 @@
fun box(): String {
return C2().foo + I2().foo
}
@@ -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
@@ -75,6 +75,16 @@ public class JsKLibABITestCaseGenerated extends AbstractJsKLibABITestCase {
runTest("compiler/testData/klibABI/removeFunction/");
}
@TestMetadata("removeOpenFunction")
public void testRemoveOpenFunction() throws Exception {
runTest("compiler/testData/klibABI/removeOpenFunction/");
}
@TestMetadata("removeOpenProperty")
public void testRemoveOpenProperty() throws Exception {
runTest("compiler/testData/klibABI/removeOpenProperty/");
}
@TestMetadata("removeProperty")
public void testRemoveProperty() throws Exception {
runTest("compiler/testData/klibABI/removeProperty/");
@@ -78,6 +78,18 @@ public class KlibABITestGenerated extends AbstractNativeKlibABITest {
runTest("compiler/testData/klibABI/removeFunction/");
}
@Test
@TestMetadata("removeOpenFunction")
public void testRemoveOpenFunction() throws Exception {
runTest("compiler/testData/klibABI/removeOpenFunction/");
}
@Test
@TestMetadata("removeOpenProperty")
public void testRemoveOpenProperty() throws Exception {
runTest("compiler/testData/klibABI/removeOpenProperty/");
}
@Test
@TestMetadata("removeProperty")
public void testRemoveProperty() throws Exception {