Minor. Make test actually suspend and add a test without suspension
This commit is contained in:
+12
@@ -10328,6 +10328,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
|||||||
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/invokeOperator.kt");
|
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/invokeOperator.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("multifileBridge.kt")
|
||||||
|
public void testMultifileBridge() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/multifileBridge.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("overrideSuspendFun.kt")
|
@TestMetadata("overrideSuspendFun.kt")
|
||||||
public void testOverrideSuspendFun() throws Exception {
|
public void testOverrideSuspendFun() throws Exception {
|
||||||
@@ -10363,6 +10369,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
|||||||
public void testReturnResult() throws Exception {
|
public void testReturnResult() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/returnResult.kt");
|
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/returnResult.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("syntheticAccessor.kt")
|
||||||
|
public void testSyntheticAccessor() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/syntheticAccessor.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
|
|||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
// TARGET_BACKEND: JVM
|
||||||
|
// WITH_RUNTIME
|
||||||
|
// WITH_COROUTINES
|
||||||
|
// FILE: a.kt
|
||||||
|
@file:JvmMultifileClass
|
||||||
|
@file:JvmName("A")
|
||||||
|
|
||||||
|
import kotlin.coroutines.*
|
||||||
|
import kotlin.coroutines.intrinsics.*
|
||||||
|
|
||||||
|
@Suppress("UNSUPPORTED_FEATURE")
|
||||||
|
inline class I(val x: Any?)
|
||||||
|
|
||||||
|
suspend fun <T> suspendHere(t: T): T = t
|
||||||
|
|
||||||
|
suspend fun f(): I = I(suspendHere("OK"))
|
||||||
|
|
||||||
|
// FILE: z.kt
|
||||||
|
import helpers.*
|
||||||
|
import kotlin.coroutines.*
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
var result = "fail"
|
||||||
|
suspend { result = f().x as String }.startCoroutine(EmptyContinuation)
|
||||||
|
return result
|
||||||
|
}
|
||||||
+27
@@ -0,0 +1,27 @@
|
|||||||
|
// WITH_RUNTIME
|
||||||
|
// WITH_COROUTINES
|
||||||
|
// IGNORE_BACKEND: JS_IR
|
||||||
|
|
||||||
|
import helpers.*
|
||||||
|
import kotlin.coroutines.*
|
||||||
|
import kotlin.coroutines.intrinsics.*
|
||||||
|
|
||||||
|
@Suppress("UNSUPPORTED_FEATURE")
|
||||||
|
inline class I(val x: Any?)
|
||||||
|
|
||||||
|
class C {
|
||||||
|
private suspend fun f(): I {
|
||||||
|
return I("OK")
|
||||||
|
}
|
||||||
|
|
||||||
|
fun g() = suspend { f() }
|
||||||
|
}
|
||||||
|
|
||||||
|
val c: Continuation<Unit>? = null
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
var result = "fail"
|
||||||
|
suspend { result = C().g()().x as String }.startCoroutine(EmptyContinuation)
|
||||||
|
|
||||||
|
return result
|
||||||
|
}
|
||||||
+7
-4
@@ -1,4 +1,4 @@
|
|||||||
// TARGET_PLATFORM: JVM
|
// TARGET_BACKEND: JVM
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
// WITH_COROUTINES
|
// WITH_COROUTINES
|
||||||
// FILE: a.kt
|
// FILE: a.kt
|
||||||
@@ -11,12 +11,14 @@ import kotlin.coroutines.intrinsics.*
|
|||||||
@Suppress("UNSUPPORTED_FEATURE")
|
@Suppress("UNSUPPORTED_FEATURE")
|
||||||
inline class I(val x: Any?)
|
inline class I(val x: Any?)
|
||||||
|
|
||||||
suspend fun <T> suspendHere(x: T): T = suspendCoroutineUninterceptedOrReturn {
|
suspend fun <T> suspendHere(): T = suspendCoroutineUninterceptedOrReturn {
|
||||||
it.resume(x)
|
c = it as Continuation<Any?>
|
||||||
COROUTINE_SUSPENDED
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun f(): I = I(suspendHere("OK"))
|
var c: Continuation<Any?>? = null
|
||||||
|
|
||||||
|
suspend fun f(): I = I(suspendHere<String>())
|
||||||
|
|
||||||
// FILE: z.kt
|
// FILE: z.kt
|
||||||
import helpers.*
|
import helpers.*
|
||||||
@@ -25,5 +27,6 @@ import kotlin.coroutines.*
|
|||||||
fun box(): String {
|
fun box(): String {
|
||||||
var result = "fail"
|
var result = "fail"
|
||||||
suspend { result = f().x as String }.startCoroutine(EmptyContinuation)
|
suspend { result = f().x as String }.startCoroutine(EmptyContinuation)
|
||||||
|
c?.resume("OK")
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-3
@@ -8,13 +8,15 @@ import kotlin.coroutines.intrinsics.*
|
|||||||
@Suppress("UNSUPPORTED_FEATURE")
|
@Suppress("UNSUPPORTED_FEATURE")
|
||||||
inline class I(val x: Any?)
|
inline class I(val x: Any?)
|
||||||
|
|
||||||
suspend fun <T> suspendHere(x: T): T = suspendCoroutineUninterceptedOrReturn {
|
suspend fun <T> suspendHere(): T = suspendCoroutineUninterceptedOrReturn {
|
||||||
it.resume(x)
|
c = it as Continuation<Any?>
|
||||||
COROUTINE_SUSPENDED
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var c: Continuation<Any?>? = null
|
||||||
|
|
||||||
class C {
|
class C {
|
||||||
private suspend fun f(): I = I(suspendHere("OK"))
|
private suspend fun f(): I = I(suspendHere<String>())
|
||||||
|
|
||||||
fun g() = suspend { f() }
|
fun g() = suspend { f() }
|
||||||
}
|
}
|
||||||
@@ -22,5 +24,7 @@ class C {
|
|||||||
fun box(): String {
|
fun box(): String {
|
||||||
var result = "fail"
|
var result = "fail"
|
||||||
suspend { result = C().g()().x as String }.startCoroutine(EmptyContinuation)
|
suspend { result = C().g()().x as String }.startCoroutine(EmptyContinuation)
|
||||||
|
|
||||||
|
c?.resume("OK")
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|||||||
+12
@@ -10328,6 +10328,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/invokeOperator.kt");
|
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/invokeOperator.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("multifileBridge.kt")
|
||||||
|
public void testMultifileBridge() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/multifileBridge.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("overrideSuspendFun.kt")
|
@TestMetadata("overrideSuspendFun.kt")
|
||||||
public void testOverrideSuspendFun() throws Exception {
|
public void testOverrideSuspendFun() throws Exception {
|
||||||
@@ -10363,6 +10369,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
public void testReturnResult() throws Exception {
|
public void testReturnResult() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/returnResult.kt");
|
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/returnResult.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("syntheticAccessor.kt")
|
||||||
|
public void testSyntheticAccessor() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/syntheticAccessor.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
|
|||||||
+12
@@ -10328,6 +10328,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/invokeOperator.kt");
|
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/invokeOperator.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("multifileBridge.kt")
|
||||||
|
public void testMultifileBridge() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/multifileBridge.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("overrideSuspendFun.kt")
|
@TestMetadata("overrideSuspendFun.kt")
|
||||||
public void testOverrideSuspendFun() throws Exception {
|
public void testOverrideSuspendFun() throws Exception {
|
||||||
@@ -10363,6 +10369,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
public void testReturnResult() throws Exception {
|
public void testReturnResult() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/returnResult.kt");
|
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/returnResult.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("syntheticAccessor.kt")
|
||||||
|
public void testSyntheticAccessor() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/syntheticAccessor.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
|
|||||||
+10
@@ -8181,6 +8181,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/invokeOperator.kt");
|
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/invokeOperator.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("multifileBridge.kt")
|
||||||
|
public void testMultifileBridge() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/multifileBridge.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("overrideSuspendFun.kt")
|
@TestMetadata("overrideSuspendFun.kt")
|
||||||
public void testOverrideSuspendFun() throws Exception {
|
public void testOverrideSuspendFun() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/overrideSuspendFun.kt");
|
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/overrideSuspendFun.kt");
|
||||||
@@ -8210,6 +8215,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
public void testReturnResult() throws Exception {
|
public void testReturnResult() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/returnResult.kt");
|
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/returnResult.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("syntheticAccessor.kt")
|
||||||
|
public void testSyntheticAccessor() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/syntheticAccessor.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/coroutines/inlineClasses/resume")
|
@TestMetadata("compiler/testData/codegen/box/coroutines/inlineClasses/resume")
|
||||||
|
|||||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java
Generated
+5
@@ -7354,6 +7354,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
|||||||
public void testReturnResult() throws Exception {
|
public void testReturnResult() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/returnResult.kt");
|
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/returnResult.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("syntheticAccessor.kt")
|
||||||
|
public void testSyntheticAccessor() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/syntheticAccessor.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/coroutines/inlineClasses/resume")
|
@TestMetadata("compiler/testData/codegen/box/coroutines/inlineClasses/resume")
|
||||||
|
|||||||
Generated
+5
@@ -6765,6 +6765,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
|||||||
public void testReturnResult() throws Exception {
|
public void testReturnResult() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/returnResult.kt");
|
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/returnResult.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("syntheticAccessor.kt")
|
||||||
|
public void testSyntheticAccessor() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/syntheticAccessor.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/coroutines/inlineClasses/resume")
|
@TestMetadata("compiler/testData/codegen/box/coroutines/inlineClasses/resume")
|
||||||
|
|||||||
Generated
+5
@@ -6765,6 +6765,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
|||||||
public void testReturnResult() throws Exception {
|
public void testReturnResult() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/returnResult.kt");
|
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/returnResult.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("syntheticAccessor.kt")
|
||||||
|
public void testSyntheticAccessor() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/syntheticAccessor.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/coroutines/inlineClasses/resume")
|
@TestMetadata("compiler/testData/codegen/box/coroutines/inlineClasses/resume")
|
||||||
|
|||||||
Reference in New Issue
Block a user