[IR] More extensive LVT tests around destructuring

All tests in this commit _pass_ to document existing behavior, but
this will change in a separate commit as we reflect desired behavior
in the test expectations.
This commit is contained in:
Kristoffer Andersen
2022-03-01 12:37:14 +01:00
committed by Alexander Udalov
parent 9b44c73f54
commit b81139ad36
19 changed files with 843 additions and 62 deletions
@@ -0,0 +1,50 @@
// WITH_STDLIB
// IGNORE_BACKEND_FIR: JVM_IR
// FILE: test.kt
fun box() {
val map: Map<String, String> = mapOf("1" to "23")
for
(
(
a
,
b
)
in
map
)
{
a + b
}
}
// EXPECTATIONS
// EXPECTATIONS JVM
// test.kt:6 box:
// test.kt:16 box: map:java.util.Map=java.util.Collections$SingletonMap
// test.kt:8 box: map:java.util.Map=java.util.Collections$SingletonMap
// test.kt:11 box: map:java.util.Map=java.util.Collections$SingletonMap
// test.kt:13 box: map:java.util.Map=java.util.Collections$SingletonMap
// test.kt:19 box: map:java.util.Map=java.util.Collections$SingletonMap, a:java.lang.String="1":java.lang.String, b:java.lang.String="23":java.lang.String
// test.kt:8 box: map:java.util.Map=java.util.Collections$SingletonMap
// test.kt:21 box: map:java.util.Map=java.util.Collections$SingletonMap
// EXPECTATIONS JVM_IR
// test.kt:6 box:
// test.kt:16 box: map:java.util.Map=java.util.Collections$SingletonMap
// test.kt:11 box: map:java.util.Map=java.util.Collections$SingletonMap
// test.kt:13 box: map:java.util.Map=java.util.Collections$SingletonMap, a:java.lang.String="1":java.lang.String
// test.kt:16 box: map:java.util.Map=java.util.Collections$SingletonMap, a:java.lang.String="1":java.lang.String
// test.kt:13 box: map:java.util.Map=java.util.Collections$SingletonMap, a:java.lang.String="1":java.lang.String
// test.kt:19 box: map:java.util.Map=java.util.Collections$SingletonMap, a:java.lang.String="1":java.lang.String, b:java.lang.String="23":java.lang.String
// test.kt:16 box: map:java.util.Map=java.util.Collections$SingletonMap
// test.kt:21 box: map:java.util.Map=java.util.Collections$SingletonMap