[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,40 @@
// CHECK JVM_IR:
// Mangled name: #kt26531(){}kotlin.Int
// Public signature: /kt26531|-5036677741316309709[0]
// CHECK JS_IR NATIVE:
// Mangled name: #kt26531(){}
// Public signature: /kt26531|7300576202386148897[0]
fun kt26531(): Int
// CHECK JVM_IR:
// Mangled name: #testGeneric1(kotlin.String){}kotlin.String
// Public signature: /testGeneric1|-7724827201218857505[0]
// CHECK JS_IR NATIVE:
// Mangled name: #testGeneric1(kotlin.String){}
// Public signature: /testGeneric1|-5931195457682017374[0]
fun testGeneric1(x: String): String
// CHECK:
// Mangled name: @0:0{0§<kotlin.CharSequence>}gk
// Public signature: /gk|9014869081681113059[0]
val <T : CharSequence> T.gk: Function0<T>
// CHECK JVM_IR:
// Mangled name: #<get-gk>@0:0(){0§<kotlin.CharSequence>}kotlin.Function0<0:0>
// Public signature: /gk.<get-gk>|7271261295339366926[0]
// CHECK JS_IR NATIVE:
// Mangled name: #<get-gk>@0:0(){0§<kotlin.CharSequence>}
// Public signature: /gk.<get-gk>|1726105423392935976[0]
get(): Function0<T>
// CHECK:
// Mangled name: @0:0{0§<kotlin.Any?>}kt26531Val
// Public signature: /kt26531Val|-1273322007718616598[0]
val <T : Any?> T.kt26531Val: Function0<T>
// CHECK JVM_IR:
// Mangled name: #<get-kt26531Val>@0:0(){0§<kotlin.Any?>}kotlin.Function0<0:0>
// Public signature: /kt26531Val.<get-kt26531Val>|5121802790804301435[0]
// CHECK JS_IR NATIVE:
// Mangled name: #<get-kt26531Val>@0:0(){0§<kotlin.Any?>}
// Public signature: /kt26531Val.<get-kt26531Val>|-5027838736242807292[0]
get(): Function0<T>