Generate CHECKCAST Object inside the markers

otherwise, the unboxing interferes with bytecode analysis.
This commit is contained in:
Ilmir Usmanov
2020-09-03 21:10:47 +02:00
parent e8a451072e
commit 52f9569d33
16 changed files with 246 additions and 7 deletions
@@ -1,6 +1,5 @@
// WITH_RUNTIME
// WITH_COROUTINES
// IGNORE_BACKEND_FIR: JVM_IR
import helpers.*
import kotlin.coroutines.*
@@ -1,6 +1,6 @@
// WITH_RUNTIME
// WITH_COROUTINES
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JS_IR
import helpers.*
import kotlin.coroutines.*
@@ -1,5 +1,6 @@
// WITH_RUNTIME
// WITH_COROUTINES
// IGNORE_BACKEND: JS_IR
import helpers.*
import kotlin.coroutines.*
@@ -1,6 +1,6 @@
// WITH_RUNTIME
// WITH_COROUTINES
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JS_IR
import helpers.*
import kotlin.coroutines.*
@@ -1,5 +1,6 @@
// WITH_RUNTIME
// WITH_COROUTINES
// IGNORE_BACKEND: JS_IR
import helpers.*
import kotlin.coroutines.*
@@ -0,0 +1,30 @@
// WITH_RUNTIME
// WITH_COROUTINES
// FILE: inline.kt
inline class IC(val s: String)
suspend fun o(): IC = IC("O")
suspend fun k(): IC = IC("K")
inline suspend fun inlineMe(): String {
return o().s + k().s
}
// FILE: box.kt
import helpers.*
import kotlin.coroutines.*
fun builder(c: suspend () -> Unit) {
c.startCoroutine(EmptyContinuation)
}
fun box(): String {
var res = "FAIL"
builder {
res = inlineMe()
}
return res
}
@@ -0,0 +1,41 @@
// WITH_RUNTIME
// WITH_COROUTINES
// CHECK_STATE_MACHINE
// FILE: inline.kt
import helpers.*
inline class IC(val s: String)
suspend fun o(): IC {
StateMachineChecker.suspendHere()
return IC("O")
}
suspend fun k(): IC {
StateMachineChecker.suspendHere()
return IC("K")
}
inline suspend fun inlineMe(): String {
return o().s + k().s
}
// FILE: box.kt
import helpers.*
import kotlin.coroutines.*
fun builder(c: suspend () -> Unit) {
c.startCoroutine(CheckStateMachineContinuation)
}
fun box(): String {
var res = "FAIL"
builder {
res = inlineMe()
}
StateMachineChecker.check(2)
return res
}