Fix issue #KT-24475

* count coroutine metadata references during RemoveUnusedImport pass in JsInliner
* add cases to test usage of stdlib symbols in inlined functions
This commit is contained in:
Roman Artemev
2018-07-17 19:26:05 +03:00
committed by Roman Artemev
parent 75c7045ea7
commit 14b1f0ef6a
12 changed files with 149 additions and 6 deletions
@@ -4599,6 +4599,11 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
runTest("js/js.translator/testData/box/inlineMultiModule/importObjectInstance.kt");
}
@TestMetadata("importStdLib.kt")
public void testImportStdLib() throws Exception {
runTest("js/js.translator/testData/box/inlineMultiModule/importStdLib.kt");
}
@TestMetadata("inlineInInlineWithLambdaMultiModule.kt")
public void testInlineInInlineWithLambdaMultiModule() throws Exception {
runTest("js/js.translator/testData/box/inlineMultiModule/inlineInInlineWithLambdaMultiModule.kt");
@@ -4599,6 +4599,11 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest {
runTest("js/js.translator/testData/box/inlineMultiModule/importObjectInstance.kt");
}
@TestMetadata("importStdLib.kt")
public void testImportStdLib() throws Exception {
runTest("js/js.translator/testData/box/inlineMultiModule/importStdLib.kt");
}
@TestMetadata("inlineInInlineWithLambdaMultiModule.kt")
public void testInlineInInlineWithLambdaMultiModule() throws Exception {
runTest("js/js.translator/testData/box/inlineMultiModule/inlineInInlineWithLambdaMultiModule.kt");
@@ -5963,6 +5963,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/multiModule"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true);
}
@TestMetadata("inlineCrossModule.kt")
public void testInlineCrossModule_1_2() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineCrossModule.kt", "kotlin.coroutines.experimental");
}
@TestMetadata("inlineFunctionWithOptionalParam.kt")
public void testInlineFunctionWithOptionalParam_1_2() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineFunctionWithOptionalParam.kt", "kotlin.coroutines.experimental");
@@ -6738,6 +6738,16 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/multiModule"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true);
}
@TestMetadata("inlineCrossModule.kt")
public void testInlineCrossModule_1_2() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineCrossModule.kt", "kotlin.coroutines.experimental");
}
@TestMetadata("inlineCrossModule.kt")
public void testInlineCrossModule_1_3() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineCrossModule.kt", "kotlin.coroutines");
}
@TestMetadata("inlineFunctionWithOptionalParam.kt")
public void testInlineFunctionWithOptionalParam_1_2() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/multiModule/inlineFunctionWithOptionalParam.kt", "kotlin.coroutines.experimental");