Add tests for default inline suspend lambdas
Broken on JVM and JVM_IR
This commit is contained in:
+12
@@ -4935,6 +4935,18 @@ public class FirBlackBoxInlineCodegenTestGenerated extends AbstractFirBlackBoxIn
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/defaultParameter"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultInlineLambda.kt")
|
||||
public void testDefaultInlineLambda() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultInlineLambda.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultInlineReference.kt")
|
||||
public void testDefaultInlineReference() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultInlineReference.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultValueCrossinline.kt")
|
||||
public void testDefaultValueCrossinline() throws Exception {
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
// SKIP_INLINE_CHECK_IN: bar$default
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// IGNORE_BACKEND: JVM, JVM_IR
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// IGNORE_BACKEND_MULTI_MODULE: JVM, JVM_IR, JVM_MULTI_MODULE_OLD_AGAINST_IR, JVM_MULTI_MODULE_IR_AGAINST_OLD
|
||||
// FILE: 1.kt
|
||||
package test
|
||||
|
||||
inline fun bar(crossinline block: suspend (String) -> String = { it }): suspend () -> String =
|
||||
{ block("OK") }
|
||||
|
||||
// FILE: 2.kt
|
||||
import test.*
|
||||
import helpers.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
fun box(): String {
|
||||
var result = "fail"
|
||||
suspend {
|
||||
result = bar()()
|
||||
}.startCoroutine(EmptyContinuation)
|
||||
return result
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
// SKIP_INLINE_CHECK_IN: bar$default
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// IGNORE_BACKEND: JVM, JVM_IR
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// IGNORE_BACKEND_MULTI_MODULE: JVM, JVM_IR, JVM_MULTI_MODULE_OLD_AGAINST_IR, JVM_MULTI_MODULE_IR_AGAINST_OLD
|
||||
// FILE: 1.kt
|
||||
package test
|
||||
|
||||
suspend fun foo(x: String) = x
|
||||
|
||||
inline fun bar(crossinline block: suspend (String) -> String = ::foo): suspend () -> String =
|
||||
{ block("OK") }
|
||||
|
||||
// FILE: 2.kt
|
||||
import test.*
|
||||
import helpers.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
fun box(): String {
|
||||
var result = "fail"
|
||||
suspend {
|
||||
result = bar()()
|
||||
}.startCoroutine(EmptyContinuation)
|
||||
return result
|
||||
}
|
||||
+12
@@ -4935,6 +4935,18 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/defaultParameter"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultInlineLambda.kt")
|
||||
public void testDefaultInlineLambda() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultInlineLambda.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultInlineReference.kt")
|
||||
public void testDefaultInlineReference() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultInlineReference.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultValueCrossinline.kt")
|
||||
public void testDefaultValueCrossinline() throws Exception {
|
||||
|
||||
+12
@@ -4935,6 +4935,18 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/defaultParameter"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultInlineLambda.kt")
|
||||
public void testDefaultInlineLambda() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultInlineLambda.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultInlineReference.kt")
|
||||
public void testDefaultInlineReference() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultInlineReference.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultValueCrossinline.kt")
|
||||
public void testDefaultValueCrossinline() throws Exception {
|
||||
|
||||
+12
@@ -4935,6 +4935,18 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/defaultParameter"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultInlineLambda.kt")
|
||||
public void testDefaultInlineLambda() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultInlineLambda.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultInlineReference.kt")
|
||||
public void testDefaultInlineReference() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultInlineReference.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultValueCrossinline.kt")
|
||||
public void testDefaultValueCrossinline() throws Exception {
|
||||
|
||||
+12
@@ -4935,6 +4935,18 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/defaultParameter"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultInlineLambda.kt")
|
||||
public void testDefaultInlineLambda() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultInlineLambda.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultInlineReference.kt")
|
||||
public void testDefaultInlineReference() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultInlineReference.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultValueCrossinline.kt")
|
||||
public void testDefaultValueCrossinline() throws Exception {
|
||||
|
||||
+12
@@ -4935,6 +4935,18 @@ public class JvmIrAgainstOldBoxInlineTestGenerated extends AbstractJvmIrAgainstO
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/defaultParameter"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_MULTI_MODULE_IR_AGAINST_OLD, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultInlineLambda.kt")
|
||||
public void testDefaultInlineLambda() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultInlineLambda.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultInlineReference.kt")
|
||||
public void testDefaultInlineReference() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultInlineReference.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultValueCrossinline.kt")
|
||||
public void testDefaultValueCrossinline() throws Exception {
|
||||
|
||||
+12
@@ -4935,6 +4935,18 @@ public class JvmOldAgainstIrBoxInlineTestGenerated extends AbstractJvmOldAgainst
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/defaultParameter"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_MULTI_MODULE_OLD_AGAINST_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultInlineLambda.kt")
|
||||
public void testDefaultInlineLambda() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultInlineLambda.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultInlineReference.kt")
|
||||
public void testDefaultInlineReference() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultInlineReference.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultValueCrossinline.kt")
|
||||
public void testDefaultValueCrossinline() throws Exception {
|
||||
|
||||
+10
@@ -3947,6 +3947,16 @@ public class IrJsCodegenInlineES6TestGenerated extends AbstractIrJsCodegenInline
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/defaultParameter"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
|
||||
}
|
||||
|
||||
@TestMetadata("defaultInlineLambda.kt")
|
||||
public void testDefaultInlineLambda() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultInlineLambda.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultInlineReference.kt")
|
||||
public void testDefaultInlineReference() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultInlineReference.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultValueCrossinline.kt")
|
||||
public void testDefaultValueCrossinline() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt");
|
||||
|
||||
Generated
+10
@@ -3947,6 +3947,16 @@ public class IrJsCodegenInlineTestGenerated extends AbstractIrJsCodegenInlineTes
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/defaultParameter"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
|
||||
}
|
||||
|
||||
@TestMetadata("defaultInlineLambda.kt")
|
||||
public void testDefaultInlineLambda() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultInlineLambda.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultInlineReference.kt")
|
||||
public void testDefaultInlineReference() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultInlineReference.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultValueCrossinline.kt")
|
||||
public void testDefaultValueCrossinline() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt");
|
||||
|
||||
Generated
+10
@@ -3947,6 +3947,16 @@ public class JsCodegenInlineTestGenerated extends AbstractJsCodegenInlineTest {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/defaultParameter"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
|
||||
}
|
||||
|
||||
@TestMetadata("defaultInlineLambda.kt")
|
||||
public void testDefaultInlineLambda() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultInlineLambda.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultInlineReference.kt")
|
||||
public void testDefaultInlineReference() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultInlineReference.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultValueCrossinline.kt")
|
||||
public void testDefaultValueCrossinline() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/suspend/defaultParameter/defaultValueCrossinline.kt");
|
||||
|
||||
Reference in New Issue
Block a user