[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,72 @@
// CHECK:
// Mangled name: {}unitFun
// Public signature: /unitFun|1803856459034755718[0]
val unitFun: Function0<Unit>
// CHECK JVM_IR:
// Mangled name: #<get-unitFun>(){}kotlin.Function0<kotlin.Unit>
// Public signature: /unitFun.<get-unitFun>|4532865110110179705[0]
get
// CHECK:
// Mangled name: {}intFun
// Public signature: /intFun|-4231876274735497813[0]
val intFun: Function0<Int>
// CHECK JVM_IR:
// Mangled name: #<get-intFun>(){}kotlin.Function0<kotlin.Int>
// Public signature: /intFun.<get-intFun>|4773158348447143883[0]
get
// CHECK:
// Mangled name: {}stringParamFun
// Public signature: /stringParamFun|-5263284220838449603[0]
val stringParamFun: Function1<String, Unit>
// CHECK JVM_IR:
// Mangled name: #<get-stringParamFun>(){}kotlin.Function1<kotlin.String,kotlin.Unit>
// Public signature: /stringParamFun.<get-stringParamFun>|-8573380628772791229[0]
get
// CHECK:
// Mangled name: {}listFun
// Public signature: /listFun|-6618675779589745857[0]
val listFun: Function1<List<String>, List<String>>
// CHECK JVM_IR:
// Mangled name: #<get-listFun>(){}kotlin.Function1<kotlin.collections.List<kotlin.String>,kotlin.collections.List<kotlin.String>>
// Public signature: /listFun.<get-listFun>|7260954818086257860[0]
get
// CHECK:
// Mangled name: {}mutableListFun
// Public signature: /mutableListFun|-8439106206370668738[0]
val mutableListFun: Function1<MutableList<Double>, MutableList<Int>>
// CHECK JVM_IR:
// Mangled name: #<get-mutableListFun>(){}kotlin.Function1<kotlin.collections.MutableList<kotlin.Double>,kotlin.collections.MutableList<kotlin.Int>>
// Public signature: /mutableListFun.<get-mutableListFun>|9091514786956715938[0]
get
// CHECK:
// Mangled name: {}funWithIn
// Public signature: /funWithIn|4959168396602064196[0]
val funWithIn: Function1<Comparable<String>, Unit>
// CHECK JVM_IR:
// Mangled name: #<get-funWithIn>(){}kotlin.Function1<kotlin.Comparable<kotlin.String>,kotlin.Unit>
// Public signature: /funWithIn.<get-funWithIn>|4348549724742549414[0]
get
// CHECK:
// Mangled name: {}extensionFun
// Public signature: /extensionFun|-1816227375732956320[0]
val extensionFun: @ExtensionFunctionType Function1<Any, Unit>
// CHECK JVM_IR:
// Mangled name: #<get-extensionFun>(){}kotlin.Function1<kotlin.Any,kotlin.Unit>
// Public signature: /extensionFun.<get-extensionFun>|791135109431325135[0]
get
// CHECK:
// Mangled name: {}extensionWithArgFun
// Public signature: /extensionWithArgFun|2301069184471380148[0]
val extensionWithArgFun: @ExtensionFunctionType Function2<Long, Any, Date>
// CHECK JVM_IR:
// Mangled name: #<get-extensionWithArgFun>(){}kotlin.Function2<kotlin.Long,kotlin.Any,java.util.Date>
// Public signature: /extensionWithArgFun.<get-extensionWithArgFun>|-6412543642125871211[0]
get