Add test for default lambda inlining in suspend inline
This commit is contained in:
+38
@@ -0,0 +1,38 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_MULTI_MODULE: JVM_IR
|
||||
// FILE: test.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
class Controller {
|
||||
var res = "FAIL 1"
|
||||
}
|
||||
|
||||
val defaultController = Controller()
|
||||
|
||||
suspend inline fun test(controller: Controller, c: () -> Unit = { controller.res = "OK" }) {
|
||||
c()
|
||||
}
|
||||
|
||||
// FILE: box.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
fun box() : String {
|
||||
builder() {
|
||||
test(defaultController)
|
||||
}
|
||||
return defaultController.res
|
||||
}
|
||||
+10
@@ -3792,6 +3792,16 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultValueInlineFromMultiFileFacade.kt")
|
||||
public void testDefaultValueInlineFromMultiFileFacade_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInlineFromMultiFileFacade.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultValueInlineFromMultiFileFacade.kt")
|
||||
public void testDefaultValueInlineFromMultiFileFacade_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInlineFromMultiFileFacade.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultValueInline.kt")
|
||||
public void testDefaultValueInline_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInline.kt", "kotlin.coroutines.experimental");
|
||||
|
||||
Generated
+10
@@ -3792,6 +3792,16 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultValueInlineFromMultiFileFacade.kt")
|
||||
public void testDefaultValueInlineFromMultiFileFacade_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInlineFromMultiFileFacade.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultValueInlineFromMultiFileFacade.kt")
|
||||
public void testDefaultValueInlineFromMultiFileFacade_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInlineFromMultiFileFacade.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultValueInline.kt")
|
||||
public void testDefaultValueInline_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInline.kt", "kotlin.coroutines.experimental");
|
||||
|
||||
+5
@@ -3697,6 +3697,11 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultValueInlineFromMultiFileFacade.kt")
|
||||
public void testDefaultValueInlineFromMultiFileFacade_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInlineFromMultiFileFacade.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultValueInline.kt")
|
||||
public void testDefaultValueInline_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInline.kt", "kotlin.coroutines");
|
||||
|
||||
Generated
+5
@@ -3697,6 +3697,11 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultValueInlineFromMultiFileFacade.kt")
|
||||
public void testDefaultValueInlineFromMultiFileFacade_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInlineFromMultiFileFacade.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultValueInline.kt")
|
||||
public void testDefaultValueInline_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInline.kt", "kotlin.coroutines");
|
||||
|
||||
Generated
+5
@@ -157,6 +157,11 @@ public class IrInlineSuspendTestsGenerated extends AbstractIrInlineSuspendTests
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultValueInlineFromMultiFileFacade.kt")
|
||||
public void testDefaultValueInlineFromMultiFileFacade_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInlineFromMultiFileFacade.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultValueInline.kt")
|
||||
public void testDefaultValueInline_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInline.kt", "kotlin.coroutines");
|
||||
|
||||
+10
@@ -242,6 +242,16 @@ public class InlineSuspendTestsGenerated extends AbstractInlineSuspendTests {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultValueInlineFromMultiFileFacade.kt")
|
||||
public void testDefaultValueInlineFromMultiFileFacade_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInlineFromMultiFileFacade.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultValueInlineFromMultiFileFacade.kt")
|
||||
public void testDefaultValueInlineFromMultiFileFacade_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInlineFromMultiFileFacade.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultValueInline.kt")
|
||||
public void testDefaultValueInline_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueInline.kt", "kotlin.coroutines.experimental");
|
||||
|
||||
Reference in New Issue
Block a user