diff --git a/compiler/testData/codegen/bytecodeListing/annotations/repeatable/propertyGetterUseSiteTarget.kt b/compiler/testData/codegen/bytecodeListing/annotations/repeatable/propertyGetterUseSiteTarget.kt new file mode 100644 index 00000000000..019013ef622 --- /dev/null +++ b/compiler/testData/codegen/bytecodeListing/annotations/repeatable/propertyGetterUseSiteTarget.kt @@ -0,0 +1,23 @@ +// !LANGUAGE: +RepeatableAnnotations +// TARGET_BACKEND: JVM_IR +// WITH_RUNTIME +// FULL_JDK +// JVM_TARGET: 1.8 + +@Repeatable +annotation class A(val v: String) + +@get:A("a") @get:A("b") +val ab = 0 + +@get:A("c") @get:A("d") +val cd: Int + get() = 0 + +val ef: Int + @A("e") @A("f") get() = 0 + +@get:A("g") +val ghi: Int + // "i" is not detected because of KT-48141. + @A("h") @get:A("i") get() = 0 diff --git a/compiler/testData/codegen/bytecodeListing/annotations/repeatable/propertyGetterUseSiteTarget.txt b/compiler/testData/codegen/bytecodeListing/annotations/repeatable/propertyGetterUseSiteTarget.txt new file mode 100644 index 00000000000..03af18b9a13 --- /dev/null +++ b/compiler/testData/codegen/bytecodeListing/annotations/repeatable/propertyGetterUseSiteTarget.txt @@ -0,0 +1,30 @@ +@kotlin.jvm.internal.RepeatableContainer +@java.lang.annotation.Retention(value=RUNTIME) +@kotlin.Metadata +public annotation class A$Container { + // source: 'propertyGetterUseSiteTarget.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: 'propertyGetterUseSiteTarget.kt' + public abstract method v(): java.lang.String + public inner class A$Container +} + +@kotlin.Metadata +public final class PropertyGetterUseSiteTargetKt { + // source: 'propertyGetterUseSiteTarget.kt' + private final static field ab: int + static method (): void + public final static @A$Container(value=[A(v="a"), A(v="b")]) method getAb(): int + public final static @A$Container(value=[A(v="c"), A(v="d")]) method getCd(): int + public final static @A$Container(value=[A(v="e"), A(v="f")]) method getEf(): int + public final static @A$Container(value=[A(v="g"), A(v="h")]) method getGhi(): int + public inner class A$Container +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBytecodeListingTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBytecodeListingTestGenerated.java index 367b6b625a6..b712a346fb9 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBytecodeListingTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBytecodeListingTestGenerated.java @@ -469,6 +469,12 @@ public class IrBytecodeListingTestGenerated extends AbstractIrBytecodeListingTes runTest("compiler/testData/codegen/bytecodeListing/annotations/repeatable/nonRepeatedAnnotationWithItsContainer.kt"); } + @Test + @TestMetadata("propertyGetterUseSiteTarget.kt") + public void testPropertyGetterUseSiteTarget() throws Exception { + runTest("compiler/testData/codegen/bytecodeListing/annotations/repeatable/propertyGetterUseSiteTarget.kt"); + } + @Test @TestMetadata("retentionAndTarget.kt") public void testRetentionAndTarget() throws Exception {