Port test from K/N
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// COMMON_COROUTINES_TEST
|
||||
|
||||
import helpers.*
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
suspend fun suspendHere(): String {
|
||||
var z = "fail1"
|
||||
suspendCoroutineUninterceptedOrReturn<Unit> { x ->
|
||||
z = "OK"
|
||||
x.resume(Unit)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
return z
|
||||
}
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var result = "fail2"
|
||||
|
||||
builder {
|
||||
result = suspendHere()
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
+10
@@ -5435,6 +5435,16 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/beginWithException.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("capturedVarInSuspendLambda.kt")
|
||||
public void testCapturedVarInSuspendLambda_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/capturedVarInSuspendLambda.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("capturedVarInSuspendLambda.kt")
|
||||
public void testCapturedVarInSuspendLambda_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/capturedVarInSuspendLambda.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("catchWithInlineInsideSuspend.kt")
|
||||
public void testCatchWithInlineInsideSuspend_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/catchWithInlineInsideSuspend.kt", "kotlin.coroutines.experimental");
|
||||
|
||||
+10
@@ -5435,6 +5435,16 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/beginWithException.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("capturedVarInSuspendLambda.kt")
|
||||
public void testCapturedVarInSuspendLambda_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/capturedVarInSuspendLambda.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("capturedVarInSuspendLambda.kt")
|
||||
public void testCapturedVarInSuspendLambda_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/capturedVarInSuspendLambda.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("catchWithInlineInsideSuspend.kt")
|
||||
public void testCatchWithInlineInsideSuspend_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/catchWithInlineInsideSuspend.kt", "kotlin.coroutines.experimental");
|
||||
|
||||
+10
@@ -5435,6 +5435,16 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/beginWithException.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("capturedVarInSuspendLambda.kt")
|
||||
public void testCapturedVarInSuspendLambda_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/capturedVarInSuspendLambda.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("capturedVarInSuspendLambda.kt")
|
||||
public void testCapturedVarInSuspendLambda_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/capturedVarInSuspendLambda.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("catchWithInlineInsideSuspend.kt")
|
||||
public void testCatchWithInlineInsideSuspend_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/catchWithInlineInsideSuspend.kt", "kotlin.coroutines.experimental");
|
||||
|
||||
+5
@@ -5115,6 +5115,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/beginWithException.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("capturedVarInSuspendLambda.kt")
|
||||
public void testCapturedVarInSuspendLambda_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/capturedVarInSuspendLambda.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("catchWithInlineInsideSuspend.kt")
|
||||
public void testCatchWithInlineInsideSuspend_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/catchWithInlineInsideSuspend.kt", "kotlin.coroutines");
|
||||
|
||||
+10
@@ -5185,6 +5185,16 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/beginWithException.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("capturedVarInSuspendLambda.kt")
|
||||
public void testCapturedVarInSuspendLambda_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/capturedVarInSuspendLambda.kt", "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("capturedVarInSuspendLambda.kt")
|
||||
public void testCapturedVarInSuspendLambda_1_3() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/capturedVarInSuspendLambda.kt", "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("catchWithInlineInsideSuspend.kt")
|
||||
public void testCatchWithInlineInsideSuspend_1_2() throws Exception {
|
||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/catchWithInlineInsideSuspend.kt", "kotlin.coroutines.experimental");
|
||||
|
||||
Reference in New Issue
Block a user