JVM_IR: mark direct uses of inline lambdas as conditionally suspend

They may or may not be inlined later.

IDK how the test passes when both modules are compiled with the old
backend - perhaps this has something to do with the fact that when `f`
is compiled with the IR backend, the call to `x()` is followed by `pop`
and `getstatic kotlin/Unit.INSTANCE`? This is probably why the original
issue in kotlinx.coroutines reports that everything works fine with
kotlinx-coroutines-core:1.4.3.

^KT-46879 Fixed
^KT-48801 Fixed
This commit is contained in:
pyos
2021-09-20 11:31:33 +02:00
committed by Ilmir Usmanov
parent 41a69ad388
commit f786084a0a
14 changed files with 95 additions and 4 deletions
@@ -3936,6 +3936,11 @@ public class IrJsCodegenInlineES6TestGenerated extends AbstractIrJsCodegenInline
runTest("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfNoinlineSuspend.kt");
}
@TestMetadata("inlinePassthrough.kt")
public void testInlinePassthrough() throws Exception {
runTest("compiler/testData/codegen/boxInline/suspend/inlinePassthrough.kt");
}
@TestMetadata("inlineSuspendOfCrossinlineOrdinary.kt")
public void testInlineSuspendOfCrossinlineOrdinary() throws Exception {
runTest("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineOrdinary.kt");
@@ -3936,6 +3936,11 @@ public class IrJsCodegenInlineTestGenerated extends AbstractIrJsCodegenInlineTes
runTest("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfNoinlineSuspend.kt");
}
@TestMetadata("inlinePassthrough.kt")
public void testInlinePassthrough() throws Exception {
runTest("compiler/testData/codegen/boxInline/suspend/inlinePassthrough.kt");
}
@TestMetadata("inlineSuspendOfCrossinlineOrdinary.kt")
public void testInlineSuspendOfCrossinlineOrdinary() throws Exception {
runTest("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineOrdinary.kt");
@@ -3936,6 +3936,11 @@ public class JsCodegenInlineTestGenerated extends AbstractJsCodegenInlineTest {
runTest("compiler/testData/codegen/boxInline/suspend/inlineOrdinaryOfNoinlineSuspend.kt");
}
@TestMetadata("inlinePassthrough.kt")
public void testInlinePassthrough() throws Exception {
runTest("compiler/testData/codegen/boxInline/suspend/inlinePassthrough.kt");
}
@TestMetadata("inlineSuspendOfCrossinlineOrdinary.kt")
public void testInlineSuspendOfCrossinlineOrdinary() throws Exception {
runTest("compiler/testData/codegen/boxInline/suspend/inlineSuspendOfCrossinlineOrdinary.kt");