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,7 +1,7 @@
// FIR_IDENTICAL
// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR
// ^ KT-57755
// ^ KT-57755 : Fix computing a mangled name for the `main` function
fun <R : Number> Number.convert(): R = TODO()
@@ -18,8 +18,10 @@ fun foo(arg: Number): Unit
// Mangled name: #main(kotlin.Array<kotlin.String>){}
// Mangled name for the signature computed from Ir: main(kotlin.Array<kotlin.String>){}
// Mangled name for the signature computed from Descriptor: main(kotlin.Array<kotlin.String>){}%argumentMappedWithError.kt
// Public signature: /main|5561668743171252170[0]
// Public signature debug description: main(kotlin.Array<kotlin.String>){}%argumentMappedWithError.kt
// Public signature by IR: /main|5976701115139892152[0]
// Public signature by IR debug description: main(kotlin.Array<kotlin.String>){}
// Public signature by Frontend: /main|5561668743171252170[0]
// Public signature by Frontend debug description: main(kotlin.Array<kotlin.String>){}%argumentMappedWithError.kt
// CHECK JS_IR NATIVE:
// Mangled name: #main(kotlin.Array<kotlin.String>){}
// Public signature: /main|5976701115139892152[0]
@@ -1,11 +1,5 @@
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// MUTE_SIGNATURE_COMPARISON_K2: ANY
// ^ KT-57427, KT-57430
// KT-61141: absent enum fake_overrides: finalize, getDeclaringClass, clone
// IGNORE_BACKEND: NATIVE
// IGNORE_BACKEND: JS_IR JS_IR_ES6 NATIVE
// ^ KT-61141: absent enum fake_overrides: finalize (K1), getDeclaringClass (K1), clone (K2)
enum class X {
@@ -1,8 +1,4 @@
// FIR_IDENTICAL
// DUMP_LOCAL_DECLARATION_SIGNATURES
// MUTE_SIGNATURE_COMPARISON_K2: ANY
// ^ KT-57428
fun interface Foo {
fun invoke(): String
@@ -34,11 +34,4 @@ fun foo(f: Foo): String
// Public signature: /test|6620506149988718649[0]
// Public signature debug description: test(){}
fun test(): String
// CHECK JVM_IR:
// Mangled name: #test(){}kotlin.String#<anonymous>#static(){}kotlin.String
// Mangled name for the signature: test(){}kotlin.String<anonymous>#static(){}kotlin.String
// CHECK JS_IR NATIVE:
// Mangled name: #test(){}#<anonymous>#static(){}
// Mangled name for the signature: test(){}<anonymous>#static(){}
local fun <anonymous>(): String
@@ -1,8 +1,5 @@
// TARGET_BACKEND: JVM
// MUTE_SIGNATURE_COMPARISON_K2: ANY
// ^ KT-57778
// FILE: implicitNotNullInDestructuringAssignment.kt
// NB extension receiver is nullable
@@ -6,8 +6,7 @@ operator fun J?.component1(): Int
// CHECK JVM_IR:
// Mangled name: #component2@J(){}kotlin.Int
// Mangled name for the signature: component2@J(){}kotlin.Int
// Public signature: [ File 'implicitNotNullInDestructuringAssignment.kt' <- /component2|-623550756830644944[0] ]
// Public signature: [ File '/implicitNotNullInDestructuringAssignment.kt' <- /component2|-623550756830644944[0] ]
private operator fun J.component2(): Int
// CHECK:
@@ -1,13 +1,8 @@
// FIR_IDENTICAL
// LANGUAGE: +BreakContinueInInlineLambdas
// DUMP_LOCAL_DECLARATION_SIGNATURES
// TARGET_BACKEND: JVM_IR
// IGNORE_ERRORS
// WITH_STDLIB
// MUTE_SIGNATURE_COMPARISON_K2: ANY
// ^ KT-57428
inline fun foo(block: () -> Unit) { block() }
inline fun bar(block1: () -> Unit, noinline block2: () -> Unit) {
@@ -15,68 +15,10 @@ inline fun foo(block: Function0<Unit>): Unit
// Public signature: /test1|4297044443957252634[0]
// Public signature debug description: test1(){}
fun test1(): Unit
// CHECK:
// Mangled name: #test1(){}#<anonymous>#static(){}
// Mangled name for the signature: test1(){}<anonymous>#static(){}
local fun <anonymous>(): Unit
// CHECK:
// Mangled name: #test1(){}#<anonymous>#static(){}
// Mangled name for the signature: test1(){}<anonymous>#static(){}
local fun <anonymous>(): Unit
// CHECK:
// Mangled name: #test1(){}#<no name provided>#static(){}
// Mangled name for the signature: test1(){}<no name provided>#static(){}
local fun <no name provided>(): Unit
// CHECK:
// Mangled name: #test1(){}#<no name provided>#static(){}
// Mangled name for the signature: test1(){}<no name provided>#static(){}
local fun <no name provided>(): Unit
// CHECK:
// Mangled name: #test2(){}
// Public signature: /test2|4279114864133353152[0]
// Public signature debug description: test2(){}
fun test2(): Unit
// CHECK:
// Mangled name: #test2(){}#<anonymous>#static(){}
// Mangled name for the signature: test2(){}<anonymous>#static(){}
local fun <anonymous>(): Unit
// CHECK:
// Mangled name: #test2(){}#<anonymous>#static(){}
// Mangled name for the signature: test2(){}<anonymous>#static(){}
local fun <anonymous>(): Unit
// CHECK:
// Mangled name: #test2(){}#<anonymous>#static(){}
// Mangled name for the signature: test2(){}<anonymous>#static(){}
local fun <anonymous>(): Unit
// CHECK:
// Mangled name: #test2(){}#<anonymous>#static(){}
// Mangled name for the signature: test2(){}<anonymous>#static(){}
local fun <anonymous>(): Unit
// CHECK:
// Mangled name: #test2(){}#<no name provided>#static(){}
// Mangled name for the signature: test2(){}<no name provided>#static(){}
local fun <no name provided>(): Unit
// CHECK:
// Mangled name: #test2(){}#<no name provided>#static(){}
// Mangled name for the signature: test2(){}<no name provided>#static(){}
local fun <no name provided>(): Unit
// CHECK:
// Mangled name: #test2(){}#<no name provided>#static(){}
// Mangled name for the signature: test2(){}<no name provided>#static(){}
local fun <no name provided>(): Unit
// CHECK:
// Mangled name: #test2(){}#<no name provided>#static(){}
// Mangled name for the signature: test2(){}<no name provided>#static(){}
local fun <no name provided>(): Unit
@@ -1,8 +1,4 @@
// FIR_IDENTICAL
// DUMP_LOCAL_DECLARATION_SIGNATURES
// MUTE_SIGNATURE_COMPARISON_K2: ANY
// ^ KT-57430
class Outer {
open inner class Inner(val x: Int)
@@ -7,7 +7,6 @@ class Host {
// Public signature: /Host.y|3625903257357557171[0]
// Public signature debug description: {}y
val y: Int
field
// CHECK JVM_IR:
// Mangled name: Host#<get-y>(){}kotlin.Int
// Public signature: /Host.y.<get-y>|-6745575372101973707[0]
@@ -33,53 +32,6 @@ class Host {
// Public signature: /Host.test|-3179256530033214921[0]
// Public signature debug description: test@Outer(){}
fun Outer.test(): Inner
// CHECK JVM_IR:
// Mangled name: Host#test@Outer(){}Outer.Inner.<no name provided>
// Mangled name for the signature: test@Outer(){}Outer.Inner
// CHECK JS_IR NATIVE:
// Mangled name: Host#test@Outer(){}.<no name provided>
// Mangled name for the signature: test@Outer(){}
local class <no name provided> : Inner {
// CHECK JVM_IR:
// Mangled name: Host#test@Outer(){}Outer.Inner.<no name provided>{}xx
// Mangled name for the signature: test@Outer(){}Outer.Inner{}xx
// CHECK JS_IR NATIVE:
// Mangled name: Host#test@Outer(){}.<no name provided>{}xx
// Mangled name for the signature: test@Outer(){}{}xx
val xx: Int
field
// CHECK JVM_IR:
// Mangled name: Host#test@Outer(){}Outer.Inner.<no name provided>#<get-xx>(){}kotlin.Int
// Mangled name for the signature: test@Outer(){}Outer.Inner<get-xx>(){}kotlin.Int
// CHECK JS_IR NATIVE:
// Mangled name: Host#test@Outer(){}.<no name provided>#<get-xx>(){}
// Mangled name for the signature: test@Outer(){}<get-xx>(){}
get
// CHECK JVM_IR:
// Mangled name: Host#test@Outer(){}Outer.Inner.<no name provided>#<init>(){}
// Mangled name for the signature: test@Outer(){}Outer.Inner<init>(){}
// CHECK JS_IR NATIVE:
// Mangled name: Host#test@Outer(){}.<no name provided>#<init>(){}
// Mangled name for the signature: test@Outer(){}<init>(){}
constructor() /* primary */
// CHECK JVM_IR:
// Mangled name: Host#test@Outer(){}Outer.Inner.<no name provided>{}x
// Mangled name for the signature: test@Outer(){}Outer.Inner{}x
// CHECK JS_IR NATIVE:
// Mangled name: Host#test@Outer(){}.<no name provided>{}x
// Mangled name for the signature: test@Outer(){}{}x
/* fake */ override val x: Int
// CHECK JVM_IR:
// Mangled name: Host#test@Outer(){}Outer.Inner.<no name provided>#<get-x>(){}kotlin.Int
// Mangled name for the signature: test@Outer(){}Outer.Inner<get-x>(){}kotlin.Int
// CHECK JS_IR NATIVE:
// Mangled name: Host#test@Outer(){}.<no name provided>#<get-x>(){}
// Mangled name for the signature: test@Outer(){}<get-x>(){}
/* fake */ override get(): Int
}
}
@@ -96,7 +48,6 @@ class Outer {
// Public signature: /Outer.Inner.x|-8060530855978347579[0]
// Public signature debug description: {}x
val x: Int
field
// CHECK JVM_IR:
// Mangled name: Outer.Inner#<get-x>(){}kotlin.Int
// Public signature: /Outer.Inner.x.<get-x>|4966956098150895696[0]
@@ -1,8 +1,4 @@
// FIR_IDENTICAL
// DUMP_LOCAL_DECLARATION_SIGNATURES
// MUTE_SIGNATURE_COMPARISON_K2: ANY
// ^ KT-57428
open class Base(val f1: () -> Any)
@@ -7,7 +7,6 @@ open class Base {
// Public signature: /Base.f1|-3626880138223960403[0]
// Public signature debug description: {}f1
val f1: Function0<Any>
field
// CHECK JVM_IR:
// Mangled name: Base#<get-f1>(){}kotlin.Function0<kotlin.Any>
// Public signature: /Base.f1.<get-f1>|8566118280674785385[0]
@@ -35,13 +34,6 @@ object Thing : Base {
// Public signature: /Thing.<init>|-5645683436151566731[0]
// Public signature debug description: <init>(){}
private constructor() /* primary */
// CHECK JVM_IR:
// Mangled name: Thing#<init>(){}#<anonymous>#static(){}kotlin.Any
// Mangled name for the signature: <init>(){}<anonymous>#static(){}kotlin.Any
// CHECK JS_IR NATIVE:
// Mangled name: Thing#<init>(){}#<anonymous>#static(){}
// Mangled name for the signature: <init>(){}<anonymous>#static(){}
local fun <anonymous>(): Any
// CHECK JVM_IR:
// Mangled name: Thing#test1(){}Thing
@@ -2,7 +2,7 @@
// !LANGUAGE: +SuspendConversion
// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR
// ^ KT-57755
// ^ KT-57755: Fix computing a mangled name for the `main` function
fun main() {
val foo: String.(suspend () -> Unit) -> Unit = {}
@@ -2,8 +2,10 @@
// Mangled name: #main(){}
// Mangled name for the signature computed from Ir: main(){}
// Mangled name for the signature computed from Descriptor: main(){}%suspendConversionForExtensionFunction.kt
// Public signature: /main|8952895695315889943[0]
// Public signature debug description: main(){}%suspendConversionForExtensionFunction.kt
// Public signature by IR: /main|-4284757841571462650[0]
// Public signature by IR debug description: main(){}
// Public signature by Frontend: /main|8952895695315889943[0]
// Public signature by Frontend debug description: main(){}%suspendConversionForExtensionFunction.kt
// CHECK JS_IR NATIVE:
// Mangled name: #main(){}
// Public signature: /main|-4284757841571462650[0]
@@ -1,8 +1,4 @@
// FIR_IDENTICAL
// DUMP_LOCAL_DECLARATION_SIGNATURES
// MUTE_SIGNATURE_COMPARISON_K2: ANY
// ^ KT-57430
fun WithCompanion.test() {
val test1 = object : WithCompanion(this) {}
@@ -37,25 +37,4 @@ open class WithCompanion {
// Public signature: /test|4153745090133876513[0]
// Public signature debug description: test@WithCompanion(){}
fun WithCompanion.test(): Unit
// CHECK:
// Mangled name: #test@WithCompanion(){}.<no name provided>
// Mangled name for the signature: test@WithCompanion(){}
local class <no name provided> : WithCompanion {
// CHECK:
// Mangled name: #test@WithCompanion(){}.<no name provided>#<init>(){}
// Mangled name for the signature: test@WithCompanion(){}<init>(){}
constructor() /* primary */
}
// CHECK:
// Mangled name: #test@WithCompanion(){}.<no name provided>
// Mangled name for the signature: test@WithCompanion(){}
local class <no name provided> : WithCompanion {
// CHECK:
// Mangled name: #test@WithCompanion(){}.<no name provided>#<init>(){}
// Mangled name for the signature: test@WithCompanion(){}<init>(){}
constructor() /* primary */
}