[tests] Added a test for KT-55494
This commit is contained in:
+6
@@ -10489,6 +10489,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/coroutines/kt52561.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt55494.kt")
|
||||
public void testKt55494() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/kt55494.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lastExpressionIsLoop.kt")
|
||||
public void testLastExpressionIsLoop() throws Exception {
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
// WITH_STDLIB
|
||||
// WITH_COROUTINES
|
||||
|
||||
// FILE: t1.kt
|
||||
import kotlin.coroutines.intrinsics.COROUTINE_SUSPENDED
|
||||
import kotlin.coroutines.intrinsics.suspendCoroutineUninterceptedOrReturn
|
||||
import kotlin.coroutines.*
|
||||
|
||||
private suspend fun suspendHere(): Int = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(42)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
suspend fun foo() = suspendHere() + suspendHere()
|
||||
|
||||
// FILE: t2.kt
|
||||
import kotlin.coroutines.intrinsics.COROUTINE_SUSPENDED
|
||||
import kotlin.coroutines.intrinsics.suspendCoroutineUninterceptedOrReturn
|
||||
import kotlin.coroutines.*
|
||||
|
||||
private suspend fun suspendHere(): Int = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(42)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
suspend fun foo(x: Int) = suspendHere() - x
|
||||
|
||||
// FILE: main.kt
|
||||
import helpers.*
|
||||
|
||||
import kotlin.coroutines.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var result = 0
|
||||
|
||||
builder {
|
||||
result += foo()
|
||||
result += foo(9)
|
||||
}
|
||||
|
||||
return if (result == 117) "OK" else "fail"
|
||||
}
|
||||
+6
@@ -10285,6 +10285,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/coroutines/kt52561.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt55494.kt")
|
||||
public void testKt55494() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/kt55494.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lastExpressionIsLoop.kt")
|
||||
public void testLastExpressionIsLoop() throws Exception {
|
||||
|
||||
+6
@@ -10489,6 +10489,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/coroutines/kt52561.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt55494.kt")
|
||||
public void testKt55494() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/kt55494.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lastExpressionIsLoop.kt")
|
||||
public void testLastExpressionIsLoop() throws Exception {
|
||||
|
||||
+5
@@ -8092,6 +8092,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/coroutines/kt52561.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt55494.kt")
|
||||
public void testKt55494() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/kt55494.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("lastExpressionIsLoop.kt")
|
||||
public void testLastExpressionIsLoop() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt");
|
||||
|
||||
+6
@@ -7269,6 +7269,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/coroutines/kt52561.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt55494.kt")
|
||||
public void testKt55494() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/kt55494.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lastExpressionIsLoop.kt")
|
||||
public void testLastExpressionIsLoop() throws Exception {
|
||||
|
||||
+6
@@ -7365,6 +7365,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/coroutines/kt52561.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt55494.kt")
|
||||
public void testKt55494() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/kt55494.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lastExpressionIsLoop.kt")
|
||||
public void testLastExpressionIsLoop() throws Exception {
|
||||
|
||||
+6
@@ -7365,6 +7365,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/coroutines/kt52561.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt55494.kt")
|
||||
public void testKt55494() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/kt55494.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lastExpressionIsLoop.kt")
|
||||
public void testLastExpressionIsLoop() throws Exception {
|
||||
|
||||
+5
@@ -6477,6 +6477,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
||||
runTest("compiler/testData/codegen/box/coroutines/kt52561.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt55494.kt")
|
||||
public void testKt55494() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/kt55494.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("lastExpressionIsLoop.kt")
|
||||
public void testLastExpressionIsLoop() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt");
|
||||
|
||||
+6
@@ -8227,6 +8227,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
|
||||
runTest("compiler/testData/codegen/box/coroutines/kt52561.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt55494.kt")
|
||||
public void testKt55494() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/coroutines/kt55494.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lastExpressionIsLoop.kt")
|
||||
public void testLastExpressionIsLoop() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user