diff --git a/compiler/testData/codegen/asmLike/receiverMangling/deepInline.asm.ir.txt b/compiler/testData/codegen/asmLike/receiverMangling/deepInline.asm.ir.txt new file mode 100644 index 00000000000..e8f5d8ed120 --- /dev/null +++ b/compiler/testData/codegen/asmLike/receiverMangling/deepInline.asm.ir.txt @@ -0,0 +1,25 @@ +public final class DeepInlineKt : java/lang/Object { + public final static void block(kotlin.jvm.functions.Function1 block) { + Local variables: + 1 $i$f$block: I + 0 block: Lkotlin/jvm/functions/Function1; + } + + public final static void foo(java.lang.String $this$foo, int count) { + Local variables: + 16 $i$a$-block-DeepInlineKt$foo$1$1$1: I + 14 $this$foo_u24lambda_u2d2_u24lambda_u2d1_u24lambda_u2d0: J + 13 $i$f$block: I + 11 $i$a$-block-DeepInlineKt$foo$1$1: I + 12 z: Z + 9 $this$foo_u24lambda_u2d2_u24lambda_u2d1: J + 8 $i$f$block: I + 6 $i$a$-block-DeepInlineKt$foo$1: I + 7 y: Z + 4 $this$foo_u24lambda_u2d2: J + 3 $i$f$block: I + 2 x: Z + 0 $this$foo: Ljava/lang/String; + 1 count: I + } +} diff --git a/compiler/testData/codegen/asmLike/receiverMangling/deepInline.txt b/compiler/testData/codegen/asmLike/receiverMangling/deepInline.asm.txt similarity index 99% rename from compiler/testData/codegen/asmLike/receiverMangling/deepInline.txt rename to compiler/testData/codegen/asmLike/receiverMangling/deepInline.asm.txt index 0ad08afa5ad..a9711062e8a 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/deepInline.txt +++ b/compiler/testData/codegen/asmLike/receiverMangling/deepInline.asm.txt @@ -22,4 +22,4 @@ public final class DeepInlineKt : java/lang/Object { 0 $this$foo: Ljava/lang/String; 1 count: I } -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/asmLike/receiverMangling/deepInline.kt b/compiler/testData/codegen/asmLike/receiverMangling/deepInline.kt index 4e072d18ea1..ea72dd1115d 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/deepInline.kt +++ b/compiler/testData/codegen/asmLike/receiverMangling/deepInline.kt @@ -1,4 +1,4 @@ -// IGNORE_BACKEND: JVM_IR +// IR_DIFFERENCE // LOCAL_VARIABLE_TABLE fun String.foo(count: Int) { @@ -15,4 +15,4 @@ fun String.foo(count: Int) { } } -inline fun block(block: Long.() -> Unit) = 5L.block() \ No newline at end of file +inline fun block(block: Long.() -> Unit) = 5L.block() diff --git a/compiler/testData/codegen/asmLike/receiverMangling/deepInlineWithLabels.asm.ir.txt b/compiler/testData/codegen/asmLike/receiverMangling/deepInlineWithLabels.asm.ir.txt new file mode 100644 index 00000000000..a44be4d92a7 --- /dev/null +++ b/compiler/testData/codegen/asmLike/receiverMangling/deepInlineWithLabels.asm.ir.txt @@ -0,0 +1,25 @@ +public final class DeepInlineWithLabelsKt : java/lang/Object { + public final static void block(kotlin.jvm.functions.Function1 block) { + Local variables: + 1 $i$f$block: I + 0 block: Lkotlin/jvm/functions/Function1; + } + + public final static void foo(java.lang.String $this$foo, int count) { + Local variables: + 16 $i$a$-block-DeepInlineWithLabelsKt$foo$1$1$1: I + 14 $this$foo_u24lambda_u2d2_u24lambda_u2d1_u24lambda_u2d0: J + 13 $i$f$block: I + 11 $i$a$-block-DeepInlineWithLabelsKt$foo$1$1: I + 12 z: Z + 9 $this$foo_u24lambda_u2d2_u24lambda_u2d1: J + 8 $i$f$block: I + 6 $i$a$-block-DeepInlineWithLabelsKt$foo$1: I + 7 y: Z + 4 $this$foo_u24lambda_u2d2: J + 3 $i$f$block: I + 2 x: Z + 0 $this$foo: Ljava/lang/String; + 1 count: I + } +} diff --git a/compiler/testData/codegen/asmLike/receiverMangling/deepInlineWithLabels.txt b/compiler/testData/codegen/asmLike/receiverMangling/deepInlineWithLabels.asm.txt similarity index 99% rename from compiler/testData/codegen/asmLike/receiverMangling/deepInlineWithLabels.txt rename to compiler/testData/codegen/asmLike/receiverMangling/deepInlineWithLabels.asm.txt index d91e68f005b..e57704b6377 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/deepInlineWithLabels.txt +++ b/compiler/testData/codegen/asmLike/receiverMangling/deepInlineWithLabels.asm.txt @@ -22,4 +22,4 @@ public final class DeepInlineWithLabelsKt : java/lang/Object { 0 $this$foo: Ljava/lang/String; 1 count: I } -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/asmLike/receiverMangling/deepInlineWithLabels.kt b/compiler/testData/codegen/asmLike/receiverMangling/deepInlineWithLabels.kt index 72f418cfbca..e8e53ba993b 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/deepInlineWithLabels.kt +++ b/compiler/testData/codegen/asmLike/receiverMangling/deepInlineWithLabels.kt @@ -1,4 +1,4 @@ -// IGNORE_BACKEND: JVM_IR +// IR_DIFFERENCE // LOCAL_VARIABLE_TABLE fun String.foo(count: Int) { @@ -15,4 +15,4 @@ fun String.foo(count: Int) { } } -inline fun block(block: Long.() -> Unit) = 5L.block() \ No newline at end of file +inline fun block(block: Long.() -> Unit) = 5L.block() diff --git a/compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_after.asm.ir.txt b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_after.asm.ir.txt new file mode 100644 index 00000000000..afe6acb3044 --- /dev/null +++ b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_after.asm.ir.txt @@ -0,0 +1,117 @@ +final class DeepNoinlineWithLabels_afterKt$foo$1$1$1 : kotlin/jvm/internal/Lambda, kotlin/jvm/functions/Function1 { + final int $count + + final long $this_b1 + + final long $this_b2 + + final java.lang.String $this_foo + + final boolean $x + + final boolean $y + + final boolean $z + + void (java.lang.String $receiver, long $this_b1, long p2, boolean $this_b2, boolean p4, boolean $x, int $y) { + Local variables: + 0 this: LDeepNoinlineWithLabels_afterKt$foo$1$1$1; + 1 $receiver: Ljava/lang/String; + 2 $this_b1: J + 4 $this_b2: J + 6 $x: Z + 7 $y: Z + 8 $z: Z + 9 $count: I + } + + public final void invoke(long $this$b3) { + Local variables: + 0 this: LDeepNoinlineWithLabels_afterKt$foo$1$1$1; + 1 $this$b3: J + } + + public java.lang.Object invoke(java.lang.Object p1) { + Local variables: + 0 this: LDeepNoinlineWithLabels_afterKt$foo$1$1$1; + 1 p1: Ljava/lang/Object; + } +} + +final class DeepNoinlineWithLabels_afterKt$foo$1$1 : kotlin/jvm/internal/Lambda, kotlin/jvm/functions/Function1 { + final int $count + + final long $this_b1 + + final java.lang.String $this_foo + + final boolean $x + + final boolean $y + + void (java.lang.String $receiver, long $this_b1, boolean p2, boolean $x, int $y) { + Local variables: + 0 this: LDeepNoinlineWithLabels_afterKt$foo$1$1; + 1 $receiver: Ljava/lang/String; + 2 $this_b1: J + 4 $x: Z + 5 $y: Z + 6 $count: I + } + + public final void invoke(long $this$b2) { + Local variables: + 3 z: Z + 0 this: LDeepNoinlineWithLabels_afterKt$foo$1$1; + 1 $this$b2: J + } + + public java.lang.Object invoke(java.lang.Object p1) { + Local variables: + 0 this: LDeepNoinlineWithLabels_afterKt$foo$1$1; + 1 p1: Ljava/lang/Object; + } +} + +final class DeepNoinlineWithLabels_afterKt$foo$1 : kotlin/jvm/internal/Lambda, kotlin/jvm/functions/Function1 { + final int $count + + final java.lang.String $this_foo + + final boolean $x + + void (java.lang.String $receiver, boolean $x, int $count) { + Local variables: + 0 this: LDeepNoinlineWithLabels_afterKt$foo$1; + 1 $receiver: Ljava/lang/String; + 2 $x: Z + 3 $count: I + } + + public final void invoke(long $this$b1) { + Local variables: + 3 y: Z + 0 this: LDeepNoinlineWithLabels_afterKt$foo$1; + 1 $this$b1: J + } + + public java.lang.Object invoke(java.lang.Object p1) { + Local variables: + 0 this: LDeepNoinlineWithLabels_afterKt$foo$1; + 1 p1: Ljava/lang/Object; + } +} + +public final class DeepNoinlineWithLabels_afterKt : java/lang/Object { + public final static void block(kotlin.jvm.functions.Function1 block) { + Local variables: + 0 block: Lkotlin/jvm/functions/Function1; + } + + public final static void foo(java.lang.String $this$foo, int count) { + Local variables: + 2 x: Z + 0 $this$foo: Ljava/lang/String; + 1 count: I + } +} diff --git a/compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_after.txt b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_after.asm.txt similarity index 99% rename from compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_after.txt rename to compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_after.asm.txt index f2d7775b99f..ef2a895b377 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_after.txt +++ b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_after.asm.txt @@ -66,4 +66,4 @@ public final class DeepNoinlineWithLabels_afterKt : java/lang/Object { 0 $this$foo: Ljava/lang/String; 1 count: I } -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_after.kt b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_after.kt index 81b4cc68628..be1742f3247 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_after.kt +++ b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_after.kt @@ -1,5 +1,5 @@ // !LANGUAGE: +NewCapturedReceiverFieldNamingConvention -// IGNORE_BACKEND: JVM_IR +// IR_DIFFERENCE // LOCAL_VARIABLE_TABLE fun String.foo(count: Int) { diff --git a/compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_before.asm.ir.txt b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_before.asm.ir.txt new file mode 100644 index 00000000000..c86f295af08 --- /dev/null +++ b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_before.asm.ir.txt @@ -0,0 +1,117 @@ +final class DeepNoinlineWithLabels_beforeKt$foo$1$1$1 : kotlin/jvm/internal/Lambda, kotlin/jvm/functions/Function1 { + final int $count + + final long $this + + final long $this$1 + + final java.lang.String $this_foo + + final boolean $x + + final boolean $y + + final boolean $z + + void (java.lang.String $receiver, long $this, long p2, boolean $this$1, boolean p4, boolean $x, int $y) { + Local variables: + 0 this: LDeepNoinlineWithLabels_beforeKt$foo$1$1$1; + 1 $receiver: Ljava/lang/String; + 2 $this: J + 4 $this$1: J + 6 $x: Z + 7 $y: Z + 8 $z: Z + 9 $count: I + } + + public final void invoke(long ) { + Local variables: + 0 this: LDeepNoinlineWithLabels_beforeKt$foo$1$1$1; + 1 : J + } + + public java.lang.Object invoke(java.lang.Object p1) { + Local variables: + 0 this: LDeepNoinlineWithLabels_beforeKt$foo$1$1$1; + 1 p1: Ljava/lang/Object; + } +} + +final class DeepNoinlineWithLabels_beforeKt$foo$1$1 : kotlin/jvm/internal/Lambda, kotlin/jvm/functions/Function1 { + final int $count + + final long $this + + final java.lang.String $this_foo + + final boolean $x + + final boolean $y + + void (java.lang.String $receiver, long $this, boolean p2, boolean $x, int $y) { + Local variables: + 0 this: LDeepNoinlineWithLabels_beforeKt$foo$1$1; + 1 $receiver: Ljava/lang/String; + 2 $this: J + 4 $x: Z + 5 $y: Z + 6 $count: I + } + + public final void invoke(long ) { + Local variables: + 3 z: Z + 0 this: LDeepNoinlineWithLabels_beforeKt$foo$1$1; + 1 : J + } + + public java.lang.Object invoke(java.lang.Object p1) { + Local variables: + 0 this: LDeepNoinlineWithLabels_beforeKt$foo$1$1; + 1 p1: Ljava/lang/Object; + } +} + +final class DeepNoinlineWithLabels_beforeKt$foo$1 : kotlin/jvm/internal/Lambda, kotlin/jvm/functions/Function1 { + final int $count + + final java.lang.String $this_foo + + final boolean $x + + void (java.lang.String $receiver, boolean $x, int $count) { + Local variables: + 0 this: LDeepNoinlineWithLabels_beforeKt$foo$1; + 1 $receiver: Ljava/lang/String; + 2 $x: Z + 3 $count: I + } + + public final void invoke(long ) { + Local variables: + 3 y: Z + 0 this: LDeepNoinlineWithLabels_beforeKt$foo$1; + 1 : J + } + + public java.lang.Object invoke(java.lang.Object p1) { + Local variables: + 0 this: LDeepNoinlineWithLabels_beforeKt$foo$1; + 1 p1: Ljava/lang/Object; + } +} + +public final class DeepNoinlineWithLabels_beforeKt : java/lang/Object { + public final static void block(kotlin.jvm.functions.Function1 block) { + Local variables: + 0 block: Lkotlin/jvm/functions/Function1; + } + + public final static void foo(java.lang.String $receiver, int count) { + Local variables: + 2 x: Z + 0 $receiver: Ljava/lang/String; + 1 count: I + } +} diff --git a/compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_before.txt b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_before.asm.txt similarity index 99% rename from compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_before.txt rename to compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_before.asm.txt index 1b84d6f6a47..85a36ec5a44 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_before.txt +++ b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_before.asm.txt @@ -66,4 +66,4 @@ public final class DeepNoinlineWithLabels_beforeKt : java/lang/Object { 0 $receiver: Ljava/lang/String; 1 count: I } -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_before.kt b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_before.kt index 9c2ba05a3b3..ebbaf1533b2 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_before.kt +++ b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_before.kt @@ -1,5 +1,5 @@ // !LANGUAGE: -NewCapturedReceiverFieldNamingConvention -// IGNORE_BACKEND: JVM_IR +// IR_DIFFERENCE // LOCAL_VARIABLE_TABLE fun String.foo(count: Int) { @@ -16,4 +16,4 @@ fun String.foo(count: Int) { } } -fun block(block: Long.() -> Unit) = 5L.block() \ No newline at end of file +fun block(block: Long.() -> Unit) = 5L.block() diff --git a/compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_after.asm.ir.txt b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_after.asm.ir.txt new file mode 100644 index 00000000000..c8a0106c746 --- /dev/null +++ b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_after.asm.ir.txt @@ -0,0 +1,108 @@ +final class DeepNoinline_afterKt$foo$1$1$1 : kotlin/jvm/internal/Lambda, kotlin/jvm/functions/Function1 { + final int $count + + final java.lang.String $this_foo + + final boolean $x + + final boolean $y + + final boolean $z + + void (java.lang.String $receiver, boolean $x, boolean $y, boolean $z, int $count) { + Local variables: + 0 this: LDeepNoinline_afterKt$foo$1$1$1; + 1 $receiver: Ljava/lang/String; + 2 $x: Z + 3 $y: Z + 4 $z: Z + 5 $count: I + } + + public final void invoke(long $this$block) { + Local variables: + 0 this: LDeepNoinline_afterKt$foo$1$1$1; + 1 $this$block: J + } + + public java.lang.Object invoke(java.lang.Object p1) { + Local variables: + 0 this: LDeepNoinline_afterKt$foo$1$1$1; + 1 p1: Ljava/lang/Object; + } +} + +final class DeepNoinline_afterKt$foo$1$1 : kotlin/jvm/internal/Lambda, kotlin/jvm/functions/Function1 { + final int $count + + final java.lang.String $this_foo + + final boolean $x + + final boolean $y + + void (java.lang.String $receiver, boolean $x, boolean $y, int $count) { + Local variables: + 0 this: LDeepNoinline_afterKt$foo$1$1; + 1 $receiver: Ljava/lang/String; + 2 $x: Z + 3 $y: Z + 4 $count: I + } + + public final void invoke(long $this$block) { + Local variables: + 3 z: Z + 0 this: LDeepNoinline_afterKt$foo$1$1; + 1 $this$block: J + } + + public java.lang.Object invoke(java.lang.Object p1) { + Local variables: + 0 this: LDeepNoinline_afterKt$foo$1$1; + 1 p1: Ljava/lang/Object; + } +} + +final class DeepNoinline_afterKt$foo$1 : kotlin/jvm/internal/Lambda, kotlin/jvm/functions/Function1 { + final int $count + + final java.lang.String $this_foo + + final boolean $x + + void (java.lang.String $receiver, boolean $x, int $count) { + Local variables: + 0 this: LDeepNoinline_afterKt$foo$1; + 1 $receiver: Ljava/lang/String; + 2 $x: Z + 3 $count: I + } + + public final void invoke(long $this$block) { + Local variables: + 3 y: Z + 0 this: LDeepNoinline_afterKt$foo$1; + 1 $this$block: J + } + + public java.lang.Object invoke(java.lang.Object p1) { + Local variables: + 0 this: LDeepNoinline_afterKt$foo$1; + 1 p1: Ljava/lang/Object; + } +} + +public final class DeepNoinline_afterKt : java/lang/Object { + public final static void block(kotlin.jvm.functions.Function1 block) { + Local variables: + 0 block: Lkotlin/jvm/functions/Function1; + } + + public final static void foo(java.lang.String $this$foo, int count) { + Local variables: + 2 x: Z + 0 $this$foo: Ljava/lang/String; + 1 count: I + } +} diff --git a/compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_after.txt b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_after.asm.txt similarity index 99% rename from compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_after.txt rename to compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_after.asm.txt index 160c7cab077..3e5a51dd55d 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_after.txt +++ b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_after.asm.txt @@ -62,4 +62,4 @@ public final class DeepNoinline_afterKt : java/lang/Object { 0 $this$foo: Ljava/lang/String; 1 count: I } -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_after.kt b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_after.kt index 8103f4c44d8..248d968e9be 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_after.kt +++ b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_after.kt @@ -1,5 +1,5 @@ // !LANGUAGE: +NewCapturedReceiverFieldNamingConvention -// IGNORE_BACKEND: JVM_IR +// IR_DIFFERENCE // LOCAL_VARIABLE_TABLE fun String.foo(count: Int) { diff --git a/compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_before.asm.ir.txt b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_before.asm.ir.txt new file mode 100644 index 00000000000..b5307adeebf --- /dev/null +++ b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_before.asm.ir.txt @@ -0,0 +1,108 @@ +final class DeepNoinline_beforeKt$foo$1$1$1 : kotlin/jvm/internal/Lambda, kotlin/jvm/functions/Function1 { + final int $count + + final java.lang.String $this_foo + + final boolean $x + + final boolean $y + + final boolean $z + + void (java.lang.String $receiver, boolean $x, boolean $y, boolean $z, int $count) { + Local variables: + 0 this: LDeepNoinline_beforeKt$foo$1$1$1; + 1 $receiver: Ljava/lang/String; + 2 $x: Z + 3 $y: Z + 4 $z: Z + 5 $count: I + } + + public final void invoke(long ) { + Local variables: + 0 this: LDeepNoinline_beforeKt$foo$1$1$1; + 1 : J + } + + public java.lang.Object invoke(java.lang.Object p1) { + Local variables: + 0 this: LDeepNoinline_beforeKt$foo$1$1$1; + 1 p1: Ljava/lang/Object; + } +} + +final class DeepNoinline_beforeKt$foo$1$1 : kotlin/jvm/internal/Lambda, kotlin/jvm/functions/Function1 { + final int $count + + final java.lang.String $this_foo + + final boolean $x + + final boolean $y + + void (java.lang.String $receiver, boolean $x, boolean $y, int $count) { + Local variables: + 0 this: LDeepNoinline_beforeKt$foo$1$1; + 1 $receiver: Ljava/lang/String; + 2 $x: Z + 3 $y: Z + 4 $count: I + } + + public final void invoke(long ) { + Local variables: + 3 z: Z + 0 this: LDeepNoinline_beforeKt$foo$1$1; + 1 : J + } + + public java.lang.Object invoke(java.lang.Object p1) { + Local variables: + 0 this: LDeepNoinline_beforeKt$foo$1$1; + 1 p1: Ljava/lang/Object; + } +} + +final class DeepNoinline_beforeKt$foo$1 : kotlin/jvm/internal/Lambda, kotlin/jvm/functions/Function1 { + final int $count + + final java.lang.String $this_foo + + final boolean $x + + void (java.lang.String $receiver, boolean $x, int $count) { + Local variables: + 0 this: LDeepNoinline_beforeKt$foo$1; + 1 $receiver: Ljava/lang/String; + 2 $x: Z + 3 $count: I + } + + public final void invoke(long ) { + Local variables: + 3 y: Z + 0 this: LDeepNoinline_beforeKt$foo$1; + 1 : J + } + + public java.lang.Object invoke(java.lang.Object p1) { + Local variables: + 0 this: LDeepNoinline_beforeKt$foo$1; + 1 p1: Ljava/lang/Object; + } +} + +public final class DeepNoinline_beforeKt : java/lang/Object { + public final static void block(kotlin.jvm.functions.Function1 block) { + Local variables: + 0 block: Lkotlin/jvm/functions/Function1; + } + + public final static void foo(java.lang.String $receiver, int count) { + Local variables: + 2 x: Z + 0 $receiver: Ljava/lang/String; + 1 count: I + } +} diff --git a/compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_before.txt b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_before.asm.txt similarity index 99% rename from compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_before.txt rename to compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_before.asm.txt index d7373df0eab..a2604fca732 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_before.txt +++ b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_before.asm.txt @@ -62,4 +62,4 @@ public final class DeepNoinline_beforeKt : java/lang/Object { 0 $receiver: Ljava/lang/String; 1 count: I } -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_before.kt b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_before.kt index 58b94db4b60..fddc50e8300 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_before.kt +++ b/compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_before.kt @@ -1,5 +1,5 @@ // !LANGUAGE: -NewCapturedReceiverFieldNamingConvention -// IGNORE_BACKEND: JVM_IR +// IR_DIFFERENCE // LOCAL_VARIABLE_TABLE fun String.foo(count: Int) { @@ -16,4 +16,4 @@ fun String.foo(count: Int) { } } -fun block(block: Long.() -> Unit) = 5L.block() \ No newline at end of file +fun block(block: Long.() -> Unit) = 5L.block() diff --git a/compiler/testData/codegen/asmLike/receiverMangling/inlineClassCapture.asm.ir.txt b/compiler/testData/codegen/asmLike/receiverMangling/inlineClassCapture.asm.ir.txt new file mode 100644 index 00000000000..f42e64a728f --- /dev/null +++ b/compiler/testData/codegen/asmLike/receiverMangling/inlineClassCapture.asm.ir.txt @@ -0,0 +1,40 @@ +public final class Foo$Bar : java/lang/Object { + final Foo this$0 + + public void (Foo this$0) { + Local variables: + 0 this: LFoo$Bar; + 1 this$0: LFoo; + } + + public final void bar() { + Local variables: + 4 $i$a$-block-Foo$Bar$bar$1$1: I + 3 $i$f$block: I + 2 $i$a$-block-Foo$Bar$bar$1: I + 1 $i$f$block: I + 0 this: LFoo$Bar; + } +} + +public final class Foo : java/lang/Object { + public void () { + Local variables: + 0 this: LFoo; + } + + public final void foo() { + Local variables: + 2 $i$a$-block-Foo$foo$1: I + 1 $i$f$block: I + 0 this: LFoo; + } +} + +public final class InlineClassCaptureKt : java/lang/Object { + public final static void block(kotlin.jvm.functions.Function0 block) { + Local variables: + 1 $i$f$block: I + 0 block: Lkotlin/jvm/functions/Function0; + } +} diff --git a/compiler/testData/codegen/asmLike/receiverMangling/inlineClassCapture.txt b/compiler/testData/codegen/asmLike/receiverMangling/inlineClassCapture.asm.txt similarity index 100% rename from compiler/testData/codegen/asmLike/receiverMangling/inlineClassCapture.txt rename to compiler/testData/codegen/asmLike/receiverMangling/inlineClassCapture.asm.txt diff --git a/compiler/testData/codegen/asmLike/receiverMangling/inlineClassCapture.kt b/compiler/testData/codegen/asmLike/receiverMangling/inlineClassCapture.kt index b599f6f28c3..cff096f5a94 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/inlineClassCapture.kt +++ b/compiler/testData/codegen/asmLike/receiverMangling/inlineClassCapture.kt @@ -1,4 +1,4 @@ -// IGNORE_BACKEND: JVM_IR +// IR_DIFFERENCE // LOCAL_VARIABLE_TABLE class Foo { @@ -23,4 +23,4 @@ class Foo { } } -inline fun block(block: () -> Unit) = block() \ No newline at end of file +inline fun block(block: () -> Unit) = block() diff --git a/compiler/testData/codegen/asmLike/receiverMangling/inlineReceivers.asm.ir.txt b/compiler/testData/codegen/asmLike/receiverMangling/inlineReceivers.asm.ir.txt new file mode 100644 index 00000000000..e9abee2344d --- /dev/null +++ b/compiler/testData/codegen/asmLike/receiverMangling/inlineReceivers.asm.ir.txt @@ -0,0 +1,17 @@ +public final class InlineReceiversKt : java/lang/Object { + public final static void block(kotlin.jvm.functions.Function1 block) { + Local variables: + 1 $i$f$block: I + 0 block: Lkotlin/jvm/functions/Function1; + } + + public final static void foo(java.lang.String $this$foo, int count) { + Local variables: + 6 $i$a$-block-InlineReceiversKt$foo$1: I + 4 $this$foo_u24lambda_u2d0: J + 3 $i$f$block: I + 2 x: Z + 0 $this$foo: Ljava/lang/String; + 1 count: I + } +} diff --git a/compiler/testData/codegen/asmLike/receiverMangling/inlineReceivers.txt b/compiler/testData/codegen/asmLike/receiverMangling/inlineReceivers.asm.txt similarity index 99% rename from compiler/testData/codegen/asmLike/receiverMangling/inlineReceivers.txt rename to compiler/testData/codegen/asmLike/receiverMangling/inlineReceivers.asm.txt index f441d22c97c..d879e37c56c 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/inlineReceivers.txt +++ b/compiler/testData/codegen/asmLike/receiverMangling/inlineReceivers.asm.txt @@ -14,4 +14,4 @@ public final class InlineReceiversKt : java/lang/Object { 0 $this$foo: Ljava/lang/String; 1 count: I } -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/asmLike/receiverMangling/inlineReceivers.kt b/compiler/testData/codegen/asmLike/receiverMangling/inlineReceivers.kt index 7050ea35d87..9bae7a17344 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/inlineReceivers.kt +++ b/compiler/testData/codegen/asmLike/receiverMangling/inlineReceivers.kt @@ -1,4 +1,4 @@ -// IGNORE_BACKEND: JVM_IR +// IR_DIFFERENCE // LOCAL_VARIABLE_TABLE fun String.foo(count: Int) { @@ -9,4 +9,4 @@ fun String.foo(count: Int) { } } -inline fun block(block: Long.() -> Unit) = 5L.block() \ No newline at end of file +inline fun block(block: Long.() -> Unit) = 5L.block() diff --git a/compiler/testData/codegen/asmLike/receiverMangling/localFunctions.asm.ir.txt b/compiler/testData/codegen/asmLike/receiverMangling/localFunctions.asm.ir.txt new file mode 100644 index 00000000000..940cf3d37b3 --- /dev/null +++ b/compiler/testData/codegen/asmLike/receiverMangling/localFunctions.asm.ir.txt @@ -0,0 +1,16 @@ +public final class LocalFunctionsKt : java/lang/Object { + public final static void foo() + + private final static void foo$a() + + private final static void foo$a2() + + private final static void foo$a2-0(int a) { + Local variables: + 0 a: I + } + + private final static void foo$b_c() + + private final static void foo$c_d() +} diff --git a/compiler/testData/codegen/asmLike/receiverMangling/localFunctions.txt b/compiler/testData/codegen/asmLike/receiverMangling/localFunctions.asm.txt similarity index 100% rename from compiler/testData/codegen/asmLike/receiverMangling/localFunctions.txt rename to compiler/testData/codegen/asmLike/receiverMangling/localFunctions.asm.txt diff --git a/compiler/testData/codegen/asmLike/receiverMangling/localFunctions.kt b/compiler/testData/codegen/asmLike/receiverMangling/localFunctions.kt index bd7b6e903d5..f7b1471bc7a 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/localFunctions.kt +++ b/compiler/testData/codegen/asmLike/receiverMangling/localFunctions.kt @@ -1,4 +1,4 @@ -// IGNORE_BACKEND: JVM_IR +// IR_DIFFERENCE // LOCAL_VARIABLE_TABLE fun foo() { @@ -7,4 +7,4 @@ fun foo() { fun a2(a: Int) {} fun `b c`() {} fun `c$d`() {} -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/asmLike/receiverMangling/mangledNames.asm.ir.txt b/compiler/testData/codegen/asmLike/receiverMangling/mangledNames.asm.ir.txt new file mode 100644 index 00000000000..e5ab1852e63 --- /dev/null +++ b/compiler/testData/codegen/asmLike/receiverMangling/mangledNames.asm.ir.txt @@ -0,0 +1,144 @@ +final class Arr : java/lang/Object { + private final int a1 + + private final int a2 + + private final int a3 + + private final int a4 + + private final int a5 + + public void (int a1, int a2, int a3, int a4, int a5) { + Local variables: + 0 this: LArr; + 1 a1: I + 2 a2: I + 3 a3: I + 4 a4: I + 5 a5: I + } + + public void (int p0, int p1, int p2, int p3, int p4, int p5, kotlin.jvm.internal.DefaultConstructorMarker p6) + + public void () { + Local variables: + 0 this: LArr; + } + + public final int component1() { + Local variables: + 0 this: LArr; + } + + public final int component2() { + Local variables: + 0 this: LArr; + } + + public final int component3() { + Local variables: + 0 this: LArr; + } + + public final int component4() { + Local variables: + 0 this: LArr; + } + + public final int component5() { + Local variables: + 0 this: LArr; + } + + public final Arr copy(int a1, int a2, int a3, int a4, int a5) { + Local variables: + 0 this: LArr; + 1 a1: I + 2 a2: I + 3 a3: I + 4 a4: I + 5 a5: I + } + + public static Arr copy$default(Arr p0, int p1, int p2, int p3, int p4, int p5, int p6, java.lang.Object p7) + + public boolean equals(java.lang.Object other) { + Local variables: + 0 this: LArr; + 1 other: Ljava/lang/Object; + } + + public final int getA1() { + Local variables: + 0 this: LArr; + } + + public final int getA2() { + Local variables: + 0 this: LArr; + } + + public final int getA3() { + Local variables: + 0 this: LArr; + } + + public final int getA4() { + Local variables: + 0 this: LArr; + } + + public final int getA5() { + Local variables: + 0 this: LArr; + } + + public int hashCode() { + Local variables: + 1 result: I + 0 this: LArr; + } + + public java.lang.String toString() { + Local variables: + 0 this: LArr; + } +} + +final class MangledNamesKt$foo$1 : kotlin/jvm/internal/Lambda, kotlin/jvm/functions/Function1 { + public final static MangledNamesKt$foo$1 INSTANCE + + static void () + + void () { + Local variables: + 0 this: LMangledNamesKt$foo$1; + } + + public final void invoke(Arr $dstr$a_u20b$b_u24c$c_u2dd$b_u24_u24c_u2d_u2dd$a_u28_u29§_u26_u2a_u26_u5e_u40あ化) { + Local variables: + 2 a b: I + 3 b$c: I + 4 c-d: I + 5 b$$c--d: I + 6 a()§&*&^@あ化: I + 0 this: LMangledNamesKt$foo$1; + 1 $dstr$a_u20b$b_u24c$c_u2dd$b_u24_u24c_u2d_u2dd$a_u28_u29§_u26_u2a_u26_u5e_u40あ化: LArr; + } + + public java.lang.Object invoke(java.lang.Object p1) { + Local variables: + 0 this: LMangledNamesKt$foo$1; + 1 p1: Ljava/lang/Object; + } +} + +public final class MangledNamesKt : java/lang/Object { + public final static void foo() + + private final static void t(kotlin.jvm.functions.Function1 block) { + Local variables: + 0 block: Lkotlin/jvm/functions/Function1; + } +} diff --git a/compiler/testData/codegen/asmLike/receiverMangling/mangledNames.txt b/compiler/testData/codegen/asmLike/receiverMangling/mangledNames.asm.txt similarity index 99% rename from compiler/testData/codegen/asmLike/receiverMangling/mangledNames.txt rename to compiler/testData/codegen/asmLike/receiverMangling/mangledNames.asm.txt index b3bb2ea72e1..798bac0b130 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/mangledNames.txt +++ b/compiler/testData/codegen/asmLike/receiverMangling/mangledNames.asm.txt @@ -120,4 +120,4 @@ public final class MangledNamesKt : java/lang/Object { Local variables: 0 block: Lkotlin/jvm/functions/Function1; } -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/asmLike/receiverMangling/mangledNames.kt b/compiler/testData/codegen/asmLike/receiverMangling/mangledNames.kt index 2a85e32ae65..0d82f6fd3ed 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/mangledNames.kt +++ b/compiler/testData/codegen/asmLike/receiverMangling/mangledNames.kt @@ -1,4 +1,4 @@ -// IGNORE_BACKEND: JVM_IR +// IR_DIFFERENCE // LOCAL_VARIABLE_TABLE fun foo() { @@ -15,4 +15,4 @@ private data class Arr( val a3: Int = 0, val a4: Int = 0, val a5: Int = 0 -) \ No newline at end of file +) diff --git a/compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_after.asm.ir.txt b/compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_after.asm.ir.txt new file mode 100644 index 00000000000..f2556981db0 --- /dev/null +++ b/compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_after.asm.ir.txt @@ -0,0 +1,41 @@ +final class NonInlineReceivers_afterKt$foo$1 : kotlin/jvm/internal/Lambda, kotlin/jvm/functions/Function1 { + final int $count + + final java.lang.String $this_foo + + final boolean $x + + void (java.lang.String $receiver, boolean $x, int $count) { + Local variables: + 0 this: LNonInlineReceivers_afterKt$foo$1; + 1 $receiver: Ljava/lang/String; + 2 $x: Z + 3 $count: I + } + + public final void invoke(long $this$block) { + Local variables: + 0 this: LNonInlineReceivers_afterKt$foo$1; + 1 $this$block: J + } + + public java.lang.Object invoke(java.lang.Object p1) { + Local variables: + 0 this: LNonInlineReceivers_afterKt$foo$1; + 1 p1: Ljava/lang/Object; + } +} + +public final class NonInlineReceivers_afterKt : java/lang/Object { + public final static void block(kotlin.jvm.functions.Function1 block) { + Local variables: + 0 block: Lkotlin/jvm/functions/Function1; + } + + public final static void foo(java.lang.String $this$foo, int count) { + Local variables: + 2 x: Z + 0 $this$foo: Ljava/lang/String; + 1 count: I + } +} diff --git a/compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_after.txt b/compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_after.asm.txt similarity index 99% rename from compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_after.txt rename to compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_after.asm.txt index 0fa1355bedc..8974697411d 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_after.txt +++ b/compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_after.asm.txt @@ -28,4 +28,4 @@ public final class NonInlineReceivers_afterKt : java/lang/Object { 0 $this$foo: Ljava/lang/String; 1 count: I } -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_after.kt b/compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_after.kt index 1becbf4ea5d..8b3118c8815 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_after.kt +++ b/compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_after.kt @@ -1,4 +1,4 @@ -// IGNORE_BACKEND: JVM_IR +// IR_DIFFERENCE // LOCAL_VARIABLE_TABLE fun String.foo(count: Int) { @@ -9,4 +9,4 @@ fun String.foo(count: Int) { } } -fun block(block: Long.() -> Unit) = 5L.block() \ No newline at end of file +fun block(block: Long.() -> Unit) = 5L.block() diff --git a/compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_before.asm.ir.txt b/compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_before.asm.ir.txt new file mode 100644 index 00000000000..67692ce29ba --- /dev/null +++ b/compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_before.asm.ir.txt @@ -0,0 +1,41 @@ +final class NonInlineReceivers_beforeKt$foo$1 : kotlin/jvm/internal/Lambda, kotlin/jvm/functions/Function1 { + final int $count + + final java.lang.String $this_foo + + final boolean $x + + void (java.lang.String $receiver, boolean $x, int $count) { + Local variables: + 0 this: LNonInlineReceivers_beforeKt$foo$1; + 1 $receiver: Ljava/lang/String; + 2 $x: Z + 3 $count: I + } + + public final void invoke(long ) { + Local variables: + 0 this: LNonInlineReceivers_beforeKt$foo$1; + 1 : J + } + + public java.lang.Object invoke(java.lang.Object p1) { + Local variables: + 0 this: LNonInlineReceivers_beforeKt$foo$1; + 1 p1: Ljava/lang/Object; + } +} + +public final class NonInlineReceivers_beforeKt : java/lang/Object { + public final static void block(kotlin.jvm.functions.Function1 block) { + Local variables: + 0 block: Lkotlin/jvm/functions/Function1; + } + + public final static void foo(java.lang.String $receiver, int count) { + Local variables: + 2 x: Z + 0 $receiver: Ljava/lang/String; + 1 count: I + } +} diff --git a/compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_before.txt b/compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_before.asm.txt similarity index 99% rename from compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_before.txt rename to compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_before.asm.txt index 2b97e331484..b3c4ce58784 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_before.txt +++ b/compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_before.asm.txt @@ -28,4 +28,4 @@ public final class NonInlineReceivers_beforeKt : java/lang/Object { 0 $receiver: Ljava/lang/String; 1 count: I } -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_before.kt b/compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_before.kt index dac931ab290..c31cb2d9bcb 100644 --- a/compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_before.kt +++ b/compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_before.kt @@ -1,5 +1,5 @@ // !LANGUAGE: -NewCapturedReceiverFieldNamingConvention -// IGNORE_BACKEND: JVM_IR +// IR_DIFFERENCE // LOCAL_VARIABLE_TABLE fun String.foo(count: Int) { @@ -10,4 +10,4 @@ fun String.foo(count: Int) { } } -fun block(block: Long.() -> Unit) = 5L.block() \ No newline at end of file +fun block(block: Long.() -> Unit) = 5L.block() diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/classTypeParameter.txt b/compiler/testData/codegen/asmLike/typeAnnotations/classTypeParameter.asm.txt similarity index 100% rename from compiler/testData/codegen/asmLike/typeAnnotations/classTypeParameter.txt rename to compiler/testData/codegen/asmLike/typeAnnotations/classTypeParameter.asm.txt diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/classTypeParameter.kt b/compiler/testData/codegen/asmLike/typeAnnotations/classTypeParameter.kt index 6824c0c4122..4fcbcf2f97a 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/classTypeParameter.kt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/classTypeParameter.kt @@ -1,7 +1,7 @@ // IGNORE_BACKEND: JVM -// KOTLIN_CONFIGURATION_FLAGS: +JVM.EMIT_JVM_TYPE_ANNOTATIONS +// EMIT_JVM_TYPE_ANNOTATIONS // RENDER_ANNOTATIONS -// TARGET_BACKEND: JVM +// TARGET_BACKEND: JVM_IR // JVM_TARGET: 1.8 package foo diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/complex.txt b/compiler/testData/codegen/asmLike/typeAnnotations/complex.asm.txt similarity index 99% rename from compiler/testData/codegen/asmLike/typeAnnotations/complex.txt rename to compiler/testData/codegen/asmLike/typeAnnotations/complex.asm.txt index 8a2ccf0e251..09f7ccc081d 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/complex.txt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/complex.asm.txt @@ -73,4 +73,4 @@ public final class foo/Kotlin : java/lang/Object { @Lfoo/Ann;([]) : METHOD_FORMAL_PARAMETER 0, null @Lfoo/Ann2;([]) : METHOD_FORMAL_PARAMETER 0, 0; @Lorg/jetbrains/annotations/NotNull;([]) // invisible, parameter 0 -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/complex.kt b/compiler/testData/codegen/asmLike/typeAnnotations/complex.kt index 1eaf283f7a6..ecc8de0bfa7 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/complex.kt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/complex.kt @@ -1,4 +1,4 @@ -// KOTLIN_CONFIGURATION_FLAGS: +JVM.EMIT_JVM_TYPE_ANNOTATIONS +// EMIT_JVM_TYPE_ANNOTATIONS // RENDER_ANNOTATIONS // TARGET_BACKEND: JVM // JVM_TARGET: 1.8 diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/constructor.txt b/compiler/testData/codegen/asmLike/typeAnnotations/constructor.asm.txt similarity index 100% rename from compiler/testData/codegen/asmLike/typeAnnotations/constructor.txt rename to compiler/testData/codegen/asmLike/typeAnnotations/constructor.asm.txt diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/constructor.kt b/compiler/testData/codegen/asmLike/typeAnnotations/constructor.kt index c51203d5db2..6a305aaa163 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/constructor.kt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/constructor.kt @@ -1,4 +1,4 @@ -// KOTLIN_CONFIGURATION_FLAGS: +JVM.EMIT_JVM_TYPE_ANNOTATIONS +// EMIT_JVM_TYPE_ANNOTATIONS // RENDER_ANNOTATIONS // TARGET_BACKEND: JVM // JVM_TARGET: 1.8 diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/defaultArgs.txt b/compiler/testData/codegen/asmLike/typeAnnotations/defaultArgs.asm.txt similarity index 99% rename from compiler/testData/codegen/asmLike/typeAnnotations/defaultArgs.txt rename to compiler/testData/codegen/asmLike/typeAnnotations/defaultArgs.asm.txt index e5331a0059f..1c76821c081 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/defaultArgs.txt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/defaultArgs.asm.txt @@ -13,4 +13,4 @@ public final class foo/Kotlin : java/lang/Object { public abstract interface foo/TypeAnn : java/lang/Object, java/lang/annotation/Annotation { public abstract java.lang.String name() -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/defaultArgs.kt b/compiler/testData/codegen/asmLike/typeAnnotations/defaultArgs.kt index 64c2d0a1410..dc96bc0ef2c 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/defaultArgs.kt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/defaultArgs.kt @@ -1,4 +1,4 @@ -// KOTLIN_CONFIGURATION_FLAGS: +JVM.EMIT_JVM_TYPE_ANNOTATIONS +// EMIT_JVM_TYPE_ANNOTATIONS // RENDER_ANNOTATIONS // TARGET_BACKEND: JVM // JVM_TARGET: 1.8 diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/dontEmit.txt b/compiler/testData/codegen/asmLike/typeAnnotations/dontEmit.asm.txt similarity index 99% rename from compiler/testData/codegen/asmLike/typeAnnotations/dontEmit.txt rename to compiler/testData/codegen/asmLike/typeAnnotations/dontEmit.asm.txt index 81c1c424b5e..5248b0558d6 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/dontEmit.txt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/dontEmit.asm.txt @@ -16,4 +16,4 @@ public abstract interface foo/TypeAnn : java/lang/Object, java/lang/annotation/A public abstract interface foo/TypeParameterAnn : java/lang/Object, java/lang/annotation/Annotation { public abstract java.lang.String name() -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor_ir.txt b/compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor.asm.ir.txt similarity index 99% rename from compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor_ir.txt rename to compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor.asm.ir.txt index 342fc638079..34e03ce6d07 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor_ir.txt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor.asm.ir.txt @@ -28,4 +28,4 @@ public class foo/Kotlin : java/lang/Enum { public abstract interface foo/TypeAnn : java/lang/Object, java/lang/annotation/Annotation { -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor.txt b/compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor.asm.txt similarity index 99% rename from compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor.txt rename to compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor.asm.txt index 2f205a14ffb..da3e6b0e1c2 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor.txt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor.asm.txt @@ -26,4 +26,4 @@ public class foo/Kotlin : java/lang/Enum { public abstract interface foo/TypeAnn : java/lang/Object, java/lang/annotation/Annotation { -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor.kt b/compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor.kt index d6e8ea3587d..0eb1aaa408b 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor.kt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor.kt @@ -1,5 +1,5 @@ -// IGNORE_BACKEND: JVM_IR -// KOTLIN_CONFIGURATION_FLAGS: +JVM.EMIT_JVM_TYPE_ANNOTATIONS +// IR_DIFFERENCE +// EMIT_JVM_TYPE_ANNOTATIONS // RENDER_ANNOTATIONS // TARGET_BACKEND: JVM // JVM_TARGET: 1.8 diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor_ir.kt b/compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor_ir.kt deleted file mode 100644 index 0288e0d1201..00000000000 --- a/compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor_ir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// IGNORE_BACKEND: JVM -// KOTLIN_CONFIGURATION_FLAGS: +JVM.EMIT_JVM_TYPE_ANNOTATIONS -// RENDER_ANNOTATIONS -// TARGET_BACKEND: JVM -// JVM_TARGET: 1.8 -package foo - - -@Target(AnnotationTarget.TYPE) -annotation class TypeAnn - -enum class Kotlin (s: @TypeAnn String) { - A("123") { - fun foo() {} - }; -} diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/extension.txt b/compiler/testData/codegen/asmLike/typeAnnotations/extension.asm.txt similarity index 100% rename from compiler/testData/codegen/asmLike/typeAnnotations/extension.txt rename to compiler/testData/codegen/asmLike/typeAnnotations/extension.asm.txt diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/extension.kt b/compiler/testData/codegen/asmLike/typeAnnotations/extension.kt index 7099052c911..5a687b96ab5 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/extension.kt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/extension.kt @@ -1,4 +1,4 @@ -// KOTLIN_CONFIGURATION_FLAGS: +JVM.EMIT_JVM_TYPE_ANNOTATIONS +// EMIT_JVM_TYPE_ANNOTATIONS // RENDER_ANNOTATIONS // TARGET_BACKEND: JVM // JVM_TARGET: 1.8 diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/functionTypeParameter.txt b/compiler/testData/codegen/asmLike/typeAnnotations/functionTypeParameter.asm.txt similarity index 100% rename from compiler/testData/codegen/asmLike/typeAnnotations/functionTypeParameter.txt rename to compiler/testData/codegen/asmLike/typeAnnotations/functionTypeParameter.asm.txt diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/functionTypeParameter.kt b/compiler/testData/codegen/asmLike/typeAnnotations/functionTypeParameter.kt index 131a7a99526..68dee46c8b6 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/functionTypeParameter.kt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/functionTypeParameter.kt @@ -1,7 +1,6 @@ -// IGNORE_BACKEND: JVM -// KOTLIN_CONFIGURATION_FLAGS: +JVM.EMIT_JVM_TYPE_ANNOTATIONS +// EMIT_JVM_TYPE_ANNOTATIONS // RENDER_ANNOTATIONS -// TARGET_BACKEND: JVM +// TARGET_BACKEND: JVM_IR // JVM_TARGET: 1.8 package foo diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/implicit_ir.txt b/compiler/testData/codegen/asmLike/typeAnnotations/implicit.asm.ir.txt similarity index 100% rename from compiler/testData/codegen/asmLike/typeAnnotations/implicit_ir.txt rename to compiler/testData/codegen/asmLike/typeAnnotations/implicit.asm.ir.txt diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/implicit.txt b/compiler/testData/codegen/asmLike/typeAnnotations/implicit.asm.txt similarity index 74% rename from compiler/testData/codegen/asmLike/typeAnnotations/implicit.txt rename to compiler/testData/codegen/asmLike/typeAnnotations/implicit.asm.txt index cc7fa96600f..9f2f72cdc58 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/implicit.txt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/implicit.asm.txt @@ -12,6 +12,20 @@ final class foo/Kotlin$foo4$1 : kotlin/jvm/internal/Lambda, kotlin/jvm/functions @Lfoo/TypeAnnBinary;([]) : METHOD_RETURN, null // invisible } +Lkotlin/jvm/internal/Lambda;Lkotlin/jvm/functions/Function0; +final class foo/Kotlin$foo5$lambda$1 : kotlin/jvm/internal/Lambda, kotlin/jvm/functions/Function0 { + final foo.Kotlin this$0 + + void (foo.Kotlin p0) + + public java.lang.Object invoke() + + public final java.lang.String invoke() + @Lorg/jetbrains/annotations/NotNull;([]) // invisible + @Lfoo/TypeAnn;([name="2"]) : METHOD_RETURN, null + @Lfoo/TypeAnnBinary;([]) : METHOD_RETURN, null // invisible +} + public final class foo/Kotlin : java/lang/Object { public void () @@ -29,6 +43,8 @@ public final class foo/Kotlin : java/lang/Object { @Lorg/jetbrains/annotations/NotNull;([]) // invisible @Lfoo/TypeAnn;([name="2"]) : METHOD_RETURN, null @Lfoo/TypeAnnBinary;([]) : METHOD_RETURN, null // invisible + + public final void foo5() } public abstract interface foo/TypeAnn : java/lang/Object, java/lang/annotation/Annotation { diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/implicit.kt b/compiler/testData/codegen/asmLike/typeAnnotations/implicit.kt index de18bfe9d7c..59c695f8cd6 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/implicit.kt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/implicit.kt @@ -1,5 +1,5 @@ -// IGNORE_BACKEND: JVM_IR -// KOTLIN_CONFIGURATION_FLAGS: +JVM.EMIT_JVM_TYPE_ANNOTATIONS +// IR_DIFFERENCE +// EMIT_JVM_TYPE_ANNOTATIONS // RENDER_ANNOTATIONS // TARGET_BACKEND: JVM // JVM_TARGET: 1.8 @@ -26,4 +26,8 @@ class Kotlin { fun foo4() = { foo2() }() + fun foo5() { + val lambda = { foo2() } + lambda() + } } diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/implicit_ir.kt b/compiler/testData/codegen/asmLike/typeAnnotations/implicit_ir.kt deleted file mode 100644 index 4c4beba1bb3..00000000000 --- a/compiler/testData/codegen/asmLike/typeAnnotations/implicit_ir.kt +++ /dev/null @@ -1,33 +0,0 @@ -// IGNORE_BACKEND: JVM -// KOTLIN_CONFIGURATION_FLAGS: +JVM.EMIT_JVM_TYPE_ANNOTATIONS -// RENDER_ANNOTATIONS -// TARGET_BACKEND: JVM -// JVM_TARGET: 1.8 -package foo - -@Target(AnnotationTarget.TYPE) -annotation class TypeAnn(val name: String) - -@Target(AnnotationTarget.TYPE) -@Retention(AnnotationRetention.BINARY) -annotation class TypeAnnBinary - -@Target(AnnotationTarget.TYPE) -@Retention(AnnotationRetention.SOURCE) -annotation class TypeAnnSource - -class Kotlin { - - fun foo2(): @TypeAnn("2") @TypeAnnBinary @TypeAnnSource String { - return "OK" - } - - fun foo3() = foo2() - - fun foo4() = { foo2() }() - - fun foo5() { - val lambda = { foo2() } - lambda() - } -} diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/innerClassConstructor.txt b/compiler/testData/codegen/asmLike/typeAnnotations/innerClassConstructor.asm.txt similarity index 100% rename from compiler/testData/codegen/asmLike/typeAnnotations/innerClassConstructor.txt rename to compiler/testData/codegen/asmLike/typeAnnotations/innerClassConstructor.asm.txt diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/innerClassConstructor.kt b/compiler/testData/codegen/asmLike/typeAnnotations/innerClassConstructor.kt index 8beb954499a..da56ee69539 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/innerClassConstructor.kt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/innerClassConstructor.kt @@ -1,4 +1,4 @@ -// KOTLIN_CONFIGURATION_FLAGS: +JVM.EMIT_JVM_TYPE_ANNOTATIONS +// EMIT_JVM_TYPE_ANNOTATIONS // RENDER_ANNOTATIONS // TARGET_BACKEND: JVM // JVM_TARGET: 1.8 @@ -9,4 +9,4 @@ annotation class TypeAnn class Kotlin { inner class Inner(s: @TypeAnn String) {} -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/jvmOverload.txt b/compiler/testData/codegen/asmLike/typeAnnotations/jvmOverload.asm.txt similarity index 99% rename from compiler/testData/codegen/asmLike/typeAnnotations/jvmOverload.txt rename to compiler/testData/codegen/asmLike/typeAnnotations/jvmOverload.asm.txt index f03f59faafa..223bf3cbfa4 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/jvmOverload.txt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/jvmOverload.asm.txt @@ -26,4 +26,4 @@ public final class foo/FooClass : java/lang/Object { public abstract interface foo/TypeAnn : java/lang/Object, java/lang/annotation/Annotation { public abstract java.lang.String name() -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/jvmOverload.kt b/compiler/testData/codegen/asmLike/typeAnnotations/jvmOverload.kt index ecf329bca09..3f7163a2540 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/jvmOverload.kt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/jvmOverload.kt @@ -1,4 +1,4 @@ -// KOTLIN_CONFIGURATION_FLAGS: +JVM.EMIT_JVM_TYPE_ANNOTATIONS +// EMIT_JVM_TYPE_ANNOTATIONS // RENDER_ANNOTATIONS // TARGET_BACKEND: JVM // JVM_TARGET: 1.8 diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/jvmStatic.txt b/compiler/testData/codegen/asmLike/typeAnnotations/jvmStatic.asm.txt similarity index 99% rename from compiler/testData/codegen/asmLike/typeAnnotations/jvmStatic.txt rename to compiler/testData/codegen/asmLike/typeAnnotations/jvmStatic.asm.txt index 60542318cf3..a83ca6cecb7 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/jvmStatic.txt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/jvmStatic.asm.txt @@ -48,4 +48,4 @@ public final class foo/FooClass : java/lang/Object { public abstract interface foo/TypeAnn : java/lang/Object, java/lang/annotation/Annotation { public abstract java.lang.String name() -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/jvmStatic.kt b/compiler/testData/codegen/asmLike/typeAnnotations/jvmStatic.kt index 0cccd8dbdbc..3bfdbc52d17 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/jvmStatic.kt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/jvmStatic.kt @@ -1,4 +1,4 @@ -// KOTLIN_CONFIGURATION_FLAGS: +JVM.EMIT_JVM_TYPE_ANNOTATIONS +// EMIT_JVM_TYPE_ANNOTATIONS // RENDER_ANNOTATIONS // TARGET_BACKEND: JVM // JVM_TARGET: 1.8 @@ -24,4 +24,4 @@ object Foo { fun foo(s: @TypeAnn("1") String , x: @TypeAnn("2") Int): @TypeAnn("return") Any? { return null } -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/notYetSupported.txt b/compiler/testData/codegen/asmLike/typeAnnotations/notYetSupported.asm.txt similarity index 99% rename from compiler/testData/codegen/asmLike/typeAnnotations/notYetSupported.txt rename to compiler/testData/codegen/asmLike/typeAnnotations/notYetSupported.asm.txt index d57c439c588..a1a63c5ce48 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/notYetSupported.txt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/notYetSupported.asm.txt @@ -78,4 +78,4 @@ public final class foo/Outer : java/lang/Object { ;>;>Ljava/lang/Object; public final class foo/WithBound : java/lang/Object { public void () -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/notYetSupported.kt b/compiler/testData/codegen/asmLike/typeAnnotations/notYetSupported.kt index 70fec287530..42b412cc4ea 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/notYetSupported.kt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/notYetSupported.kt @@ -1,4 +1,4 @@ -// KOTLIN_CONFIGURATION_FLAGS: +JVM.EMIT_JVM_TYPE_ANNOTATIONS +// EMIT_JVM_TYPE_ANNOTATIONS // RENDER_ANNOTATIONS // TARGET_BACKEND: JVM // JVM_TARGET: 1.8 @@ -57,4 +57,4 @@ class Kotlin { } -class WithBound>>() \ No newline at end of file +class WithBound>>() diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/property.txt b/compiler/testData/codegen/asmLike/typeAnnotations/property.asm.txt similarity index 100% rename from compiler/testData/codegen/asmLike/typeAnnotations/property.txt rename to compiler/testData/codegen/asmLike/typeAnnotations/property.asm.txt diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/property.kt b/compiler/testData/codegen/asmLike/typeAnnotations/property.kt index f36abaec3dc..cfde5196db5 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/property.kt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/property.kt @@ -1,4 +1,4 @@ -// KOTLIN_CONFIGURATION_FLAGS: +JVM.EMIT_JVM_TYPE_ANNOTATIONS +// EMIT_JVM_TYPE_ANNOTATIONS // RENDER_ANNOTATIONS // TARGET_BACKEND: JVM // JVM_TARGET: 1.8 diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/propertyTypeParameter.txt b/compiler/testData/codegen/asmLike/typeAnnotations/propertyTypeParameter.asm.txt similarity index 100% rename from compiler/testData/codegen/asmLike/typeAnnotations/propertyTypeParameter.txt rename to compiler/testData/codegen/asmLike/typeAnnotations/propertyTypeParameter.asm.txt diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/propertyTypeParameter.kt b/compiler/testData/codegen/asmLike/typeAnnotations/propertyTypeParameter.kt index e6f709dc177..7beab4bcdcf 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/propertyTypeParameter.kt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/propertyTypeParameter.kt @@ -1,7 +1,6 @@ -// IGNORE_BACKEND: JVM -// KOTLIN_CONFIGURATION_FLAGS: +JVM.EMIT_JVM_TYPE_ANNOTATIONS +// EMIT_JVM_TYPE_ANNOTATIONS // RENDER_ANNOTATIONS -// TARGET_BACKEND: JVM +// TARGET_BACKEND: JVM_IR // JVM_TARGET: 1.8 package foo diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/simple.txt b/compiler/testData/codegen/asmLike/typeAnnotations/simple.asm.txt similarity index 99% rename from compiler/testData/codegen/asmLike/typeAnnotations/simple.txt rename to compiler/testData/codegen/asmLike/typeAnnotations/simple.asm.txt index ba3fad7b5e9..f061745d652 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/simple.txt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/simple.asm.txt @@ -32,4 +32,4 @@ public abstract interface foo/TypeAnnBinary : java/lang/Object, java/lang/annota public abstract interface foo/TypeAnnSource : java/lang/Object, java/lang/annotation/Annotation { -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/simple.kt b/compiler/testData/codegen/asmLike/typeAnnotations/simple.kt index 5cdff853256..8554ad1a153 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/simple.kt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/simple.kt @@ -1,4 +1,4 @@ -// KOTLIN_CONFIGURATION_FLAGS: +JVM.EMIT_JVM_TYPE_ANNOTATIONS +// EMIT_JVM_TYPE_ANNOTATIONS // RENDER_ANNOTATIONS // TARGET_BACKEND: JVM // JVM_TARGET: 1.8 diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/simple2Params.txt b/compiler/testData/codegen/asmLike/typeAnnotations/simple2Params.asm.txt similarity index 99% rename from compiler/testData/codegen/asmLike/typeAnnotations/simple2Params.txt rename to compiler/testData/codegen/asmLike/typeAnnotations/simple2Params.asm.txt index febba4e2608..097e8dfff8e 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/simple2Params.txt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/simple2Params.asm.txt @@ -15,4 +15,4 @@ public final class foo/Kotlin : java/lang/Object { public abstract interface foo/TypeAnn : java/lang/Object, java/lang/annotation/Annotation { public abstract java.lang.String name() -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/simple2Params.kt b/compiler/testData/codegen/asmLike/typeAnnotations/simple2Params.kt index f7cb205273f..02f6ff39161 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/simple2Params.kt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/simple2Params.kt @@ -1,4 +1,4 @@ -// KOTLIN_CONFIGURATION_FLAGS: +JVM.EMIT_JVM_TYPE_ANNOTATIONS +// EMIT_JVM_TYPE_ANNOTATIONS // RENDER_ANNOTATIONS // TARGET_BACKEND: JVM // JVM_TARGET: 1.8 diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/staticNested.txt b/compiler/testData/codegen/asmLike/typeAnnotations/staticNested.asm.txt similarity index 100% rename from compiler/testData/codegen/asmLike/typeAnnotations/staticNested.txt rename to compiler/testData/codegen/asmLike/typeAnnotations/staticNested.asm.txt diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/staticNested.kt b/compiler/testData/codegen/asmLike/typeAnnotations/staticNested.kt index 5f01e93385a..ffb012cf64e 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/staticNested.kt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/staticNested.kt @@ -1,4 +1,4 @@ -// KOTLIN_CONFIGURATION_FLAGS: +JVM.EMIT_JVM_TYPE_ANNOTATIONS +// EMIT_JVM_TYPE_ANNOTATIONS // RENDER_ANNOTATIONS // TARGET_BACKEND: JVM // JVM_TARGET: 1.8 diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/syntheticAccessors.txt b/compiler/testData/codegen/asmLike/typeAnnotations/syntheticAccessors.asm.txt similarity index 100% rename from compiler/testData/codegen/asmLike/typeAnnotations/syntheticAccessors.txt rename to compiler/testData/codegen/asmLike/typeAnnotations/syntheticAccessors.asm.txt diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/syntheticAccessors.kt b/compiler/testData/codegen/asmLike/typeAnnotations/syntheticAccessors.kt index af50dfcae45..fc2c2ec543a 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/syntheticAccessors.kt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/syntheticAccessors.kt @@ -1,4 +1,4 @@ -// KOTLIN_CONFIGURATION_FLAGS: +JVM.EMIT_JVM_TYPE_ANNOTATIONS +// EMIT_JVM_TYPE_ANNOTATIONS // RENDER_ANNOTATIONS // TARGET_BACKEND: JVM // JVM_TARGET: 1.8 diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/typeParameter.txt b/compiler/testData/codegen/asmLike/typeAnnotations/typeParameter.asm.txt similarity index 100% rename from compiler/testData/codegen/asmLike/typeAnnotations/typeParameter.txt rename to compiler/testData/codegen/asmLike/typeAnnotations/typeParameter.asm.txt diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/typeParameter.kt b/compiler/testData/codegen/asmLike/typeAnnotations/typeParameter.kt index 91130363833..72873ea8484 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/typeParameter.kt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/typeParameter.kt @@ -1,6 +1,5 @@ -// IGNORE_BACKEND: JVM // RENDER_ANNOTATIONS -// TARGET_BACKEND: JVM +// TARGET_BACKEND: JVM_IR // JVM_TARGET: 1.8 package foo diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/typeParameter16.txt b/compiler/testData/codegen/asmLike/typeAnnotations/typeParameter16.asm.txt similarity index 100% rename from compiler/testData/codegen/asmLike/typeAnnotations/typeParameter16.txt rename to compiler/testData/codegen/asmLike/typeAnnotations/typeParameter16.asm.txt diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/AsmLikeInstructionListingTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/AsmLikeInstructionListingTestGenerated.java similarity index 76% rename from compiler/tests-gen/org/jetbrains/kotlin/codegen/AsmLikeInstructionListingTestGenerated.java rename to compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/AsmLikeInstructionListingTestGenerated.java index 49f0892cd76..2f85d7d6e42 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/AsmLikeInstructionListingTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/AsmLikeInstructionListingTestGenerated.java @@ -3,228 +3,216 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.codegen; +package org.jetbrains.kotlin.test.runners.codegen; import com.intellij.testFramework.TestDataPath; -import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; -import org.jetbrains.kotlin.test.KotlinTestUtils; import org.jetbrains.kotlin.test.util.KtTestUtil; import org.jetbrains.kotlin.test.TargetBackend; import org.jetbrains.kotlin.test.TestMetadata; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; import java.io.File; import java.util.regex.Pattern; -/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ +/** This class is generated by {@link GenerateNewCompilerTests.kt}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") @TestMetadata("compiler/testData/codegen/asmLike") @TestDataPath("$PROJECT_ROOT") -@RunWith(JUnit3RunnerWithInners.class) public class AsmLikeInstructionListingTestGenerated extends AbstractAsmLikeInstructionListingTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + @Test public void testAllFilesPresentInAsmLike() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/asmLike"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Nested @TestMetadata("compiler/testData/codegen/asmLike/receiverMangling") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ReceiverMangling extends AbstractAsmLikeInstructionListingTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class ReceiverMangling { + @Test public void testAllFilesPresentInReceiverMangling() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/asmLike/receiverMangling"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("deepInline.kt") public void testDeepInline() throws Exception { runTest("compiler/testData/codegen/asmLike/receiverMangling/deepInline.kt"); } + @Test @TestMetadata("deepInlineWithLabels.kt") public void testDeepInlineWithLabels() throws Exception { runTest("compiler/testData/codegen/asmLike/receiverMangling/deepInlineWithLabels.kt"); } + @Test @TestMetadata("deepNoinlineWithLabels_after.kt") public void testDeepNoinlineWithLabels_after() throws Exception { runTest("compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_after.kt"); } + @Test @TestMetadata("deepNoinlineWithLabels_before.kt") public void testDeepNoinlineWithLabels_before() throws Exception { runTest("compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_before.kt"); } + @Test @TestMetadata("deepNoinline_after.kt") public void testDeepNoinline_after() throws Exception { runTest("compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_after.kt"); } + @Test @TestMetadata("deepNoinline_before.kt") public void testDeepNoinline_before() throws Exception { runTest("compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_before.kt"); } + @Test @TestMetadata("inlineClassCapture.kt") public void testInlineClassCapture() throws Exception { runTest("compiler/testData/codegen/asmLike/receiverMangling/inlineClassCapture.kt"); } + @Test @TestMetadata("inlineReceivers.kt") public void testInlineReceivers() throws Exception { runTest("compiler/testData/codegen/asmLike/receiverMangling/inlineReceivers.kt"); } + @Test @TestMetadata("localFunctions.kt") public void testLocalFunctions() throws Exception { runTest("compiler/testData/codegen/asmLike/receiverMangling/localFunctions.kt"); } + @Test @TestMetadata("mangledNames.kt") public void testMangledNames() throws Exception { runTest("compiler/testData/codegen/asmLike/receiverMangling/mangledNames.kt"); } + @Test @TestMetadata("nonInlineReceivers_after.kt") public void testNonInlineReceivers_after() throws Exception { runTest("compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_after.kt"); } + @Test @TestMetadata("nonInlineReceivers_before.kt") public void testNonInlineReceivers_before() throws Exception { runTest("compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_before.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/asmLike/typeAnnotations") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class TypeAnnotations extends AbstractAsmLikeInstructionListingTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class TypeAnnotations { + @Test public void testAllFilesPresentInTypeAnnotations() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/asmLike/typeAnnotations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } - @TestMetadata("classTypeParameter.kt") - public void testClassTypeParameter() throws Exception { - runTest("compiler/testData/codegen/asmLike/typeAnnotations/classTypeParameter.kt"); - } - + @Test @TestMetadata("complex.kt") public void testComplex() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/complex.kt"); } + @Test @TestMetadata("constructor.kt") public void testConstructor() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/constructor.kt"); } + @Test @TestMetadata("defaultArgs.kt") public void testDefaultArgs() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/defaultArgs.kt"); } + @Test @TestMetadata("dontEmit.kt") public void testDontEmit() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/dontEmit.kt"); } + @Test @TestMetadata("enumClassConstructor.kt") public void testEnumClassConstructor() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor.kt"); } - @TestMetadata("enumClassConstructor_ir.kt") - public void testEnumClassConstructor_ir() throws Exception { - runTest("compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor_ir.kt"); - } - + @Test @TestMetadata("extension.kt") public void testExtension() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/extension.kt"); } - @TestMetadata("functionTypeParameter.kt") - public void testFunctionTypeParameter() throws Exception { - runTest("compiler/testData/codegen/asmLike/typeAnnotations/functionTypeParameter.kt"); - } - + @Test @TestMetadata("implicit.kt") public void testImplicit() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/implicit.kt"); } - @TestMetadata("implicit_ir.kt") - public void testImplicit_ir() throws Exception { - runTest("compiler/testData/codegen/asmLike/typeAnnotations/implicit_ir.kt"); - } - + @Test @TestMetadata("innerClassConstructor.kt") public void testInnerClassConstructor() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/innerClassConstructor.kt"); } + @Test @TestMetadata("jvmOverload.kt") public void testJvmOverload() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/jvmOverload.kt"); } + @Test @TestMetadata("jvmStatic.kt") public void testJvmStatic() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/jvmStatic.kt"); } + @Test @TestMetadata("notYetSupported.kt") public void testNotYetSupported() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/notYetSupported.kt"); } + @Test @TestMetadata("property.kt") public void testProperty() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/property.kt"); } - @TestMetadata("propertyTypeParameter.kt") - public void testPropertyTypeParameter() throws Exception { - runTest("compiler/testData/codegen/asmLike/typeAnnotations/propertyTypeParameter.kt"); - } - + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/simple.kt"); } + @Test @TestMetadata("simple2Params.kt") public void testSimple2Params() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/simple2Params.kt"); } + @Test @TestMetadata("staticNested.kt") public void testStaticNested() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/staticNested.kt"); } + @Test @TestMetadata("syntheticAccessors.kt") public void testSyntheticAccessors() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/syntheticAccessors.kt"); } - @TestMetadata("typeParameter.kt") - public void testTypeParameter() throws Exception { - runTest("compiler/testData/codegen/asmLike/typeAnnotations/typeParameter.kt"); - } - + @Test @TestMetadata("typeParameter16.kt") public void testTypeParameter16() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/typeParameter16.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrAsmLikeInstructionListingTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrAsmLikeInstructionListingTestGenerated.java similarity index 84% rename from compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrAsmLikeInstructionListingTestGenerated.java rename to compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrAsmLikeInstructionListingTestGenerated.java index 3b137363bca..908681d5200 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrAsmLikeInstructionListingTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrAsmLikeInstructionListingTestGenerated.java @@ -3,228 +3,240 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.codegen.ir; +package org.jetbrains.kotlin.test.runners.codegen; import com.intellij.testFramework.TestDataPath; -import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; -import org.jetbrains.kotlin.test.KotlinTestUtils; import org.jetbrains.kotlin.test.util.KtTestUtil; import org.jetbrains.kotlin.test.TargetBackend; import org.jetbrains.kotlin.test.TestMetadata; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; import java.io.File; import java.util.regex.Pattern; -/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ +/** This class is generated by {@link GenerateNewCompilerTests.kt}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") @TestMetadata("compiler/testData/codegen/asmLike") @TestDataPath("$PROJECT_ROOT") -@RunWith(JUnit3RunnerWithInners.class) public class IrAsmLikeInstructionListingTestGenerated extends AbstractIrAsmLikeInstructionListingTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + @Test public void testAllFilesPresentInAsmLike() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/asmLike"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Nested @TestMetadata("compiler/testData/codegen/asmLike/receiverMangling") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ReceiverMangling extends AbstractIrAsmLikeInstructionListingTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class ReceiverMangling { + @Test public void testAllFilesPresentInReceiverMangling() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/asmLike/receiverMangling"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("deepInline.kt") public void testDeepInline() throws Exception { runTest("compiler/testData/codegen/asmLike/receiverMangling/deepInline.kt"); } + @Test @TestMetadata("deepInlineWithLabels.kt") public void testDeepInlineWithLabels() throws Exception { runTest("compiler/testData/codegen/asmLike/receiverMangling/deepInlineWithLabels.kt"); } + @Test @TestMetadata("deepNoinlineWithLabels_after.kt") public void testDeepNoinlineWithLabels_after() throws Exception { runTest("compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_after.kt"); } + @Test @TestMetadata("deepNoinlineWithLabels_before.kt") public void testDeepNoinlineWithLabels_before() throws Exception { runTest("compiler/testData/codegen/asmLike/receiverMangling/deepNoinlineWithLabels_before.kt"); } + @Test @TestMetadata("deepNoinline_after.kt") public void testDeepNoinline_after() throws Exception { runTest("compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_after.kt"); } + @Test @TestMetadata("deepNoinline_before.kt") public void testDeepNoinline_before() throws Exception { runTest("compiler/testData/codegen/asmLike/receiverMangling/deepNoinline_before.kt"); } + @Test @TestMetadata("inlineClassCapture.kt") public void testInlineClassCapture() throws Exception { runTest("compiler/testData/codegen/asmLike/receiverMangling/inlineClassCapture.kt"); } + @Test @TestMetadata("inlineReceivers.kt") public void testInlineReceivers() throws Exception { runTest("compiler/testData/codegen/asmLike/receiverMangling/inlineReceivers.kt"); } + @Test @TestMetadata("localFunctions.kt") public void testLocalFunctions() throws Exception { runTest("compiler/testData/codegen/asmLike/receiverMangling/localFunctions.kt"); } + @Test @TestMetadata("mangledNames.kt") public void testMangledNames() throws Exception { runTest("compiler/testData/codegen/asmLike/receiverMangling/mangledNames.kt"); } + @Test @TestMetadata("nonInlineReceivers_after.kt") public void testNonInlineReceivers_after() throws Exception { runTest("compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_after.kt"); } + @Test @TestMetadata("nonInlineReceivers_before.kt") public void testNonInlineReceivers_before() throws Exception { runTest("compiler/testData/codegen/asmLike/receiverMangling/nonInlineReceivers_before.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/asmLike/typeAnnotations") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class TypeAnnotations extends AbstractIrAsmLikeInstructionListingTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class TypeAnnotations { + @Test public void testAllFilesPresentInTypeAnnotations() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/asmLike/typeAnnotations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("classTypeParameter.kt") public void testClassTypeParameter() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/classTypeParameter.kt"); } + @Test @TestMetadata("complex.kt") public void testComplex() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/complex.kt"); } + @Test @TestMetadata("constructor.kt") public void testConstructor() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/constructor.kt"); } + @Test @TestMetadata("defaultArgs.kt") public void testDefaultArgs() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/defaultArgs.kt"); } + @Test @TestMetadata("dontEmit.kt") public void testDontEmit() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/dontEmit.kt"); } + @Test @TestMetadata("enumClassConstructor.kt") public void testEnumClassConstructor() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor.kt"); } - @TestMetadata("enumClassConstructor_ir.kt") - public void testEnumClassConstructor_ir() throws Exception { - runTest("compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor_ir.kt"); - } - + @Test @TestMetadata("extension.kt") public void testExtension() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/extension.kt"); } + @Test @TestMetadata("functionTypeParameter.kt") public void testFunctionTypeParameter() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/functionTypeParameter.kt"); } + @Test @TestMetadata("implicit.kt") public void testImplicit() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/implicit.kt"); } - @TestMetadata("implicit_ir.kt") - public void testImplicit_ir() throws Exception { - runTest("compiler/testData/codegen/asmLike/typeAnnotations/implicit_ir.kt"); - } - + @Test @TestMetadata("innerClassConstructor.kt") public void testInnerClassConstructor() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/innerClassConstructor.kt"); } + @Test @TestMetadata("jvmOverload.kt") public void testJvmOverload() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/jvmOverload.kt"); } + @Test @TestMetadata("jvmStatic.kt") public void testJvmStatic() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/jvmStatic.kt"); } + @Test @TestMetadata("notYetSupported.kt") public void testNotYetSupported() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/notYetSupported.kt"); } + @Test @TestMetadata("property.kt") public void testProperty() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/property.kt"); } + @Test @TestMetadata("propertyTypeParameter.kt") public void testPropertyTypeParameter() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/propertyTypeParameter.kt"); } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/simple.kt"); } + @Test @TestMetadata("simple2Params.kt") public void testSimple2Params() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/simple2Params.kt"); } + @Test @TestMetadata("staticNested.kt") public void testStaticNested() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/staticNested.kt"); } + @Test @TestMetadata("syntheticAccessors.kt") public void testSyntheticAccessors() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/syntheticAccessors.kt"); } + @Test @TestMetadata("typeParameter.kt") public void testTypeParameter() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/typeParameter.kt"); } + @Test @TestMetadata("typeParameter16.kt") public void testTypeParameter16() throws Exception { runTest("compiler/testData/codegen/asmLike/typeAnnotations/typeParameter16.kt"); diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/AsmLikeInstructionListingHandler.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/AsmLikeInstructionListingHandler.kt new file mode 100644 index 00000000000..239b845f39c --- /dev/null +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/AsmLikeInstructionListingHandler.kt @@ -0,0 +1,391 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.test.backend.handlers + +import org.jetbrains.kotlin.codegen.DefaultParameterValueSubstitutor +import org.jetbrains.kotlin.codegen.getClassFiles +import org.jetbrains.kotlin.test.directives.AsmLikeInstructionListingDirectives +import org.jetbrains.kotlin.test.directives.AsmLikeInstructionListingDirectives.CHECK_ASM_LIKE_INSTRUCTIONS +import org.jetbrains.kotlin.test.directives.AsmLikeInstructionListingDirectives.CURIOUS_ABOUT +import org.jetbrains.kotlin.test.directives.AsmLikeInstructionListingDirectives.IR_DIFFERENCE +import org.jetbrains.kotlin.test.directives.AsmLikeInstructionListingDirectives.LOCAL_VARIABLE_TABLE +import org.jetbrains.kotlin.test.directives.AsmLikeInstructionListingDirectives.RENDER_ANNOTATIONS +import org.jetbrains.kotlin.test.directives.model.DirectivesContainer +import org.jetbrains.kotlin.test.model.BinaryArtifacts +import org.jetbrains.kotlin.test.model.TestModule +import org.jetbrains.kotlin.test.services.TestServices +import org.jetbrains.kotlin.test.services.moduleStructure +import org.jetbrains.kotlin.test.utils.MultiModuleInfoDumper +import org.jetbrains.kotlin.test.utils.withExtension +import org.jetbrains.org.objectweb.asm.ClassReader +import org.jetbrains.org.objectweb.asm.Label +import org.jetbrains.org.objectweb.asm.Opcodes +import org.jetbrains.org.objectweb.asm.Type +import org.jetbrains.org.objectweb.asm.tree.* +import org.jetbrains.org.objectweb.asm.util.Printer +import org.jetbrains.org.objectweb.asm.util.Textifier +import org.jetbrains.org.objectweb.asm.util.TraceFieldVisitor +import org.jetbrains.org.objectweb.asm.util.TraceMethodVisitor + +class AsmLikeInstructionListingHandler(testServices: TestServices) : JvmBinaryArtifactHandler(testServices) { + companion object { + const val DUMP_EXTENSION = "asm.txt" + const val IR_DUMP_EXTENSION = "asm.ir.txt" + const val LINE_SEPARATOR = "\n" + + val IGNORED_CLASS_VISIBLE_ANNOTATIONS = setOf( + "Lkotlin/Metadata;", + "Lkotlin/annotation/Target;", + "Lkotlin/annotation/Retention;", + "Ljava/lang/annotation/Retention;", + "Ljava/lang/annotation/Target;" + ) + } + + override val directiveContainers: List + get() = listOf(AsmLikeInstructionListingDirectives) + + private val baseDumper = MultiModuleInfoDumper() + + override fun processModule(module: TestModule, info: BinaryArtifacts.Jvm) { + if (CHECK_ASM_LIKE_INSTRUCTIONS !in module.directives) return + val builder = baseDumper.builderForModule(module) + val classes = info.classFileFactory + .getClassFiles() + .sortedBy { it.relativePath } + .map { file -> ClassNode().also { ClassReader(file.asByteArray()).accept(it, ClassReader.EXPAND_FRAMES) } } + + val printBytecodeForTheseMethods = module.directives[CURIOUS_ABOUT] + val showLocalVariables = LOCAL_VARIABLE_TABLE in module.directives + val renderAnnotations = RENDER_ANNOTATIONS in module.directives + + classes.forEachIndexed { index, classNode -> + builder.renderClassNode(classNode, printBytecodeForTheseMethods, showLocalVariables, renderAnnotations) + builder.appendLine() + if (index != classes.indices.last) { + builder.appendLine() + } + } + } + + private fun StringBuilder.renderClassNode( + clazz: ClassNode, + showBytecodeForTheseMethods: List, + showLocalVariables: Boolean, + renderAnnotations: Boolean + ) { + val fields = (clazz.fields ?: emptyList()).sortedBy { it.name } + val methods = (clazz.methods ?: emptyList()).sortedBy { it.name } + + val superTypes = (listOf(clazz.superName) + clazz.interfaces).filterNotNull() + + if (renderAnnotations) { + clazz.signature?.let { + appendLine(it) + } + } + renderVisibilityModifiers(clazz.access) + renderModalityModifiers(clazz.access) + append(if ((clazz.access and Opcodes.ACC_INTERFACE) != 0) "interface " else "class ") + append(clazz.name) + + if (superTypes.isNotEmpty()) { + append(" : " + superTypes.joinToString()) + } + + appendLine(" {") + + if (renderAnnotations) { + val textifier = Textifier() + val visitor = TraceMethodVisitor(textifier) + + clazz.visibleAnnotations?.forEach { + if (it.desc !in IGNORED_CLASS_VISIBLE_ANNOTATIONS) { + it.accept(visitor.visitAnnotation(it.desc, true)) + } + } + clazz.invisibleAnnotations?.forEach { + it.accept(visitor.visitAnnotation(it.desc, false)) + } + + clazz.visibleTypeAnnotations?.forEach { + it.accept(visitor.visitTypeAnnotation(it.typeRef, it.typePath, it.desc, true)) + } + clazz.invisibleTypeAnnotations?.forEach { + it.accept(visitor.visitTypeAnnotation(it.typeRef, it.typePath, it.desc, false)) + } + + textifier.getText().takeIf { it.isNotEmpty() }?.let { + appendLine(textifier.getText().joinToString("").trimEnd()) + appendLine("") + } + } + + fields.joinTo(this, LINE_SEPARATOR.repeat(2)) { renderField(it, renderAnnotations).withMargin() } + + if (fields.isNotEmpty()) { + appendLine().appendLine() + } + + methods.joinTo(this, LINE_SEPARATOR.repeat(2)) { + val showBytecode = showBytecodeForTheseMethods.contains(it.name) + renderMethod(it, showBytecode, showLocalVariables, renderAnnotations).withMargin() + } + + appendLine().append("}") + } + + private fun renderField(field: FieldNode, renderAnnotations: Boolean): String = buildString { + if (renderAnnotations) { + field.signature?.let { + append(it).append("\n") + } + } + renderVisibilityModifiers(field.access) + renderModalityModifiers(field.access) + append(Type.getType(field.desc).className).append(' ') + append(field.name) + + if (renderAnnotations) { + val textifier = Textifier() + val visitor = TraceFieldVisitor(textifier) + + field.visibleAnnotations?.forEach { + it.accept(visitor.visitAnnotation(it.desc, true)) + } + field.invisibleAnnotations?.forEach { + it.accept(visitor.visitAnnotation(it.desc, false)) + } + + field.visibleTypeAnnotations?.forEach { + it.accept(visitor.visitTypeAnnotation(it.typeRef, it.typePath, it.desc, true)) + } + field.invisibleTypeAnnotations?.forEach { + it.accept(visitor.visitTypeAnnotation(it.typeRef, it.typePath, it.desc, false)) + } + textifier.getText().takeIf { it.isNotEmpty() }?.let { + append("\n${textifier.getText().joinToString("").trimEnd()}") + } + } + } + + private fun renderMethod( + method: MethodNode, + showBytecode: Boolean, + showLocalVariables: Boolean, + renderAnnotations: Boolean + ): String = buildString { + if (renderAnnotations) { + method.signature?.let { + append(it).append("\n") + } + } + + renderVisibilityModifiers(method.access) + renderModalityModifiers(method.access) + val (returnType, parameterTypes) = with(Type.getMethodType(method.desc)) { returnType to argumentTypes } + append(returnType.className).append(' ') + append(method.name) + + parameterTypes.mapIndexed { index, type -> + val name = getParameterName(index, method) + "${type.className} $name" + }.joinTo(this, prefix = "(", postfix = ")") + + if (renderAnnotations) { + val textifier = Textifier() + val visitor = TraceMethodVisitor(textifier) + + method.visibleAnnotations?.forEach { + it.accept(visitor.visitAnnotation(it.desc, true)) + } + method.invisibleAnnotations?.forEach { + it.accept(visitor.visitAnnotation(it.desc, false)) + } + + method.visibleTypeAnnotations?.forEach { + it.accept(visitor.visitTypeAnnotation(it.typeRef, it.typePath, it.desc, true)) + } + method.invisibleTypeAnnotations?.forEach { + it.accept(visitor.visitTypeAnnotation(it.typeRef, it.typePath, it.desc, false)) + } + + method.visibleParameterAnnotations?.forEachIndexed { index, parameterAnnotations: MutableList? -> + parameterAnnotations?.forEach { + it.accept( + visitor.visitParameterAnnotation( + index, + it.desc, + true + ) + ) + } + } + method.invisibleParameterAnnotations?.forEachIndexed { index, parameterAnnotations: MutableList? -> + parameterAnnotations?.forEach { + it.accept( + visitor.visitParameterAnnotation( + index, + it.desc, + false + ) + ) + } + } + textifier.getText().takeIf { it.isNotEmpty() }?.let { + append("\n${textifier.getText().joinToString("").trimEnd()}") + } + } + + val actualShowBytecode = showBytecode && (method.access and Opcodes.ACC_ABSTRACT) == 0 + val actualShowLocalVariables = showLocalVariables && method.localVariables?.takeIf { it.isNotEmpty() } != null + + if (actualShowBytecode || actualShowLocalVariables) { + appendLine(" {") + + if (actualShowLocalVariables) { + val localVariableTable = buildLocalVariableTable(method) + if (localVariableTable.isNotEmpty()) { + append(localVariableTable.withMargin()) + } + } + + if (actualShowBytecode) { + if (actualShowLocalVariables) { + appendLine().appendLine() + } + append(renderBytecodeInstructions(method.instructions).trimEnd().withMargin()) + } + + appendLine().append("}") + + method.visibleTypeAnnotations + } + } + + private fun getParameterName(index: Int, method: MethodNode): String { + val localVariableIndexOffset = when { + (method.access and Opcodes.ACC_STATIC) != 0 -> 0 + method.isJvmOverloadsGenerated() -> 0 + else -> 1 + } + + val actualIndex = index + localVariableIndexOffset + val localVariables = method.localVariables + return localVariables?.firstOrNull { + it.index == actualIndex + }?.name ?: "p$index" + } + + private fun buildLocalVariableTable(method: MethodNode): String { + val localVariables = method.localVariables?.takeIf { it.isNotEmpty() } ?: return "" + return buildString { + append("Local variables:") + for (variable in localVariables) { + appendLine().append((variable.index.toString() + " " + variable.name + ": " + variable.desc).withMargin()) + } + } + } + + private fun renderBytecodeInstructions(instructions: InsnList) = buildString { + val labelMappings = LabelMappings() + + var currentInsn = instructions.first + while (currentInsn != null) { + renderInstruction(currentInsn, labelMappings) + currentInsn = currentInsn.next + } + } + + private fun StringBuilder.renderInstruction(node: AbstractInsnNode, labelMappings: LabelMappings) { + if (node is LabelNode) { + appendLine("LABEL (L" + labelMappings[node.label] + ")") + return + } + + if (node is LineNumberNode) { + appendLine("LINENUMBER (" + node.line + ")") + return + } + + if (node is FrameNode) return + + append(" ").append(Printer.OPCODES[node.opcode] ?: error("Invalid opcode ${node.opcode}")) + + when (node) { + is FieldInsnNode -> append(" (" + node.owner + ", " + node.name + ", " + node.desc + ")") + is JumpInsnNode -> append(" (L" + labelMappings[node.label.label] + ")") + is IntInsnNode -> append(" (" + node.operand + ")") + is MethodInsnNode -> append(" (" + node.owner + ", "+ node.name + ", " + node.desc + ")") + is VarInsnNode -> append(" (" + node.`var` + ")") + is LdcInsnNode -> append(" (" + node.cst + ")") + } + + appendLine() + } + + private fun String.withMargin(margin: String = " "): String { + return lineSequence().map { margin + it }.joinToString(LINE_SEPARATOR) + } + + private fun StringBuilder.renderVisibilityModifiers(access: Int) { + if ((access and Opcodes.ACC_PUBLIC) != 0) append("public ") + if ((access and Opcodes.ACC_PRIVATE) != 0) append("private ") + if ((access and Opcodes.ACC_PROTECTED) != 0) append("protected ") + } + + private fun StringBuilder.renderModalityModifiers(access: Int) { + if ((access and Opcodes.ACC_FINAL) != 0) append("final ") + if ((access and Opcodes.ACC_ABSTRACT) != 0) append("abstract ") + if ((access and Opcodes.ACC_STATIC) != 0) append("static ") + } + + private class LabelMappings { + private var mappings = hashMapOf() + private var currentIndex = 0 + + operator fun get(label: Label): Int { + val hashCode = System.identityHashCode(label) + return mappings.getOrPut(hashCode) { currentIndex++ } + } + } + + private fun MethodNode.isJvmOverloadsGenerated(): Boolean { + fun AnnotationNode.isJvmOverloadsGenerated() = + this.desc == DefaultParameterValueSubstitutor.ANNOTATION_TYPE_DESCRIPTOR_FOR_JVM_OVERLOADS_GENERATED_METHODS + + return (visibleAnnotations?.any { it.isJvmOverloadsGenerated() } ?: false) + || (invisibleAnnotations?.any { it.isJvmOverloadsGenerated() } ?: false) + } + + override fun processAfterAllModules(someAssertionWasFailed: Boolean) { + if (baseDumper.isEmpty()) return + + val irDifference = IR_DIFFERENCE in testServices.moduleStructure.allDirectives + + val extension = when (irDifference) { + false -> DUMP_EXTENSION + true -> when (testServices.moduleStructure.modules.first().targetBackend?.isIR) { + true -> IR_DUMP_EXTENSION + else -> DUMP_EXTENSION + } + } + + val testDataFile = testServices.moduleStructure.originalTestDataFiles.first() + val file = testDataFile.withExtension(extension) + assertions.assertEqualsToFile(file, baseDumper.generateResultingDump()) + + if (irDifference) { + val noIrDump = testDataFile.withExtension(DUMP_EXTENSION) + val irDump = testDataFile.withExtension(IR_DUMP_EXTENSION) + if (noIrDump.exists() && irDump.exists()) { + assertions.assertFalse(noIrDump.readText().trim() == irDump.readText().trim()) { + "Dumps for IR backend and classic backend are identical. Please remove IR_DIFFERENCE directive and ${irDump.name} file" + } + } + } + } +} diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/AsmLikeInstructionListingDirectives.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/AsmLikeInstructionListingDirectives.kt new file mode 100644 index 00000000000..25eeb371192 --- /dev/null +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/AsmLikeInstructionListingDirectives.kt @@ -0,0 +1,31 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.test.directives + +import org.jetbrains.kotlin.test.backend.handlers.AsmLikeInstructionListingHandler +import org.jetbrains.kotlin.test.directives.model.SimpleDirectivesContainer + +object AsmLikeInstructionListingDirectives : SimpleDirectivesContainer() { + val CHECK_ASM_LIKE_INSTRUCTIONS by directive( + "Enables ${AsmLikeInstructionListingHandler::class}" + ) + + val IR_DIFFERENCE by directive( + "If present then saves dump for IR backend in asm.ir.txt file" + ) + + val CURIOUS_ABOUT by stringDirective( + "Specifies list of methods for which asm instructions should be printed" + ) + + val LOCAL_VARIABLE_TABLE by directive( + "Enables printing of local variable table" + ) + + val RENDER_ANNOTATIONS by directive( + "Enables rendering of annotations" + ) +} diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/codegen/AbstractAsmLikeInstructionListingTest.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/codegen/AbstractAsmLikeInstructionListingTest.kt new file mode 100644 index 00000000000..40edca1fc99 --- /dev/null +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/codegen/AbstractAsmLikeInstructionListingTest.kt @@ -0,0 +1,98 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.test.runners.codegen + +import org.jetbrains.kotlin.test.Constructor +import org.jetbrains.kotlin.test.TargetBackend +import org.jetbrains.kotlin.test.backend.BlackBoxCodegenSuppressor +import org.jetbrains.kotlin.test.backend.classic.ClassicBackendInput +import org.jetbrains.kotlin.test.backend.classic.ClassicJvmBackendFacade +import org.jetbrains.kotlin.test.backend.handlers.AsmLikeInstructionListingHandler +import org.jetbrains.kotlin.test.backend.ir.IrBackendInput +import org.jetbrains.kotlin.test.backend.ir.JvmIrBackendFacade +import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder +import org.jetbrains.kotlin.test.builders.configureClassicFrontendHandlersStep +import org.jetbrains.kotlin.test.builders.configureFirHandlersStep +import org.jetbrains.kotlin.test.builders.configureJvmArtifactsHandlersStep +import org.jetbrains.kotlin.test.directives.AsmLikeInstructionListingDirectives.CHECK_ASM_LIKE_INSTRUCTIONS +import org.jetbrains.kotlin.test.frontend.classic.ClassicFrontend2ClassicBackendConverter +import org.jetbrains.kotlin.test.frontend.classic.ClassicFrontend2IrConverter +import org.jetbrains.kotlin.test.frontend.classic.ClassicFrontendFacade +import org.jetbrains.kotlin.test.frontend.classic.ClassicFrontendOutputArtifact +import org.jetbrains.kotlin.test.frontend.classic.handlers.ClassicDiagnosticsHandler +import org.jetbrains.kotlin.test.frontend.fir.handlers.FirDiagnosticsHandler +import org.jetbrains.kotlin.test.model.* +import org.jetbrains.kotlin.test.runners.AbstractKotlinCompilerWithTargetBackendTest + +abstract class AbstractAsmLikeInstructionListingTestBase, I : ResultingArtifact.BackendInput>( + val targetFrontend: FrontendKind, + targetBackend: TargetBackend +) : AbstractKotlinCompilerWithTargetBackendTest(targetBackend) { + abstract val frontendFacade: Constructor> + abstract val frontendToBackendConverter: Constructor> + abstract val backendFacade: Constructor> + + override fun TestConfigurationBuilder.configuration() { + defaultDirectives { + +CHECK_ASM_LIKE_INSTRUCTIONS + } + + commonConfigurationForCodegenTest(targetFrontend, frontendFacade, frontendToBackendConverter, backendFacade) + + configureClassicFrontendHandlersStep { + useHandlers( + ::ClassicDiagnosticsHandler + ) + } + + configureFirHandlersStep { + useHandlers( + ::FirDiagnosticsHandler + ) + } + + configureJvmArtifactsHandlersStep { + useHandlers( + ::AsmLikeInstructionListingHandler + ) + } + + useAfterAnalysisCheckers(::BlackBoxCodegenSuppressor) + } +} + +open class AbstractAsmLikeInstructionListingTest : + AbstractAsmLikeInstructionListingTestBase( + FrontendKinds.ClassicFrontend, + TargetBackend.JVM + ) { + + override val frontendFacade: Constructor> + get() = ::ClassicFrontendFacade + + override val frontendToBackendConverter: Constructor> + get() = ::ClassicFrontend2ClassicBackendConverter + + override val backendFacade: Constructor> + get() = ::ClassicJvmBackendFacade +} + +open class AbstractIrAsmLikeInstructionListingTest : + AbstractAsmLikeInstructionListingTestBase( + FrontendKinds.ClassicFrontend, + TargetBackend.JVM_IR + ) { + + override val frontendFacade: Constructor> + get() = ::ClassicFrontendFacade + + override val frontendToBackendConverter: Constructor> + get() = ::ClassicFrontend2IrConverter + + override val backendFacade: Constructor> + get() = ::JvmIrBackendFacade +} + diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractAsmLikeInstructionListingTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractAsmLikeInstructionListingTest.kt index 999694b4203..e3301684e9f 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractAsmLikeInstructionListingTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractAsmLikeInstructionListingTest.kt @@ -5,6 +5,7 @@ package org.jetbrains.kotlin.codegen +import org.jetbrains.kotlin.ObsoleteTestInfrastructure import org.jetbrains.kotlin.test.KotlinTestUtils import org.jetbrains.org.objectweb.asm.ClassReader import org.jetbrains.org.objectweb.asm.Label @@ -20,6 +21,7 @@ import java.io.File private val LINE_SEPARATOR = System.getProperty("line.separator") +@ObsoleteTestInfrastructure abstract class AbstractAsmLikeInstructionListingTest : CodegenTestCase() { private companion object { const val CURIOUS_ABOUT_DIRECTIVE = "// CURIOUS_ABOUT " @@ -352,4 +354,4 @@ private fun MethodNode.isJvmOverloadsGenerated(): Boolean { return (visibleAnnotations?.any { it.isJvmOverloadsGenerated() } ?: false) || (invisibleAnnotations?.any { it.isJvmOverloadsGenerated() } ?: false) -} \ No newline at end of file +} diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/ir/AbstractIrAsmLikeInstructionListingTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/ir/AbstractIrAsmLikeInstructionListingTest.kt deleted file mode 100644 index 9e7be0f5169..00000000000 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/ir/AbstractIrAsmLikeInstructionListingTest.kt +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.codegen.ir - -import org.jetbrains.kotlin.codegen.AbstractAsmLikeInstructionListingTest -import org.jetbrains.kotlin.test.TargetBackend - -abstract class AbstractIrAsmLikeInstructionListingTest : AbstractAsmLikeInstructionListingTest() { - override val backend = TargetBackend.JVM_IR -} \ No newline at end of file diff --git a/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit3CompilerTests.kt b/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit3CompilerTests.kt index 7e1c088f92c..f84a43f0368 100644 --- a/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit3CompilerTests.kt +++ b/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit3CompilerTests.kt @@ -106,10 +106,6 @@ fun generateJUnit3CompilerTests(args: Array) { model("codegen/kapt", targetBackend = TargetBackend.JVM) } - testClass { - model("codegen/asmLike", targetBackend = TargetBackend.JVM) - } - testClass { model("codegen/script", extension = "kts") } @@ -407,10 +403,6 @@ fun generateJUnit3CompilerTests(args: Array) { model("debug/localVariables", targetBackend = TargetBackend.JVM_IR) } - testClass { - model("codegen/asmLike", targetBackend = TargetBackend.JVM_IR) - } - testClass { model("codegen/script", extension = "kts", targetBackend = TargetBackend.JVM_IR) } diff --git a/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt b/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt index 1a5923f19c9..2610561ea75 100644 --- a/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt +++ b/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt @@ -138,6 +138,14 @@ fun generateJUnit5CompilerTests(args: Array) { testClass { model("codegen/bytecodeListing") } + + testClass { + model("codegen/asmLike") + } + + testClass { + model("codegen/asmLike") + } } // ---------------------------------------------- FIR tests ---------------------------------------------- diff --git a/plugins/android-extensions/android-extensions-compiler/test/org/jetbrains/kotlin/android/parcel/AbstractParcelBytecodeListingTest.kt b/plugins/android-extensions/android-extensions-compiler/test/org/jetbrains/kotlin/android/parcel/AbstractParcelBytecodeListingTest.kt index 0806d5df32b..8aa1f044e4d 100644 --- a/plugins/android-extensions/android-extensions-compiler/test/org/jetbrains/kotlin/android/parcel/AbstractParcelBytecodeListingTest.kt +++ b/plugins/android-extensions/android-extensions-compiler/test/org/jetbrains/kotlin/android/parcel/AbstractParcelBytecodeListingTest.kt @@ -5,6 +5,7 @@ package org.jetbrains.kotlin.android.parcel +import org.jetbrains.kotlin.ObsoleteTestInfrastructure import org.jetbrains.kotlin.android.synthetic.AndroidComponentRegistrar import org.jetbrains.kotlin.android.synthetic.test.addAndroidExtensionsRuntimeLibrary import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment @@ -12,6 +13,7 @@ import org.jetbrains.kotlin.cli.jvm.config.JvmClasspathRoot import org.jetbrains.kotlin.codegen.AbstractAsmLikeInstructionListingTest import java.io.File +@OptIn(ObsoleteTestInfrastructure::class) abstract class AbstractParcelBytecodeListingTest : AbstractAsmLikeInstructionListingTest() { override fun setupEnvironment(environment: KotlinCoreEnvironment) { AndroidComponentRegistrar.registerParcelExtensions(environment.project) diff --git a/plugins/kotlin-serialization/kotlin-serialization-compiler/test/org/jetbrains/kotlinx/serialization/AbstractSerializationIrBytecodeListingTest.kt b/plugins/kotlin-serialization/kotlin-serialization-compiler/test/org/jetbrains/kotlinx/serialization/AbstractSerializationIrBytecodeListingTest.kt index 18e7585f369..919a7a387eb 100644 --- a/plugins/kotlin-serialization/kotlin-serialization-compiler/test/org/jetbrains/kotlinx/serialization/AbstractSerializationIrBytecodeListingTest.kt +++ b/plugins/kotlin-serialization/kotlin-serialization-compiler/test/org/jetbrains/kotlinx/serialization/AbstractSerializationIrBytecodeListingTest.kt @@ -5,6 +5,7 @@ package org.jetbrains.kotlinx.serialization +import org.jetbrains.kotlin.ObsoleteTestInfrastructure import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment import org.jetbrains.kotlin.cli.jvm.config.JvmClasspathRoot import org.jetbrains.kotlin.codegen.AbstractAsmLikeInstructionListingTest @@ -12,6 +13,7 @@ import org.jetbrains.kotlin.test.TargetBackend import org.jetbrains.kotlinx.serialization.compiler.extensions.SerializationComponentRegistrar import java.io.File +@OptIn(ObsoleteTestInfrastructure::class) abstract class AbstractSerializationIrBytecodeListingTest : AbstractAsmLikeInstructionListingTest() { private val coreLibraryPath = getSerializationCoreLibraryJar() diff --git a/plugins/kotlin-serialization/kotlin-serialization-compiler/test/org/jetbrains/kotlinx/serialization/AbstractSerializationPluginBytecodeListingTest.kt b/plugins/kotlin-serialization/kotlin-serialization-compiler/test/org/jetbrains/kotlinx/serialization/AbstractSerializationPluginBytecodeListingTest.kt index e41118aacda..c206f733696 100644 --- a/plugins/kotlin-serialization/kotlin-serialization-compiler/test/org/jetbrains/kotlinx/serialization/AbstractSerializationPluginBytecodeListingTest.kt +++ b/plugins/kotlin-serialization/kotlin-serialization-compiler/test/org/jetbrains/kotlinx/serialization/AbstractSerializationPluginBytecodeListingTest.kt @@ -5,11 +5,13 @@ package org.jetbrains.kotlinx.serialization +import org.jetbrains.kotlin.ObsoleteTestInfrastructure import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment import org.jetbrains.kotlin.cli.jvm.config.JvmClasspathRoot import org.jetbrains.kotlin.codegen.AbstractAsmLikeInstructionListingTest import org.jetbrains.kotlinx.serialization.compiler.extensions.SerializationComponentRegistrar +@OptIn(ObsoleteTestInfrastructure::class) abstract class AbstractSerializationPluginBytecodeListingTest : AbstractAsmLikeInstructionListingTest() { private val coreLibraryPath = getSerializationCoreLibraryJar() diff --git a/plugins/parcelize/parcelize-compiler/tests/org/jetbrains/kotlin/parcelize/test/AbstractParcelizeBytecodeListingTest.kt b/plugins/parcelize/parcelize-compiler/tests/org/jetbrains/kotlin/parcelize/test/AbstractParcelizeBytecodeListingTest.kt index fe93dcb66a7..96e6f620189 100644 --- a/plugins/parcelize/parcelize-compiler/tests/org/jetbrains/kotlin/parcelize/test/AbstractParcelizeBytecodeListingTest.kt +++ b/plugins/parcelize/parcelize-compiler/tests/org/jetbrains/kotlin/parcelize/test/AbstractParcelizeBytecodeListingTest.kt @@ -5,12 +5,14 @@ package org.jetbrains.kotlin.parcelize.test +import org.jetbrains.kotlin.ObsoleteTestInfrastructure import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment import org.jetbrains.kotlin.codegen.AbstractAsmLikeInstructionListingTest import org.jetbrains.kotlin.parcelize.ParcelizeComponentRegistrar import org.jetbrains.kotlin.test.TargetBackend import java.io.File +@OptIn(ObsoleteTestInfrastructure::class) abstract class AbstractParcelizeBytecodeListingTest : AbstractAsmLikeInstructionListingTest() { override fun setupEnvironment(environment: KotlinCoreEnvironment) { ParcelizeComponentRegistrar.registerParcelizeComponents(environment.project) @@ -25,4 +27,4 @@ abstract class AbstractParcelizeIrBytecodeListingTest : AbstractParcelizeBytecod override fun getExpectedTextFileName(wholeFile: File): String { return wholeFile.nameWithoutExtension + ".ir.txt" } -} \ No newline at end of file +}