[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:
Sergej Jaskiewicz
2023-04-06 15:07:36 +02:00
committed by Space Team
parent bccf69910d
commit 6e8283a6fe
791 changed files with 36162 additions and 357 deletions
@@ -0,0 +1,54 @@
// CHECK JVM_IR:
// Mangled name: #fn0(){}kotlin.Int
// Public signature: /fn0|-3364598877649792431[0]
// CHECK JS_IR NATIVE:
// Mangled name: #fn0(){}
// Public signature: /fn0|-2043665824144278007[0]
fun fn0(): Int
// CHECK JVM_IR:
// Mangled name: #fn1(kotlin.Int){}kotlin.Int
// Public signature: /fn1|-2634385227090463147[0]
// CHECK JS_IR NATIVE:
// Mangled name: #fn1(kotlin.Int){}
// Public signature: /fn1|-2712608382334902272[0]
fun fn1(x: Int): Int
// CHECK JVM_IR:
// Mangled name: #fnv(kotlin.IntArray...){}kotlin.Int
// Public signature: /fnv|7629192376934713891[0]
// CHECK JS_IR NATIVE:
// Mangled name: #fnv(kotlin.IntArray...){}
// Public signature: /fnv|2422608309256790418[0]
fun fnv(vararg xs: Int): Int
// 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: #testV0(){}
// Public signature: /testV0|-8921284502747635947[0]
fun testV0(): Unit
// CHECK:
// Mangled name: #testV1(){}
// Public signature: /testV1|3830223062623947245[0]
fun testV1(): Unit
// CHECK:
// Mangled name: #useUnit0(kotlin.Function0<kotlin.Unit>){}
// Public signature: /useUnit0|5614361260644496254[0]
fun useUnit0(fn: Function0<Unit>): Unit
// CHECK:
// Mangled name: #useUnit1(kotlin.Function1<kotlin.Int,kotlin.Unit>){}
// Public signature: /useUnit1|-3238349347224683286[0]
fun useUnit1(fn: Function1<Int, Unit>): Unit