IR text tests: Don't dump signatures for local declarations

1. Local declarations don't participate in IR-linkage, because they
can be referenced only inside the same body -> can be dropped
from IR text tests.

2. Mangled names for private declarations computed by descriptors/fir
are actually not used anywhere (they are recomputed by IR
immediately before serialization of IR). But sometimes such
mangled names diverge between K1 and K2 -> don't check them, but
always check mangled names computed by IR even for private
declarations.

3. Also: Drop DUMP_LOCAL_DECLARATION_SIGNATURES test directive.

^KT-57428 Obsolete
^KT-57430 Obsolete
^KT-57434 Obsolete
^KT-57778 Obsolete
^KT-57775 Obsolete
This commit is contained in:
Dmitriy Dolovov
2023-11-20 19:10:54 +01:00
committed by Space Team
parent 514ae0c813
commit 02604060ae
125 changed files with 259 additions and 1376 deletions
@@ -1,9 +1,5 @@
// FIR_IDENTICAL
// !LANGUAGE: +ContextReceivers
// DUMP_LOCAL_DECLARATION_SIGNATURES
// MUTE_SIGNATURE_COMPARISON_K2: ANY
// ^ KT-57428
class Outer {
val x: Int = 1
@@ -7,15 +7,6 @@ class Inner {
// Public signature: /Inner.<init>|7428094623108856579[0]
// Public signature debug description: <init>!Outer(kotlin.Any){}
constructor($context_receiver_0: Outer, arg: Any) /* primary */
// CHECK JVM_IR:
// Mangled name: Inner.contextReceiverField0
// Mangled name for the signature computed from Ir:
// Mangled name for the signature computed from Descriptor: {}contextReceiverField0#jf
// CHECK JS_IR NATIVE:
// Mangled name: Inner.contextReceiverField0
// Mangled name for the signature computed from Ir:
// Mangled name for the signature computed from Descriptor: {}contextReceiverField0
private /* final field */ val contextReceiverField0: Outer
// CHECK JVM_IR:
// Mangled name: Inner#bar(){}kotlin.Int
@@ -38,7 +29,6 @@ class Outer {
// Public signature: /Outer.x|-8060530855978347579[0]
// Public signature debug description: {}x
val x: Int
field
// CHECK JVM_IR:
// Mangled name: Outer#<get-x>(){}kotlin.Int
// Public signature: /Outer.x.<get-x>|4966956098150895696[0]
@@ -62,11 +52,4 @@ class Outer {
// Public signature: /f|-90367846469451219[0]
// Public signature debug description: f(Outer){}
fun f(outer: Outer): Unit
// CHECK JVM_IR:
// Mangled name: #f(Outer){}#<anonymous>#static@Outer(){}Inner
// Mangled name for the signature: f(Outer){}<anonymous>#static@Outer(){}Inner
// CHECK JS_IR NATIVE:
// Mangled name: #f(Outer){}#<anonymous>#static@Outer(){}
// Mangled name for the signature: f(Outer){}<anonymous>#static@Outer(){}
local fun Outer.<anonymous>(): Inner
@@ -29,15 +29,6 @@ class Test {
// Public signature: /Test.<init>|4848133296495274545[0]
// Public signature debug description: <init>!Context(){}
constructor($context_receiver_0: Context) /* primary */
// CHECK JVM_IR:
// Mangled name: Test.contextReceiverField0
// Mangled name for the signature computed from Ir:
// Mangled name for the signature computed from Descriptor: {}contextReceiverField0#jf
// CHECK JS_IR NATIVE:
// Mangled name: Test.contextReceiverField0
// Mangled name for the signature computed from Ir:
// Mangled name for the signature computed from Descriptor: {}contextReceiverField0
private /* final field */ val contextReceiverField0: Context
// CHECK:
// Mangled name: Test#bar(){}
@@ -1,9 +1,5 @@
// FIR_IDENTICAL
// !LANGUAGE: +ContextReceivers
// DUMP_LOCAL_DECLARATION_SIGNATURES
// MUTE_SIGNATURE_COMPARISON_K2: ANY
// ^ KT-57428
class O(val o: String)
@@ -7,7 +7,6 @@ class O {
// Public signature: /O.o|-5332571409865440260[0]
// Public signature debug description: {}o
val o: String
field
// CHECK JVM_IR:
// Mangled name: O#<get-o>(){}kotlin.String
// Public signature: /O.o.<get-o>|2606027183154875572[0]
@@ -35,7 +34,6 @@ class OK {
// Public signature: /OK.k|2162811783424158931[0]
// Public signature debug description: {}k
val k: String
field
// CHECK JVM_IR:
// Mangled name: OK#<get-k>(){}kotlin.String
// Public signature: /OK.k.<get-k>|-8248201737917988340[0]
@@ -51,7 +49,6 @@ class OK {
// Public signature: /OK.result|456251868630197251[0]
// Public signature debug description: {}result
val result: String
field
// CHECK JVM_IR:
// Mangled name: OK#<get-result>(){}kotlin.String
// Public signature: /OK.result.<get-result>|8441547134620975366[0]
@@ -67,15 +64,6 @@ class OK {
// Public signature: /OK.<init>|-804847331171011326[0]
// Public signature debug description: <init>!O(kotlin.String){}
constructor($context_receiver_0: O, k: String) /* primary */
// CHECK JVM_IR:
// Mangled name: OK.contextReceiverField0
// Mangled name for the signature computed from Ir:
// Mangled name for the signature computed from Descriptor: {}contextReceiverField0#jf
// CHECK JS_IR NATIVE:
// Mangled name: OK.contextReceiverField0
// Mangled name for the signature computed from Ir:
// Mangled name for the signature computed from Descriptor: {}contextReceiverField0
private /* final field */ val contextReceiverField0: O
}
@@ -88,11 +76,4 @@ class OK {
// Public signature: /box|2173511048851971368[0]
// Public signature debug description: box(){}
fun box(): String
// CHECK JVM_IR:
// Mangled name: #box(){}kotlin.String#<anonymous>#static@O(){}kotlin.String
// Mangled name for the signature: box(){}kotlin.String<anonymous>#static@O(){}kotlin.String
// CHECK JS_IR NATIVE:
// Mangled name: #box(){}#<anonymous>#static@O(){}
// Mangled name for the signature: box(){}<anonymous>#static@O(){}
local fun O.<anonymous>(): String
@@ -95,15 +95,6 @@ class Result {
// Public signature: /Result.<init>|-1392650824251324893[0]
// Public signature debug description: <init>!kotlin.Int(){}
constructor($context_receiver_0: Int) /* primary */
// CHECK JVM_IR:
// Mangled name: Result.contextReceiverField0
// Mangled name for the signature computed from Ir:
// Mangled name for the signature computed from Descriptor: {}contextReceiverField0#jf
// CHECK JS_IR NATIVE:
// Mangled name: Result.contextReceiverField0
// Mangled name for the signature computed from Ir:
// Mangled name for the signature computed from Descriptor: {}contextReceiverField0
private /* final field */ val contextReceiverField0: Int
}
@@ -1,9 +1,5 @@
// FIR_IDENTICAL
// !LANGUAGE: +ContextReceivers
// DUMP_LOCAL_DECLARATION_SIGNATURES
// MUTE_SIGNATURE_COMPARISON_K2: ANY
// ^ KT-57428
class C {
val c = 42
@@ -7,7 +7,6 @@ class C {
// Public signature: /C.c|-4416962153448040627[0]
// Public signature debug description: {}c
val c: Int
field
// CHECK JVM_IR:
// Mangled name: C#<get-c>(){}kotlin.Int
// Public signature: /C.c.<get-c>|-2440337234483931882[0]
@@ -31,10 +30,6 @@ class C {
// Public signature: /bar|-380723744805794672[0]
// Public signature debug description: bar(C){}
fun bar(c: C): Unit
// CHECK:
// Mangled name: #bar(C){}#<anonymous>#static@C(){}
// Mangled name for the signature: bar(C){}<anonymous>#static@C(){}
local fun C.<anonymous>(): Unit
// CHECK:
// Mangled name: #foo!C(){}
@@ -7,15 +7,6 @@ class A<T : Any?> {
// Public signature: /A.<init>|5547349096232763669[0]
// Public signature debug description: <init>!1:0(){}
constructor($context_receiver_0: T) /* primary */
// CHECK JVM_IR:
// Mangled name: A.contextReceiverField0
// Mangled name for the signature computed from Ir:
// Mangled name for the signature computed from Descriptor: {}contextReceiverField0#jf
// CHECK JS_IR NATIVE:
// Mangled name: A.contextReceiverField0
// Mangled name for the signature computed from Ir:
// Mangled name for the signature computed from Descriptor: {}contextReceiverField0
private /* final field */ val contextReceiverField0: T
}
@@ -28,15 +19,6 @@ class B<P : Any?> {
// Public signature: /B.<init>|-5453957848603821578[0]
// Public signature debug description: <init>!kotlin.collections.Collection<1:0>(){}
constructor($context_receiver_0: Collection<P>) /* primary */
// CHECK JVM_IR:
// Mangled name: B.contextReceiverField0
// Mangled name for the signature computed from Ir:
// Mangled name for the signature computed from Descriptor: {}contextReceiverField0#jf
// CHECK JS_IR NATIVE:
// Mangled name: B.contextReceiverField0
// Mangled name for the signature computed from Ir:
// Mangled name for the signature computed from Descriptor: {}contextReceiverField0
private /* final field */ val contextReceiverField0: Collection<P>
}
@@ -179,15 +179,6 @@ class CounterIterator : Iterator<Int> {
// Public signature: /CounterIterator.<init>|4731448293962665986[0]
// Public signature debug description: <init>!CounterConfig(Counter){}
constructor($context_receiver_0: CounterConfig, counter: Counter) /* primary */
// CHECK JVM_IR:
// Mangled name: CounterIterator.contextReceiverField0
// Mangled name for the signature computed from Ir:
// Mangled name for the signature computed from Descriptor: {}contextReceiverField0#jf
// CHECK JS_IR NATIVE:
// Mangled name: CounterIterator.contextReceiverField0
// Mangled name for the signature computed from Ir:
// Mangled name for the signature computed from Descriptor: {}contextReceiverField0
private /* final field */ val contextReceiverField0: CounterConfig
// CHECK JVM_IR:
// Mangled name: CounterIterator#hasNext(){}kotlin.Boolean
@@ -7,24 +7,6 @@ class MyClass {
// Public signature: /MyClass.<init>|1062323742830185042[0]
// Public signature debug description: <init>!kotlin.Unit!kotlin.Int(){}
constructor($context_receiver_0: Unit, $context_receiver_1: Int) /* primary */
// CHECK JVM_IR:
// Mangled name: MyClass.contextReceiverField0
// Mangled name for the signature computed from Ir:
// Mangled name for the signature computed from Descriptor: {}contextReceiverField0#jf
// CHECK JS_IR NATIVE:
// Mangled name: MyClass.contextReceiverField0
// Mangled name for the signature computed from Ir:
// Mangled name for the signature computed from Descriptor: {}contextReceiverField0
private /* final field */ val contextReceiverField0: Unit
// CHECK JVM_IR:
// Mangled name: MyClass.contextReceiverField1
// Mangled name for the signature computed from Ir:
// Mangled name for the signature computed from Descriptor: {}contextReceiverField1#jf
// CHECK JS_IR NATIVE:
// Mangled name: MyClass.contextReceiverField1
// Mangled name for the signature computed from Ir:
// Mangled name for the signature computed from Descriptor: {}contextReceiverField1
private /* final field */ val contextReceiverField1: Int
}
@@ -1,9 +1,5 @@
// FIR_IDENTICAL
// !LANGUAGE: +ContextReceivers
// DUMP_LOCAL_DECLARATION_SIGNATURES
// MUTE_SIGNATURE_COMPARISON_K2: ANY
// ^ KT-57428
interface Lazy<T>
@@ -10,50 +10,6 @@ interface Lazy<T : Any?> {
// Public signature: /f|-6064829949850642050[0]
// Public signature debug description: f(Lazy<kotlin.Int>;Lazy<kotlin.CharSequence>;Lazy<0:0>;Lazy<Lazy<0:0>>){0§<kotlin.Any?>}
fun <T : Any?> f(lazy1: Lazy<Int>, lazy2: Lazy<CharSequence>, lazyT: Lazy<T>, lazyLazyT: Lazy<Lazy<T>>): Unit
// CHECK:
// Mangled name: #f(Lazy<kotlin.Int>;Lazy<kotlin.CharSequence>;Lazy<1:0>;Lazy<Lazy<1:0>>){0§<kotlin.Any?>}#<anonymous>#static@Lazy<kotlin.Int>(){}
// Mangled name for the signature: f(Lazy<kotlin.Int>;Lazy<kotlin.CharSequence>;Lazy<1:0>;Lazy<Lazy<1:0>>){0§<kotlin.Any?>}<anonymous>#static@Lazy<kotlin.Int>(){}
local fun Lazy<Int>.<anonymous>(): Unit
// CHECK:
// Mangled name: #f(Lazy<kotlin.Int>;Lazy<kotlin.CharSequence>;Lazy<2:0>;Lazy<Lazy<2:0>>){0§<kotlin.Any?>}#<anonymous>#static@Lazy<kotlin.Int>(){}#<anonymous>#static@Lazy<kotlin.CharSequence>(){}
// Mangled name for the signature: f(Lazy<kotlin.Int>;Lazy<kotlin.CharSequence>;Lazy<2:0>;Lazy<Lazy<2:0>>){0§<kotlin.Any?>}<anonymous>#static@Lazy<kotlin.Int>(){}<anonymous>#static@Lazy<kotlin.CharSequence>(){}
local fun Lazy<CharSequence>.<anonymous>(): Unit
// CHECK:
// Mangled name: #f(Lazy<kotlin.Int>;Lazy<kotlin.CharSequence>;Lazy<1:0>;Lazy<Lazy<1:0>>){0§<kotlin.Any?>}#<anonymous>#static@Lazy<kotlin.CharSequence>(){}
// Mangled name for the signature: f(Lazy<kotlin.Int>;Lazy<kotlin.CharSequence>;Lazy<1:0>;Lazy<Lazy<1:0>>){0§<kotlin.Any?>}<anonymous>#static@Lazy<kotlin.CharSequence>(){}
local fun Lazy<CharSequence>.<anonymous>(): Unit
// CHECK:
// Mangled name: #f(Lazy<kotlin.Int>;Lazy<kotlin.CharSequence>;Lazy<2:0>;Lazy<Lazy<2:0>>){0§<kotlin.Any?>}#<anonymous>#static@Lazy<kotlin.CharSequence>(){}#<anonymous>#static@Lazy<kotlin.Int>(){}
// Mangled name for the signature: f(Lazy<kotlin.Int>;Lazy<kotlin.CharSequence>;Lazy<2:0>;Lazy<Lazy<2:0>>){0§<kotlin.Any?>}<anonymous>#static@Lazy<kotlin.CharSequence>(){}<anonymous>#static@Lazy<kotlin.Int>(){}
local fun Lazy<Int>.<anonymous>(): Unit
// CHECK:
// Mangled name: #f(Lazy<kotlin.Int>;Lazy<kotlin.CharSequence>;Lazy<1:0>;Lazy<Lazy<1:0>>){0§<kotlin.Any?>}#<anonymous>#static@Lazy<1:0>(){}
// Mangled name for the signature: f(Lazy<kotlin.Int>;Lazy<kotlin.CharSequence>;Lazy<1:0>;Lazy<Lazy<1:0>>){0§<kotlin.Any?>}<anonymous>#static@Lazy<1:0>(){}
local fun Lazy<T>.<anonymous>(): Unit
// CHECK:
// Mangled name: #f(Lazy<kotlin.Int>;Lazy<kotlin.CharSequence>;Lazy<2:0>;Lazy<Lazy<2:0>>){0§<kotlin.Any?>}#<anonymous>#static@Lazy<2:0>(){}#<anonymous>#static@Lazy<kotlin.Int>(){}
// Mangled name for the signature: f(Lazy<kotlin.Int>;Lazy<kotlin.CharSequence>;Lazy<2:0>;Lazy<Lazy<2:0>>){0§<kotlin.Any?>}<anonymous>#static@Lazy<2:0>(){}<anonymous>#static@Lazy<kotlin.Int>(){}
local fun Lazy<Int>.<anonymous>(): Unit
// CHECK:
// Mangled name: #f(Lazy<kotlin.Int>;Lazy<kotlin.CharSequence>;Lazy<1:0>;Lazy<Lazy<1:0>>){0§<kotlin.Any?>}#<anonymous>#static@Lazy<Lazy<1:0>>(){}
// Mangled name for the signature: f(Lazy<kotlin.Int>;Lazy<kotlin.CharSequence>;Lazy<1:0>;Lazy<Lazy<1:0>>){0§<kotlin.Any?>}<anonymous>#static@Lazy<Lazy<1:0>>(){}
local fun Lazy<Lazy<T>>.<anonymous>(): Unit
// CHECK:
// Mangled name: #f(Lazy<kotlin.Int>;Lazy<kotlin.CharSequence>;Lazy<2:0>;Lazy<Lazy<2:0>>){0§<kotlin.Any?>}#<anonymous>#static@Lazy<Lazy<2:0>>(){}#<anonymous>#static@Lazy<kotlin.Int>(){}
// Mangled name for the signature: f(Lazy<kotlin.Int>;Lazy<kotlin.CharSequence>;Lazy<2:0>;Lazy<Lazy<2:0>>){0§<kotlin.Any?>}<anonymous>#static@Lazy<Lazy<2:0>>(){}<anonymous>#static@Lazy<kotlin.Int>(){}
local fun Lazy<Int>.<anonymous>(): Unit
// CHECK:
// Mangled name: #f(Lazy<kotlin.Int>;Lazy<kotlin.CharSequence>;Lazy<1:0>;Lazy<Lazy<1:0>>){0§<kotlin.Any?>}#<anonymous>#static@Lazy<kotlin.Int>(){}
// Mangled name for the signature: f(Lazy<kotlin.Int>;Lazy<kotlin.CharSequence>;Lazy<1:0>;Lazy<Lazy<1:0>>){0§<kotlin.Any?>}<anonymous>#static@Lazy<kotlin.Int>(){}
local fun Lazy<Int>.<anonymous>(): Unit
// CHECK:
// Mangled name: #f(Lazy<kotlin.Int>;Lazy<kotlin.CharSequence>;Lazy<2:0>;Lazy<Lazy<2:0>>){0§<kotlin.Any?>}#<anonymous>#static@Lazy<kotlin.Int>(){}#<anonymous>#static@Lazy<Lazy<2:0>>(){}
// Mangled name for the signature: f(Lazy<kotlin.Int>;Lazy<kotlin.CharSequence>;Lazy<2:0>;Lazy<Lazy<2:0>>){0§<kotlin.Any?>}<anonymous>#static@Lazy<kotlin.Int>(){}<anonymous>#static@Lazy<Lazy<2:0>>(){}
local fun Lazy<Lazy<T>>.<anonymous>(): Unit
// CHECK:
// Mangled name: #test1!Lazy<kotlin.Int>!Lazy<kotlin.CharSequence>(){}
@@ -1,9 +1,5 @@
// FIR_IDENTICAL
// !LANGUAGE: +ContextReceivers
// DUMP_LOCAL_DECLARATION_SIGNATURES
// MUTE_SIGNATURE_COMPARISON_K2: ANY
// ^ KT-57428
class Context
@@ -35,11 +35,4 @@ fun f(): Any
// Public signature: /test|6620506149988718649[0]
// Public signature debug description: test(){}
fun test(): Unit
// CHECK JVM_IR:
// Mangled name: #test(){}#<anonymous>#static@Context(){}kotlin.Int
// Mangled name for the signature: test(){}<anonymous>#static@Context(){}kotlin.Int
// CHECK JS_IR NATIVE:
// Mangled name: #test(){}#<anonymous>#static@Context(){}
// Mangled name for the signature: test(){}<anonymous>#static@Context(){}
local fun Context.<anonymous>(): Int
@@ -1,9 +1,5 @@
// FIR_IDENTICAL
// !LANGUAGE: +ContextReceivers
// DUMP_LOCAL_DECLARATION_SIGNATURES
// MUTE_SIGNATURE_COMPARISON_K2: ANY
// ^ KT-57428
context(Int, String)
fun foo(): Int {
@@ -23,11 +23,4 @@ fun foo($context_receiver_0: Int, $context_receiver_1: String): Int
// Public signature: /test|6620506149988718649[0]
// Public signature debug description: test(){}
fun test(): Unit
// CHECK JVM_IR:
// Mangled name: #test(){}#<anonymous>#static@kotlin.Int(){}kotlin.Int
// Mangled name for the signature: test(){}<anonymous>#static@kotlin.Int(){}kotlin.Int
// CHECK JS_IR NATIVE:
// Mangled name: #test(){}#<anonymous>#static@kotlin.Int(){}
// Mangled name for the signature: test(){}<anonymous>#static@kotlin.Int(){}
local fun Int.<anonymous>(): Int
@@ -1,9 +1,5 @@
// FIR_IDENTICAL
// !LANGUAGE: +ContextReceivers
// DUMP_LOCAL_DECLARATION_SIGNATURES
// MUTE_SIGNATURE_COMPARISON_K2: ANY
// ^ KT-57428
context(T)
fun <T> useContext(block: (T) -> Unit) { }
@@ -3,14 +3,6 @@
// Public signature: /test|6620506149988718649[0]
// Public signature debug description: test(){}
fun test(): Unit
// CHECK:
// Mangled name: #test(){}#<anonymous>#static@kotlin.Int(){}
// Mangled name for the signature: test(){}<anonymous>#static@kotlin.Int(){}
local fun Int.<anonymous>(): Unit
// CHECK:
// Mangled name: #test(){}#<anonymous>#static@kotlin.Int(){}#<anonymous>#static(kotlin.Int){}
// Mangled name for the signature: test(){}<anonymous>#static@kotlin.Int(){}<anonymous>#static(kotlin.Int){}
local fun <anonymous>(i: Int): Unit
// CHECK:
// Mangled name: #useContext!0:0(kotlin.Function1<0:0,kotlin.Unit>){0§<kotlin.Any?>}