[IR][tests] Removal of inlined class case
^KT-52478
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
open class Foo
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
//open class Foo
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
STEP 0:
|
||||||
|
dependencies: stdlib
|
||||||
|
STEP 1:
|
||||||
|
dependencies: stdlib
|
||||||
|
modifications:
|
||||||
|
U : l1.kt.1 -> l1.kt
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
class Bar : Foo()
|
||||||
|
|
||||||
|
inline fun fooVariableType() {
|
||||||
|
val foo: Foo? = null
|
||||||
|
check(foo == null)
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fun barVariableType() {
|
||||||
|
val bar: Bar? = null
|
||||||
|
check(bar == null)
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fun fooInstance() {
|
||||||
|
check(Foo().toString() != "Qux")
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fun barInstance() {
|
||||||
|
check(Bar().toString() != "Qux")
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fun fooInstance2() {
|
||||||
|
check(run(::Foo).toString() != "Qux")
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fun barInstance2() {
|
||||||
|
check(run(::Bar).toString() != "Qux")
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fun fooAnonymousObject() {
|
||||||
|
val foo = object : Foo() {}
|
||||||
|
check(foo == null)
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
STEP 0:
|
||||||
|
dependencies: stdlib, lib1
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
fun box(): String {
|
||||||
|
try {
|
||||||
|
fooVariableType()
|
||||||
|
return "FAIL1"
|
||||||
|
} catch (e: Throwable) {
|
||||||
|
if (!e.isUnlinkedTypeOfExpression()) return "FAIL2"
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
barVariableType()
|
||||||
|
return "FAIL3"
|
||||||
|
} catch (e: Throwable) {
|
||||||
|
if (!e.isUnlinkedTypeOfExpression()) return "FAIL4"
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
fooInstance()
|
||||||
|
return "FAIL5"
|
||||||
|
} catch(e: Throwable) {
|
||||||
|
if (!e.isUnlinkedSymbolLinkageError("/Foo.<init>")) return "FAIL6"
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
barInstance()
|
||||||
|
return "FAIL7"
|
||||||
|
} catch(e: Throwable) {
|
||||||
|
if (!e.isUnlinkedTypeInSignature("/Bar.<init>")) return "FAIL8"
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
fooInstance2()
|
||||||
|
return "FAIL9"
|
||||||
|
} catch(e: Throwable) {
|
||||||
|
if (!e.isUnlinkedSymbolLinkageError("/Foo.<init>")) return "FAIL10"
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
barInstance2()
|
||||||
|
return "FAIL11"
|
||||||
|
} catch(e: Throwable) {
|
||||||
|
if (!e.isUnlinkedTypeInSignature("/Bar.<init>")) return "FAIL12"
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
fooAnonymousObject()
|
||||||
|
return "FAIL13"
|
||||||
|
} catch(e: Throwable) {
|
||||||
|
if (!e.isUnlinkedTypeOfExpression()) return "FAIL14"
|
||||||
|
}
|
||||||
|
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun Throwable.isUnlinkedTypeOfExpression(): Boolean =
|
||||||
|
this::class.simpleName == "IrLinkageError" && message == "Unlinked type of IR expression"
|
||||||
|
|
||||||
|
private fun Throwable.isUnlinkedSymbolLinkageError(symbolName: String): Boolean =
|
||||||
|
this::class.simpleName == "IrLinkageError" && message?.startsWith("Unlinked IR symbol $symbolName|") == true
|
||||||
|
|
||||||
|
private fun Throwable.isUnlinkedTypeInSignature(symbolName: String): Boolean =
|
||||||
|
this::class.simpleName == "IrLinkageError" && message?.startsWith("Unlinked type in signature of IR symbol $symbolName|") == true
|
||||||
@@ -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
|
||||||
+5
@@ -75,6 +75,11 @@ public class JsKLibABITestCaseGenerated extends AbstractJsKLibABITestCase {
|
|||||||
runTest("compiler/testData/klibABI/removeFunction/");
|
runTest("compiler/testData/klibABI/removeFunction/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("removeInlinedClass")
|
||||||
|
public void testRemoveInlinedClass() throws Exception {
|
||||||
|
runTest("compiler/testData/klibABI/removeInlinedClass/");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("removeInlinedFunction")
|
@TestMetadata("removeInlinedFunction")
|
||||||
public void testRemoveInlinedFunction() throws Exception {
|
public void testRemoveInlinedFunction() throws Exception {
|
||||||
runTest("compiler/testData/klibABI/removeInlinedFunction/");
|
runTest("compiler/testData/klibABI/removeInlinedFunction/");
|
||||||
|
|||||||
Generated
+6
@@ -78,6 +78,12 @@ public class KlibABITestGenerated extends AbstractNativeKlibABITest {
|
|||||||
runTest("compiler/testData/klibABI/removeFunction/");
|
runTest("compiler/testData/klibABI/removeFunction/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("removeInlinedClass")
|
||||||
|
public void testRemoveInlinedClass() throws Exception {
|
||||||
|
runTest("compiler/testData/klibABI/removeInlinedClass/");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("removeInlinedFunction")
|
@TestMetadata("removeInlinedFunction")
|
||||||
public void testRemoveInlinedFunction() throws Exception {
|
public void testRemoveInlinedFunction() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user