K2: add bytecode listing tests

#KT-57171 Fixed
This commit is contained in:
Alexander Udalov
2023-03-10 00:18:25 +01:00
parent f8deae4570
commit f0fba7be64
59 changed files with 5423 additions and 55 deletions
@@ -1,5 +1,9 @@
// IGNORE_ANNOTATIONS
// IGNORE_BACKEND_K2: JVM_IR
// FIR status: KT-57268 K2: extra methods `remove` and/or `getOrDefault` are generated for Map subclasses with JDK 1.6 in dependencies
// (in this case, it's `getOrDefault-impl` because of inline class mangling, and then `remove` is unmangled for some reason)
inline class InlineMap<K, V>(private val map: Map<K, V>) : Map<K, V> {
override val entries: Set<Map.Entry<K, V>> get() = map.entries
override val keys: Set<K> get() = map.keys
@@ -10,4 +14,3 @@ inline class InlineMap<K, V>(private val map: Map<K, V>) : Map<K, V> {
override fun get(key: K): V? = map[key]
override fun isEmpty(): Boolean = map.isEmpty()
}
@@ -1,5 +1,9 @@
// IGNORE_ANNOTATIONS
// IGNORE_BACKEND_K2: JVM_IR
// FIR status: KT-57268 K2: extra methods `remove` and/or `getOrDefault` are generated for Map subclasses with JDK 1.6 in dependencies
// (in this case, it's `remove-impl`/`getOrDefault-impl` because of inline class mangling)
inline class InlineMutableMap<K, V>(private val mmap: MutableMap<K, V>) : MutableMap<K, V> {
override val size: Int get() = mmap.size
override fun containsKey(key: K): Boolean = mmap.containsKey(key)
@@ -14,4 +18,3 @@ inline class InlineMutableMap<K, V>(private val mmap: MutableMap<K, V>) : Mutabl
override fun putAll(from: Map<out K, V>) { mmap.putAll(from) }
override fun remove(key: K): V? = mmap.remove(key)
}