Add test for default lambda inlining in suspend inline

This commit is contained in:
Mikhael Bogdanov
2019-11-20 12:39:44 +01:00
parent a92afc5a89
commit d28ec1d449
7 changed files with 83 additions and 0 deletions
@@ -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
}
@@ -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");
@@ -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");
@@ -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");
@@ -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");
@@ -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");
@@ -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");