Skip to content

Commit

Permalink
[box-tests] Added a reproducer for #KT-64139
Browse files Browse the repository at this point in the history
  • Loading branch information
homuroll authored and qodana-bot committed Dec 19, 2023
1 parent 9c7aac2 commit 204cecd
Show file tree
Hide file tree
Showing 17 changed files with 128 additions and 0 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions compiler/testData/codegen/box/coroutines/varSpilling/kt64139.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// WITH_STDLIB
// WITH_COROUTINES
import helpers.*
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*

suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x ->
x.resume(Unit)
COROUTINE_SUSPENDED
}

fun builder(c: suspend () -> Unit) {
c.startCoroutine(EmptyContinuation)
}

class Data(val x: Int)

fun box(): String {
var result = ""

builder {
var data = Data(0)
var done = false
do {
data = Data(1)
suspendHere()
done = true
} while (!done)
result = if (data.x == 1) "OK" else "fail"
}

return result
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 204cecd

Please sign in to comment.