diff --git a/compiler/testData/debug/localVariables/suspend/mergeLvt.kt b/compiler/testData/debug/localVariables/suspend/mergeLvt.kt new file mode 100644 index 00000000000..6880f64639e --- /dev/null +++ b/compiler/testData/debug/localVariables/suspend/mergeLvt.kt @@ -0,0 +1,55 @@ +// WITH_COROUTINES +// FILE: test.kt + +import kotlin.coroutines.intrinsics.* + +class AtomicInt(val value: Int) + +fun atomic(i: Int) = AtomicInt(i) + +private val state = atomic(0) +private val a = 77 + +private inline fun AtomicInt.extensionFun() { + if (a == 76) throw IllegalStateException("AAAAAAAAAAAA") + value +} + +private suspend inline fun suspendBar() { + state.extensionFun() + suspendCoroutineUninterceptedOrReturn { ucont -> + Unit + } +} + +suspend fun box() { + val a = suspendBar() +} + +// LOCAL VARIABLES +// test.kt:25 box: + +// LOCAL VARIABLES JVM_IR +// test.kt:-1 : $completion:kotlin.coroutines.Continuation=helpers.ResultContinuation + +// LOCAL VARIABLES JVM +// test.kt:-1 : + +// LOCAL VARIABLES +// test.kt:25 box: +// test.kt:26 box: $continuation:kotlin.coroutines.Continuation=TestKt$box$1, $result:java.lang.Object=null +// test.kt:19 box: $continuation:kotlin.coroutines.Continuation=TestKt$box$1, $result:java.lang.Object=null, $i$f$suspendBar:int=0:int +// test.kt:19 box: $continuation:kotlin.coroutines.Continuation=TestKt$box$1, $result:java.lang.Object=null, $i$f$suspendBar:int=0:int +// test.kt:14 box: $continuation:kotlin.coroutines.Continuation=TestKt$box$1, $result:java.lang.Object=null, $i$f$suspendBar:int=0:int, $this$extensionFun$iv$iv:AtomicInt=AtomicInt, $i$f$extensionFun:int=0:int +// test.kt:14 box: $continuation:kotlin.coroutines.Continuation=TestKt$box$1, $result:java.lang.Object=null, $i$f$suspendBar:int=0:int, $this$extensionFun$iv$iv:AtomicInt=AtomicInt, $i$f$extensionFun:int=0:int +// test.kt:15 box: $continuation:kotlin.coroutines.Continuation=TestKt$box$1, $result:java.lang.Object=null, $i$f$suspendBar:int=0:int, $this$extensionFun$iv$iv:AtomicInt=AtomicInt, $i$f$extensionFun:int=0:int +// test.kt:6 getValue: +// test.kt:15 box: $continuation:kotlin.coroutines.Continuation=TestKt$box$1, $result:java.lang.Object=null, $i$f$suspendBar:int=0:int, $this$extensionFun$iv$iv:AtomicInt=AtomicInt, $i$f$extensionFun:int=0:int +// test.kt:16 box: $continuation:kotlin.coroutines.Continuation=TestKt$box$1, $result:java.lang.Object=null, $i$f$suspendBar:int=0:int, $i$f$extensionFun:int=0:int +// test.kt:20 box: $continuation:kotlin.coroutines.Continuation=TestKt$box$1, $result:java.lang.Object=null, $i$f$suspendBar:int=0:int +// test.kt:21 box: $continuation:kotlin.coroutines.Continuation=TestKt$box$1, $result:java.lang.Object=null, $i$f$suspendBar:int=0:int, $i$a$-suspendCoroutineUninterceptedOrReturn-TestKt$suspendBar$2$iv:int=0:int +// test.kt:22 box: $continuation:kotlin.coroutines.Continuation=TestKt$box$1, $result:java.lang.Object=null, $i$f$suspendBar:int=0:int, $i$a$-suspendCoroutineUninterceptedOrReturn-TestKt$suspendBar$2$iv:int=0:int +// test.kt:20 box: $continuation:kotlin.coroutines.Continuation=TestKt$box$1, $result:java.lang.Object=null, $i$f$suspendBar:int=0:int +// test.kt:23 box: $continuation:kotlin.coroutines.Continuation=TestKt$box$1, $result:java.lang.Object=null, $i$f$suspendBar:int=0:int +// test.kt:26 box: $continuation:kotlin.coroutines.Continuation=TestKt$box$1, $result:java.lang.Object=null +// test.kt:27 box: $continuation:kotlin.coroutines.Continuation=TestKt$box$1, $result:java.lang.Object=null diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/debugInformation/IrLocalVariableTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/debugInformation/IrLocalVariableTestGenerated.java index 39e75f8733d..7c7ad32392a 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/debugInformation/IrLocalVariableTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/debugInformation/IrLocalVariableTestGenerated.java @@ -275,6 +275,12 @@ public class IrLocalVariableTestGenerated extends AbstractIrLocalVariableTest { runTest("compiler/testData/debug/localVariables/suspend/localsStateMachineTransform.kt"); } + @Test + @TestMetadata("mergeLvt.kt") + public void testMergeLvt() throws Exception { + runTest("compiler/testData/debug/localVariables/suspend/mergeLvt.kt"); + } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/debugInformation/LocalVariableTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/debugInformation/LocalVariableTestGenerated.java index c8214976f78..c1419b2eaf6 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/debugInformation/LocalVariableTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/debugInformation/LocalVariableTestGenerated.java @@ -275,6 +275,12 @@ public class LocalVariableTestGenerated extends AbstractLocalVariableTest { runTest("compiler/testData/debug/localVariables/suspend/localsStateMachineTransform.kt"); } + @Test + @TestMetadata("mergeLvt.kt") + public void testMergeLvt() throws Exception { + runTest("compiler/testData/debug/localVariables/suspend/mergeLvt.kt"); + } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception {