[IR] Dump IdSignatures and mangled names in irText tests
The reason #1 for this feature is that we want to test IdSignatures generated for declarations. Currently, there is no (easy) way to ensure that a change in the signature building logic doesn't cause any breaking changes wrt klibs. Now, most IdSignatures include hashed mangled names in them, so even if we catch a regression where the included hash changes, there would be no way of knowing immediately what caused it, unless we'd also have mangled names in the expectations. The reason #2 is to test the manglers themselves. Currently, there are no tests for them. They heavily duplicate each other, this is already causing issues (see KT-57427) that would be very hard to catch without these tests. ^KT-58238 Fixed
This commit is contained in:
committed by
Space Team
parent
bccf69910d
commit
6e8283a6fe
@@ -1,6 +1,10 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_STDLIB
|
||||
// DUMP_LOCAL_DECLARATION_SIGNATURES
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
|
||||
// MUTE_SIGNATURE_COMPARISON_K2: ANY
|
||||
// ^ KT-57428
|
||||
|
||||
val anonymous = fun() { println() }
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
// CHECK:
|
||||
// Mangled name: {}anonymous
|
||||
// Public signature: /anonymous|-1633601112294415930[0]
|
||||
val anonymous: Function0<Unit>
|
||||
field
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name (compatible mode: false): {}anonymous#<no name provided>#static(){}
|
||||
// Mangled name (compatible mode: true): anonymous#<no name provided>#static(){}
|
||||
// CHECK JS_IR NATIVE:
|
||||
// Mangled name: #<get-anonymous>(){}
|
||||
// Public signature: /anonymous.<get-anonymous>|-7938030596525369571[0]
|
||||
local fun <no name provided>(): Unit
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: #<get-anonymous>(){}kotlin.Function0<kotlin.Unit>
|
||||
// Public signature: /anonymous.<get-anonymous>|4047260013555274752[0]
|
||||
get
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
// CHECK:
|
||||
// Mangled name: {}fn
|
||||
// Public signature: /fn|-1096960354582375131[0]
|
||||
var fn: Function1<A, Int>
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name: #<get-fn>(){}kotlin.Function1<A,kotlin.Int>
|
||||
// Public signature: /fn.<get-fn>|-1538543637358155392[0]
|
||||
// CHECK JS_IR NATIVE:
|
||||
// Mangled name: #<get-fn>(){}
|
||||
// Public signature: /fn.<get-fn>|7436020190901948688[0]
|
||||
get
|
||||
// CHECK:
|
||||
// Mangled name: #<set-fn>(kotlin.Function1<A,kotlin.Int>){}
|
||||
// Public signature: /fn.<set-fn>|5076231225819362553[0]
|
||||
set
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: A
|
||||
// Public signature: /A|null[0]
|
||||
data class A {
|
||||
// CHECK:
|
||||
// Mangled name: A{}x
|
||||
// Public signature: /A.x|-8060530855978347579[0]
|
||||
val x: Int
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name: A#<get-x>(){}kotlin.Int
|
||||
// Public signature: /A.x.<get-x>|4966956098150895696[0]
|
||||
// CHECK JS_IR NATIVE:
|
||||
// Mangled name: A#<get-x>(){}
|
||||
// Public signature: /A.x.<get-x>|1482705010654679335[0]
|
||||
get
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: A{}y
|
||||
// Public signature: /A.y|3625903257357557171[0]
|
||||
val y: Int
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name: A#<get-y>(){}kotlin.Int
|
||||
// Public signature: /A.y.<get-y>|-6745575372101973707[0]
|
||||
// CHECK JS_IR NATIVE:
|
||||
// Mangled name: A#<get-y>(){}
|
||||
// Public signature: /A.y.<get-y>|-7902422373892128922[0]
|
||||
get
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: A#<init>(kotlin.Int;kotlin.Int){}
|
||||
// Public signature: /A.<init>|-7691762014320324121[0]
|
||||
constructor(x: Int, y: Int) /* primary */
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name: A#component1(){}kotlin.Int
|
||||
// Public signature: /A.component1|-8217597213800111288[0]
|
||||
// CHECK JS_IR NATIVE:
|
||||
// Mangled name: A#component1(){}
|
||||
// Public signature: /A.component1|162597135895221648[0]
|
||||
operator fun component1(): Int
|
||||
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name: A#component2(){}kotlin.Int
|
||||
// Public signature: /A.component2|-7444333055342785242[0]
|
||||
// CHECK JS_IR NATIVE:
|
||||
// Mangled name: A#component2(){}
|
||||
// Public signature: /A.component2|3796717572321500973[0]
|
||||
operator fun component2(): Int
|
||||
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name: A#copy(kotlin.Int;kotlin.Int){}A
|
||||
// Public signature: /A.copy|1926272323689019234[0]
|
||||
// CHECK JS_IR NATIVE:
|
||||
// Mangled name: A#copy(kotlin.Int;kotlin.Int){}
|
||||
// Public signature: /A.copy|4382504155595030584[0]
|
||||
fun copy(x: Int, y: Int): A
|
||||
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name: A#equals(kotlin.Any?){}kotlin.Boolean
|
||||
// Public signature: /A.equals|722809408929142791[0]
|
||||
// CHECK JS_IR NATIVE:
|
||||
// Mangled name: A#equals(kotlin.Any?){}
|
||||
// Public signature: /A.equals|4638265728071529943[0]
|
||||
override operator fun equals(other: Any?): Boolean
|
||||
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name: A#hashCode(){}kotlin.Int
|
||||
// Public signature: /A.hashCode|-8048879360829830756[0]
|
||||
// CHECK JS_IR NATIVE:
|
||||
// Mangled name: A#hashCode(){}
|
||||
// Public signature: /A.hashCode|3409210261493131192[0]
|
||||
override fun hashCode(): Int
|
||||
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name: A#toString(){}kotlin.String
|
||||
// Public signature: /A.toString|6958853723545266802[0]
|
||||
// CHECK JS_IR NATIVE:
|
||||
// Mangled name: A#toString(){}
|
||||
// Public signature: /A.toString|-1522858123163872138[0]
|
||||
override fun toString(): String
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name: #test1(){}kotlin.Int
|
||||
// Public signature: /test1|3246027394688469880[0]
|
||||
// CHECK JS_IR NATIVE:
|
||||
// Mangled name: #test1(){}
|
||||
// Public signature: /test1|4297044443957252634[0]
|
||||
fun test1(): Int
|
||||
|
||||
+6
-1
@@ -1,4 +1,9 @@
|
||||
// FIR_IDENTICAL
|
||||
|
||||
// MUTE_SIGNATURE_COMPARISON_K2: JS_IR
|
||||
// MUTE_SIGNATURE_COMPARISON_K2: NATIVE
|
||||
// ^ KT-57818
|
||||
|
||||
val test1 = { 42 }
|
||||
|
||||
val test2 = { }
|
||||
val test2 = { }
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
// CHECK:
|
||||
// Mangled name: {}test1
|
||||
// Public signature: /test1|6005685442305498193[0]
|
||||
val test1: Function0<Int>
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name: #<get-test1>(){}kotlin.Function0<kotlin.Int>
|
||||
// Public signature: /test1.<get-test1>|3140014614812373095[0]
|
||||
// CHECK JS_IR NATIVE:
|
||||
// Mangled name: #<get-test1>(){}
|
||||
// Public signature: /test1.<get-test1>|-5735092642142423279[0]
|
||||
get
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: {}test2
|
||||
// Public signature: /test2|2517758057000911509[0]
|
||||
val test2: Function0<Unit>
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name: #<get-test2>(){}kotlin.Function0<kotlin.Unit>
|
||||
// Public signature: /test2.<get-test2>|-6581063117552766488[0]
|
||||
// CHECK JS_IR NATIVE:
|
||||
// Mangled name: #<get-test2>(){}
|
||||
// Public signature: /test2.<get-test2>|-5218942532816206869[0]
|
||||
get
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
// CHECK:
|
||||
// Mangled name: #box(){}
|
||||
// Public signature: /box|2173511048851971368[0]
|
||||
suspend fun box(): Unit
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: #flaf(kotlin.Function0<kotlin.Any?>){}
|
||||
// Public signature: /flaf|8689906342143583664[0]
|
||||
inline fun flaf(block: Function0<Any?>): Unit
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
// CHECK:
|
||||
// Mangled name: #outer(){}
|
||||
// Public signature: /outer|1607449560170809066[0]
|
||||
fun outer(): Unit
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
// CHECK:
|
||||
// Mangled name: IFoo
|
||||
// Public signature: /IFoo|null[0]
|
||||
interface IFoo {
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: IFoo@A{}foo
|
||||
// Public signature: /IFoo.foo|1214000299789500455[0]
|
||||
val A.foo: B
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name: IFoo#<get-foo>@A(){}B
|
||||
// Public signature: /IFoo.foo.<get-foo>|8070848468738985847[0]
|
||||
// CHECK JS_IR NATIVE:
|
||||
// Mangled name: IFoo#<get-foo>@A(){}
|
||||
// Public signature: /IFoo.foo.<get-foo>|-1820743651074494698[0]
|
||||
get(): B
|
||||
|
||||
}
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: IInvoke
|
||||
// Public signature: /IInvoke|null[0]
|
||||
interface IInvoke {
|
||||
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name: IInvoke#invoke@B(){}kotlin.Int
|
||||
// Public signature: /IInvoke.invoke|7560171197904259096[0]
|
||||
// CHECK JS_IR NATIVE:
|
||||
// Mangled name: IInvoke#invoke@B(){}
|
||||
// Public signature: /IInvoke.invoke|-8763880178141053779[0]
|
||||
operator fun B.invoke(): Int
|
||||
|
||||
}
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: A
|
||||
// Public signature: /A|null[0]
|
||||
object A {
|
||||
// CHECK:
|
||||
// Mangled name: A#<init>(){}
|
||||
// Public signature: /A.<init>|-5645683436151566731[0]
|
||||
private constructor() /* primary */
|
||||
|
||||
}
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: B
|
||||
// Public signature: /B|null[0]
|
||||
object B {
|
||||
// CHECK:
|
||||
// Mangled name: B#<init>(){}
|
||||
// Public signature: /B.<init>|-5645683436151566731[0]
|
||||
private constructor() /* primary */
|
||||
|
||||
}
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: #test(IFoo;IInvoke){}
|
||||
// Public signature: /test|8554265419982095815[0]
|
||||
fun test(fooImpl: IFoo, invokeImpl: IInvoke): Unit
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
// CHECK:
|
||||
// Mangled name: #test0(){}
|
||||
// Public signature: /test0|-2819007353171228053[0]
|
||||
fun test0(): Unit
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: #test1(){}
|
||||
// Public signature: /test1|4297044443957252634[0]
|
||||
fun test1(): Unit
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: #test2(){}
|
||||
// Public signature: /test2|4279114864133353152[0]
|
||||
fun test2(): Unit
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: #test3(){}
|
||||
// Public signature: /test3|-3759735065270951803[0]
|
||||
fun test3(): Unit
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: #testLrmFoo1(kotlin.collections.List<kotlin.Int>){}
|
||||
// Public signature: /testLrmFoo1|3318128046819540804[0]
|
||||
fun testLrmFoo1(ints: List<Int>): Unit
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: #testLrmFoo2(kotlin.collections.List<kotlin.Int>){}
|
||||
// Public signature: /testLrmFoo2|-5288542979552034590[0]
|
||||
fun testLrmFoo2(ints: List<Int>): Unit
|
||||
|
||||
+1
-1
@@ -5,4 +5,4 @@
|
||||
fun test1() {
|
||||
val hello = Runnable { println("Hello, world!") }
|
||||
hello.run()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
// CHECK:
|
||||
// Mangled name: #test1(){}
|
||||
// Public signature: /test1|4297044443957252634[0]
|
||||
fun test1(): Unit
|
||||
|
||||
Reference in New Issue
Block a user