[IR][tests] Add tests for removal-of-typealias case
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
typealias S = String
|
||||
|
||||
fun foo(s : S) = s
|
||||
@@ -0,0 +1,3 @@
|
||||
typealias S = Int
|
||||
|
||||
fun foo(s : S) = s.toString()
|
||||
@@ -0,0 +1,6 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib
|
||||
STEP 1:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.kt.1 -> l1.kt
|
||||
@@ -0,0 +1,8 @@
|
||||
fun bar(): String {
|
||||
val s: S = "OK"
|
||||
return s
|
||||
}
|
||||
|
||||
fun callFoo() {
|
||||
foo("Hello")
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib, lib1
|
||||
@@ -0,0 +1,13 @@
|
||||
fun box(): String {
|
||||
try {
|
||||
callFoo()
|
||||
return "FAIL1"
|
||||
} catch(e: Throwable) {
|
||||
if (!e.isLinkageError("/foo")) return "FAIL2"
|
||||
}
|
||||
|
||||
return bar()
|
||||
}
|
||||
|
||||
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
|
||||
+5
@@ -99,4 +99,9 @@ public class JsKLibABITestCaseGenerated extends AbstractJsKLibABITestCase {
|
||||
public void testRemoveProperty() throws Exception {
|
||||
runTest("compiler/testData/klibABI/removeProperty/");
|
||||
}
|
||||
|
||||
@TestMetadata("typeAliasRHSTypeChange")
|
||||
public void testTypeAliasRHSTypeChange() throws Exception {
|
||||
runTest("compiler/testData/klibABI/typeAliasRHSTypeChange/");
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+6
@@ -107,4 +107,10 @@ public class KlibABITestGenerated extends AbstractNativeKlibABITest {
|
||||
public void testRemoveProperty() throws Exception {
|
||||
runTest("compiler/testData/klibABI/removeProperty/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typeAliasRHSTypeChange")
|
||||
public void testTypeAliasRHSTypeChange() throws Exception {
|
||||
runTest("compiler/testData/klibABI/typeAliasRHSTypeChange/");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user