[Test] Port checkVariableTable suspend lambda tests
Reveals discrepancy in LVT presence on lambda implementations on the
old and new backend.
The generated code in the constructors of Suspend Lambda objects is
identical, but the IR backend generates an LVT with the constructor
parameters.
The user has to be very insistent to see this ("for step into" +
disabling "Show only kotlin variables"), but it is an observable
difference.
This commit is contained in:
committed by
Alexander Udalov
parent
82abc80215
commit
77836f1aa9
+42
@@ -0,0 +1,42 @@
|
||||
|
||||
// WITH_COROUTINES
|
||||
// FILE: test.kt
|
||||
class A
|
||||
|
||||
suspend fun A.foo() {}
|
||||
suspend fun A.foo1(l: Long) {
|
||||
foo()
|
||||
foo()
|
||||
val dead = l
|
||||
}
|
||||
|
||||
suspend fun box() {
|
||||
A().foo1(42)
|
||||
}
|
||||
|
||||
// The lambda object constructor has a local variables table on the IR backend.
|
||||
|
||||
// LOCAL VARIABLES
|
||||
// test.kt:14 box: $completion:kotlin.coroutines.Continuation=helpers.ResultContinuation
|
||||
// test.kt:4 <init>:
|
||||
// test.kt:14 box: $completion:kotlin.coroutines.Continuation=helpers.ResultContinuation
|
||||
// test.kt:7 foo1:
|
||||
// CoroutineUtil.kt:28 getContext:
|
||||
|
||||
// LOCAL VARIABLES JVM
|
||||
// test.kt:-1 <init>:
|
||||
// LOCAL VARIABLES JVM_IR
|
||||
// test.kt:-1 <init>: $completion:kotlin.coroutines.Continuation=helpers.ResultContinuation
|
||||
|
||||
// LOCAL VARIABLES
|
||||
// test.kt:7 foo1:
|
||||
// test.kt:8 foo1: $continuation:kotlin.coroutines.Continuation=TestKt$foo1$1, $result:java.lang.Object=null, $this$foo1:A=A, l:long=42:long
|
||||
// test.kt:6 foo: $this$foo:A=A, $completion:kotlin.coroutines.Continuation=TestKt$foo1$1
|
||||
// test.kt:8 foo1: $continuation:kotlin.coroutines.Continuation=TestKt$foo1$1, $result:java.lang.Object=null, $this$foo1:A=A, l:long=42:long
|
||||
// test.kt:9 foo1: $continuation:kotlin.coroutines.Continuation=TestKt$foo1$1, $result:java.lang.Object=null, $this$foo1:A=A, l:long=42:long
|
||||
// test.kt:6 foo: $this$foo:A=A, $completion:kotlin.coroutines.Continuation=TestKt$foo1$1
|
||||
// test.kt:9 foo1: $continuation:kotlin.coroutines.Continuation=TestKt$foo1$1, $result:java.lang.Object=null, l:long=42:long
|
||||
// test.kt:10 foo1: $continuation:kotlin.coroutines.Continuation=TestKt$foo1$1, $result:java.lang.Object=null, l:long=42:long
|
||||
// test.kt:11 foo1: $continuation:kotlin.coroutines.Continuation=TestKt$foo1$1, $result:java.lang.Object=null
|
||||
// test.kt:14 box: $completion:kotlin.coroutines.Continuation=helpers.ResultContinuation
|
||||
// test.kt:15 box: $completion:kotlin.coroutines.Continuation=helpers.ResultContinuation
|
||||
Reference in New Issue
Block a user