[IR][tests] Add tests for removal-of-typealias case

This commit is contained in:
Dmitriy Dolovov
2022-06-07 00:27:38 +03:00
parent 89a188d199
commit 7b5e33b6ca
10 changed files with 55 additions and 0 deletions
@@ -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
@@ -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/");
}
}
@@ -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/");
}
}