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,3 +1,6 @@
// IGNORE_BACKEND_K2: JVM_IR
// FIR status: KT-57228 K2: annotations for interface member properties implemented by delegation are copied
annotation class Ann
interface IFoo {
@@ -7,4 +10,4 @@ interface IFoo {
@Ann fun String.testExtFun()
}
class DFoo(d: IFoo) : IFoo by d
class DFoo(d: IFoo) : IFoo by d
@@ -0,0 +1,18 @@
// !LANGUAGE: +RepeatableAnnotations
// TARGET_BACKEND: JVM_IR
// WITH_STDLIB
// FULL_JDK
// JVM_TARGET: 1.8
// IGNORE_BACKEND_K1: JVM_IR
// ^ "c", "d" is not detected because of KT-48141.
// IGNORE_BACKEND_K2: JVM_IR
// FIR status: ["c", "d", "a", "b"] because of KT-57219 K2: incorrect relative order of normal and use-site-targeted annotations on property getter in the resulting bytecode
@Repeatable
annotation class A(val v: String)
@get:A("a") @get:A("b")
val ab: Int
@get:A("c") @get:A("d") get() = 0
@@ -0,0 +1,25 @@
@kotlin.jvm.internal.RepeatableContainer
@java.lang.annotation.Retention(value=RUNTIME)
@kotlin.Metadata
public annotation class A$Container {
// source: 'propertyGetterSeveralUseSiteTargets.kt'
public abstract method value(): A[]
public inner class A$Container
}
@kotlin.annotation.Repeatable
@java.lang.annotation.Retention(value=RUNTIME)
@java.lang.annotation.Repeatable(value=A$Container::class)
@kotlin.Metadata
public annotation class A {
// source: 'propertyGetterSeveralUseSiteTargets.kt'
public abstract method v(): java.lang.String
public inner class A$Container
}
@kotlin.Metadata
public final class PropertyGetterSeveralUseSiteTargetsKt {
// source: 'propertyGetterSeveralUseSiteTargets.kt'
public final static @A$Container(value=[A(v="a"), A(v="b"), A(v="c"), A(v="d")]) method getAb(): int
public inner class A$Container
}
@@ -4,6 +4,9 @@
// FULL_JDK
// JVM_TARGET: 1.8
// IGNORE_BACKEND_K2: JVM_IR
// FIR status: KT-57219 K2: incorrect relative order of normal and use-site-targeted annotations on property getter in the resulting bytecode
@Repeatable
annotation class A(val v: String)
@@ -19,5 +22,4 @@ val ef: Int
@get:A("g")
val ghi: Int
// "i" is not detected because of KT-48141.
@A("h") @get:A("i") get() = 0
@A("h") get() = 0