[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
+79
@@ -0,0 +1,79 @@
|
||||
// CHECK:
|
||||
// Mangled name: Pair
|
||||
// Public signature: /Pair|null[0]
|
||||
data class Pair<A : Any?, B : Any?> {
|
||||
// CHECK:
|
||||
// Mangled name: Pair{}first
|
||||
// Public signature: /Pair.first|1497393077339299626[0]
|
||||
val first: A
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name: Pair#<get-first>(){}1:0
|
||||
// Public signature: /Pair.first.<get-first>|-2355525345180386541[0]
|
||||
get
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: Pair{}second
|
||||
// Public signature: /Pair.second|8934636033843101515[0]
|
||||
val second: B
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name: Pair#<get-second>(){}1:1
|
||||
// Public signature: /Pair.second.<get-second>|-7108495346814383827[0]
|
||||
get
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: Pair#<init>(1:0;1:1){}
|
||||
// Public signature: /Pair.<init>|3086114026882374588[0]
|
||||
constructor(first: A, second: B) /* primary */
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name: Pair#component1(){}1:0
|
||||
// Public signature: /Pair.component1|2393470133763651536[0]
|
||||
operator fun component1(): A
|
||||
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name: Pair#component2(){}1:1
|
||||
// Public signature: /Pair.component2|319033347667924570[0]
|
||||
operator fun component2(): B
|
||||
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name: Pair#copy(1:0;1:1){}Pair<1:0,1:1>
|
||||
// Public signature: /Pair.copy|7298985996422673194[0]
|
||||
fun copy(first: A, second: B): Pair<A, B>
|
||||
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name: Pair#equals(kotlin.Any?){}kotlin.Boolean
|
||||
// Public signature: /Pair.equals|722809408929142791[0]
|
||||
override operator fun equals(other: Any?): Boolean
|
||||
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name: Pair#hashCode(){}kotlin.Int
|
||||
// Public signature: /Pair.hashCode|-8048879360829830756[0]
|
||||
override fun hashCode(): Int
|
||||
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name: Pair#toString(){}kotlin.String
|
||||
// Public signature: /Pair.toString|6958853723545266802[0]
|
||||
override fun toString(): String
|
||||
|
||||
}
|
||||
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name: #box(){}kotlin.String
|
||||
// Public signature: /box|-9347091776561469[0]
|
||||
fun box(): String
|
||||
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name computed from Ir: #compareTo@0:0(java.util.Comparator<0:0>;0:0){0§<kotlin.Any?>}kotlin.Int
|
||||
// Mangled name computed from Descriptor: #compareTo!java.util.Comparator<0:0>@0:0(0:0){0§<kotlin.Any?>}kotlin.Int
|
||||
// Public signature: /compareTo|-4091974102091923679[0]
|
||||
infix operator fun <T : Any?> T.compareTo($context_receiver_0: Comparator<T>, other: T): Int
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: @Pair<0:0,0:0>{0§<kotlin.Any?>}min
|
||||
// Public signature: /min|6885845668930107919[0]
|
||||
val <T : Any?> Pair<T, T>.min: T
|
||||
// CHECK JVM_IR:
|
||||
// Mangled name computed from Ir: #<get-min>@Pair<0:0,0:0>(java.util.Comparator<0:0>){0§<kotlin.Any?>}0:0
|
||||
// Mangled name computed from Descriptor: #<get-min>!java.util.Comparator<0:0>@Pair<0:0,0:0>(){0§<kotlin.Any?>}0:0
|
||||
// Public signature: /min.<get-min>|6404877126791863503[0]
|
||||
get($context_receiver_0: Comparator<T>): T
|
||||
|
||||
Reference in New Issue
Block a user