[IR][tests] Add tests for remove-inlined-callable member case
This commit is contained in:
@@ -0,0 +1 @@
|
||||
fun foo() = "FAIL1"
|
||||
@@ -0,0 +1 @@
|
||||
// fun foo() = "FAIL1"
|
||||
@@ -0,0 +1,6 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib
|
||||
STEP 1:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.kt.1 -> l1.kt
|
||||
@@ -0,0 +1 @@
|
||||
inline fun bar() = foo()
|
||||
@@ -0,0 +1,2 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib, lib1
|
||||
@@ -0,0 +1,12 @@
|
||||
fun box(): String {
|
||||
try {
|
||||
return bar()
|
||||
} catch(e: Throwable) {
|
||||
if (e.isLinkageError("/foo")) return "OK"
|
||||
}
|
||||
|
||||
return "FAIL2"
|
||||
}
|
||||
|
||||
private fun Throwable.isLinkageError(symbolName: String): Boolean =
|
||||
this::class.simpleName == "IrLinkageError" && message?.startsWith("Unlinked 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
|
||||
@@ -0,0 +1 @@
|
||||
val foo: String get() = "FAIL1"
|
||||
@@ -0,0 +1 @@
|
||||
// val foo: String get() = "FAIL1"
|
||||
@@ -0,0 +1,6 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib
|
||||
STEP 1:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.kt.1 -> l1.kt
|
||||
@@ -0,0 +1 @@
|
||||
inline fun bar() = foo
|
||||
@@ -0,0 +1,2 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib, lib1
|
||||
@@ -0,0 +1,12 @@
|
||||
fun box(): String {
|
||||
try {
|
||||
return bar()
|
||||
} catch(e: Throwable) {
|
||||
if (e.isLinkageError("/foo.<get-foo>")) return "OK"
|
||||
}
|
||||
|
||||
return "FAIL2"
|
||||
}
|
||||
|
||||
private fun Throwable.isLinkageError(symbolName: String): Boolean =
|
||||
this::class.simpleName == "IrLinkageError" && message?.startsWith("Unlinked 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
|
||||
+10
@@ -75,6 +75,16 @@ public class JsKLibABITestCaseGenerated extends AbstractJsKLibABITestCase {
|
||||
runTest("compiler/testData/klibABI/removeFunction/");
|
||||
}
|
||||
|
||||
@TestMetadata("removeInlinedFunction")
|
||||
public void testRemoveInlinedFunction() throws Exception {
|
||||
runTest("compiler/testData/klibABI/removeInlinedFunction/");
|
||||
}
|
||||
|
||||
@TestMetadata("removeInlinedProperty")
|
||||
public void testRemoveInlinedProperty() throws Exception {
|
||||
runTest("compiler/testData/klibABI/removeInlinedProperty/");
|
||||
}
|
||||
|
||||
@TestMetadata("removeOpenFunction")
|
||||
public void testRemoveOpenFunction() throws Exception {
|
||||
runTest("compiler/testData/klibABI/removeOpenFunction/");
|
||||
|
||||
Generated
+12
@@ -78,6 +78,18 @@ public class KlibABITestGenerated extends AbstractNativeKlibABITest {
|
||||
runTest("compiler/testData/klibABI/removeFunction/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("removeInlinedFunction")
|
||||
public void testRemoveInlinedFunction() throws Exception {
|
||||
runTest("compiler/testData/klibABI/removeInlinedFunction/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("removeInlinedProperty")
|
||||
public void testRemoveInlinedProperty() throws Exception {
|
||||
runTest("compiler/testData/klibABI/removeInlinedProperty/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("removeOpenFunction")
|
||||
public void testRemoveOpenFunction() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user