[klib] Test signature descriptions in irText tests

KT-59486
This commit is contained in:
Sergej Jaskiewicz
2023-06-22 17:30:00 +02:00
committed by Space Team
parent 6142d75bb4
commit 5e63f7627f
562 changed files with 6867 additions and 9 deletions
@@ -6,6 +6,7 @@ fun interface IRunnable {
// CHECK:
// Mangled name: IRunnable#run(){}
// Public signature: /IRunnable.run|-991178076551934874[0]
// Public signature debug description: run(){}
abstract fun run(): Unit
}
@@ -13,15 +14,18 @@ fun interface IRunnable {
// CHECK:
// Mangled name: #foo1(IRunnable;kotlin.Array<out|kotlin.String>...){}
// Public signature: /foo1|8109256075034655920[0]
// Public signature debug description: foo1(IRunnable;kotlin.Array<out|kotlin.String>...){}
fun foo1(r: IRunnable, vararg s: String): Unit
// CHECK:
// Mangled name: #foo2(IRunnable;IRunnable;kotlin.Array<out|kotlin.String>...){}
// Public signature: /foo2|-847052428556006975[0]
// Public signature debug description: foo2(IRunnable;IRunnable;kotlin.Array<out|kotlin.String>...){}
fun foo2(r1: IRunnable, r2: IRunnable, vararg s: String): Unit
// CHECK:
// Mangled name: #test(kotlin.Function0<kotlin.Unit>;IRunnable;kotlin.String;kotlin.Array<kotlin.String>){}
// Public signature: /test|8261026842322841823[0]
// Public signature debug description: test(kotlin.Function0<kotlin.Unit>;IRunnable;kotlin.String;kotlin.Array<kotlin.String>){}
fun test(fn: Function0<Unit>, r: IRunnable, s: String, arr: Array<String>): Unit
@@ -6,9 +6,11 @@ fun interface Foo {
// CHECK JVM_IR:
// Mangled name: Foo#invoke(){}kotlin.String
// Public signature: /Foo.invoke|8861605044563078664[0]
// Public signature debug description: invoke(){}kotlin.String
// CHECK JS_IR NATIVE:
// Mangled name: Foo#invoke(){}
// Public signature: /Foo.invoke|-4663091332620260873[0]
// Public signature debug description: invoke(){}
abstract fun invoke(): String
}
@@ -16,17 +18,21 @@ fun interface Foo {
// CHECK JVM_IR:
// Mangled name: #foo(Foo){}kotlin.String
// Public signature: /foo|-5888774885663875480[0]
// Public signature debug description: foo(Foo){}kotlin.String
// CHECK JS_IR NATIVE:
// Mangled name: #foo(Foo){}
// Public signature: /foo|-8233162121880232317[0]
// Public signature debug description: foo(Foo){}
fun foo(f: Foo): String
// CHECK JVM_IR:
// Mangled name: #test(){}kotlin.String
// Public signature: /test|-7008832412320199001[0]
// Public signature debug description: test(){}kotlin.String
// CHECK JS_IR NATIVE:
// Mangled name: #test(){}
// Public signature: /test|6620506149988718649[0]
// Public signature debug description: test(){}
fun test(): String
// CHECK JVM_IR:
// Mangled name: #test(){}kotlin.String#<anonymous>#static(){}kotlin.String
@@ -6,6 +6,7 @@ fun interface KRunnable {
// CHECK:
// Mangled name: KRunnable#invoke(){}
// Public signature: /KRunnable.invoke|-4663091332620260873[0]
// Public signature debug description: invoke(){}
abstract fun invoke(): Unit
}
@@ -13,5 +14,6 @@ fun interface KRunnable {
// CHECK:
// Mangled name: #test(kotlin.Any?){}
// Public signature: /test|4942271194395271693[0]
// Public signature debug description: test(kotlin.Any?){}
fun test(a: Any?): Unit
@@ -6,6 +6,7 @@ fun interface Foo : Function0<Int> {
// CHECK JVM_IR:
// Mangled name: Foo#invoke(){}kotlin.Int
// Public signature: /Foo.invoke|906964710558498066[0]
// Public signature debug description: invoke(){}kotlin.Int
abstract /* fake */ override operator fun invoke(): Int
}
@@ -13,10 +14,12 @@ fun interface Foo : Function0<Int> {
// CHECK JVM_IR:
// Mangled name: #id(Foo){}kotlin.Any
// Public signature: /id|-7816997914602483733[0]
// Public signature debug description: id(Foo){}kotlin.Any
fun id(foo: Foo): Any
// CHECK:
// Mangled name: #test(Foo){}
// Public signature: /test|1185534388124909890[0]
// Public signature debug description: test(Foo){}
fun test(foo: Foo): Unit
@@ -1,25 +1,31 @@
// CHECK:
// Mangled name: {}fsi
// Public signature: /fsi|5902301571547257746[0]
// Public signature debug description: {}fsi
val fsi: Fn<String, Int>
// CHECK JVM_IR:
// Mangled name: #<get-fsi>(){}Fn<kotlin.String,kotlin.Int>
// Public signature: /fsi.<get-fsi>|-2546794996796226350[0]
// Public signature debug description: <get-fsi>(){}Fn<kotlin.String,kotlin.Int>
// CHECK JS_IR NATIVE:
// Mangled name: #<get-fsi>(){}
// Public signature: /fsi.<get-fsi>|211056100616532240[0]
// Public signature debug description: <get-fsi>(){}
get
// CHECK:
// Mangled name: {}fis
// Public signature: /fis|4743015834142814854[0]
// Public signature debug description: {}fis
val fis: Fn<Int, String>
// CHECK JVM_IR:
// Mangled name: #<get-fis>(){}Fn<kotlin.Int,kotlin.String>
// Public signature: /fis.<get-fis>|5252092316637653538[0]
// Public signature debug description: <get-fis>(){}Fn<kotlin.Int,kotlin.String>
// CHECK JS_IR NATIVE:
// Mangled name: #<get-fis>(){}
// Public signature: /fis.<get-fis>|-3144498278709673820[0]
// Public signature debug description: <get-fis>(){}
get
// CHECK:
@@ -29,14 +35,17 @@ class J {
// CHECK:
// Mangled name: J#<init>(){}
// Public signature: /J.<init>|-5645683436151566731[0]
// Public signature debug description: <init>(){}
constructor() /* primary */
// CHECK JVM_IR:
// Mangled name: J#runConversion(Fn<kotlin.String,kotlin.Int>;Fn<kotlin.Int,kotlin.String>){}kotlin.Int
// Public signature: /J.runConversion|4347513371052535712[0]
// Public signature debug description: runConversion(Fn<kotlin.String,kotlin.Int>;Fn<kotlin.Int,kotlin.String>){}kotlin.Int
// CHECK JS_IR NATIVE:
// Mangled name: J#runConversion(Fn<kotlin.String,kotlin.Int>;Fn<kotlin.Int,kotlin.String>){}
// Public signature: /J.runConversion|-3250437629905581865[0]
// Public signature debug description: runConversion(Fn<kotlin.String,kotlin.Int>;Fn<kotlin.Int,kotlin.String>){}
fun runConversion(f1: Fn<String, Int>, f2: Fn<Int, String>): Int
}
@@ -49,9 +58,11 @@ fun interface Fn<T : Any?, R : Any?> {
// CHECK JVM_IR:
// Mangled name: Fn#run(kotlin.String;kotlin.Int;1:0){}1:1
// Public signature: /Fn.run|6229634511602909233[0]
// Public signature debug description: run(kotlin.String;kotlin.Int;1:0){}1:1
// CHECK JS_IR NATIVE:
// Mangled name: Fn#run(kotlin.String;kotlin.Int;1:0){}
// Public signature: /Fn.run|-3043809751901738692[0]
// Public signature debug description: run(kotlin.String;kotlin.Int;1:0){}
abstract fun run(s: String, i: Int, t: T): R
}
@@ -59,5 +70,6 @@ fun interface Fn<T : Any?, R : Any?> {
// CHECK:
// Mangled name: #test(J){}
// Public signature: /test|-8477572416399964095[0]
// Public signature debug description: test(J){}
fun test(j: J): Unit
@@ -6,6 +6,7 @@ fun interface IFoo {
// CHECK:
// Mangled name: IFoo#foo(kotlin.Int){}
// Public signature: /IFoo.foo|-104159190164110731[0]
// Public signature debug description: foo(kotlin.Int){}
abstract fun foo(i: Int): Unit
}
@@ -13,28 +14,34 @@ fun interface IFoo {
// CHECK:
// Mangled name: #testAdaptedCR(){}
// Public signature: /testAdaptedCR|-2000726175248606[0]
// Public signature debug description: testAdaptedCR(){}
fun testAdaptedCR(): Unit
// CHECK:
// Mangled name: #testLambda(){}
// Public signature: /testLambda|-124997257399938843[0]
// Public signature debug description: testLambda(){}
fun testLambda(): Unit
// CHECK:
// Mangled name: #testSeveralLambdas(){}
// Public signature: /testSeveralLambdas|884186753581284332[0]
// Public signature debug description: testSeveralLambdas(){}
fun testSeveralLambdas(): Unit
// CHECK:
// Mangled name: #useVararg(kotlin.Array<out|IFoo>...){}
// Public signature: /useVararg|-167843892719966590[0]
// Public signature debug description: useVararg(kotlin.Array<out|IFoo>...){}
fun useVararg(vararg foos: IFoo): Unit
// CHECK JVM_IR:
// Mangled name: #withVarargOfInt(kotlin.IntArray...){}kotlin.String
// Public signature: /withVarargOfInt|-4664776409518571139[0]
// Public signature debug description: withVarargOfInt(kotlin.IntArray...){}kotlin.String
// CHECK JS_IR NATIVE:
// Mangled name: #withVarargOfInt(kotlin.IntArray...){}
// Public signature: /withVarargOfInt|-232972314185863621[0]
// Public signature debug description: withVarargOfInt(kotlin.IntArray...){}
fun withVarargOfInt(vararg xs: Int): String
@@ -6,6 +6,7 @@ fun interface MyRunnable {
// CHECK:
// Mangled name: MyRunnable#run(){}
// Public signature: /MyRunnable.run|-991178076551934874[0]
// Public signature debug description: run(){}
abstract fun run(): Unit
}
@@ -13,10 +14,12 @@ fun interface MyRunnable {
// CHECK:
// Mangled name: #foo(kotlin.Array<out|MyRunnable>...){}
// Public signature: /foo|6689815842309055774[0]
// Public signature debug description: foo(kotlin.Array<out|MyRunnable>...){}
fun foo(vararg rs: MyRunnable): Unit
// CHECK:
// Mangled name: #test(kotlin.Any;MyRunnable){}
// Public signature: /test|-2252565057874021036[0]
// Public signature debug description: test(kotlin.Any;MyRunnable){}
fun test(a: Any, r: MyRunnable): Unit
@@ -6,6 +6,7 @@ fun interface KRunnable {
// CHECK:
// Mangled name: KRunnable#run(){}
// Public signature: /KRunnable.run|-991178076551934874[0]
// Public signature debug description: run(){}
abstract fun run(): Unit
}
@@ -13,44 +14,54 @@ fun interface KRunnable {
// CHECK:
// Mangled name: #foo0(){}
// Public signature: /foo0|854950155582184407[0]
// Public signature debug description: foo0(){}
fun foo0(): Unit
// CHECK JVM_IR:
// Mangled name: #foo1(kotlin.IntArray...){}kotlin.Int
// Public signature: /foo1|7470134185704818303[0]
// Public signature debug description: foo1(kotlin.IntArray...){}kotlin.Int
// CHECK JS_IR NATIVE:
// Mangled name: #foo1(kotlin.IntArray...){}
// Public signature: /foo1|-6748328364529290172[0]
// Public signature debug description: foo1(kotlin.IntArray...){}
fun foo1(vararg xs: Int): Int
// CHECK JVM_IR:
// Mangled name: #testSamConstructor(){}KRunnable
// Public signature: /testSamConstructor|-5482155559435579976[0]
// Public signature debug description: testSamConstructor(){}KRunnable
// CHECK JS_IR NATIVE:
// Mangled name: #testSamConstructor(){}
// Public signature: /testSamConstructor|-7853436018033066699[0]
// Public signature debug description: testSamConstructor(){}
fun testSamConstructor(): KRunnable
// CHECK:
// Mangled name: #testSamConversion(){}
// Public signature: /testSamConversion|8522656930427711360[0]
// Public signature debug description: testSamConversion(){}
fun testSamConversion(): Unit
// CHECK:
// Mangled name: #testSamConversionOnAdapted(){}
// Public signature: /testSamConversionOnAdapted|2809940309834714371[0]
// Public signature debug description: testSamConversionOnAdapted(){}
fun testSamConversionOnAdapted(): Unit
// CHECK JVM_IR:
// Mangled name: #testSamCosntructorOnAdapted(){}KRunnable
// Public signature: /testSamCosntructorOnAdapted|655519272240812814[0]
// Public signature debug description: testSamCosntructorOnAdapted(){}KRunnable
// CHECK JS_IR NATIVE:
// Mangled name: #testSamCosntructorOnAdapted(){}
// Public signature: /testSamCosntructorOnAdapted|-7927635342265674772[0]
// Public signature debug description: testSamCosntructorOnAdapted(){}
fun testSamCosntructorOnAdapted(): KRunnable
// CHECK:
// Mangled name: #use(KRunnable){}
// Public signature: /use|3076420774911186780[0]
// Public signature debug description: use(KRunnable){}
fun use(r: KRunnable): Unit
@@ -6,6 +6,7 @@ fun interface KRunnable {
// CHECK:
// Mangled name: KRunnable#run(){}
// Public signature: /KRunnable.run|-991178076551934874[0]
// Public signature debug description: run(){}
abstract fun run(): Unit
}
@@ -20,88 +21,106 @@ interface Unrelated {
// CHECK JVM_IR:
// Mangled name: #id(0:0){0§<kotlin.Any?>}0:0
// Public signature: /id|-6791396263062521506[0]
// Public signature debug description: id(0:0){0§<kotlin.Any?>}0:0
// CHECK JS_IR NATIVE:
// Mangled name: #id(0:0){0§<kotlin.Any?>}
// Public signature: /id|9187295668833355463[0]
// Public signature debug description: id(0:0){0§<kotlin.Any?>}
fun <T : Any?> id(x: T): T
// CHECK:
// Mangled name: #run1(KRunnable){}
// Public signature: /run1|2612844463130679128[0]
// Public signature debug description: run1(KRunnable){}
fun run1(r: KRunnable): Unit
// CHECK:
// Mangled name: #run2(KRunnable;KRunnable){}
// Public signature: /run2|8208068882257438869[0]
// Public signature debug description: run2(KRunnable;KRunnable){}
fun run2(r1: KRunnable, r2: KRunnable): Unit
// CHECK:
// Mangled name: #test0(0:0){0§<KRunnable&kotlin.Function0<kotlin.Unit>>}
// Public signature: /test0|7203793719980108226[0]
// Public signature debug description: test0(0:0){0§<KRunnable&kotlin.Function0<kotlin.Unit>>}
fun <T> test0(a: T): Unit where T : KRunnable, T : Function0<Unit>
// CHECK:
// Mangled name: #test1(kotlin.Function0<kotlin.Unit>){}
// Public signature: /test1|-2870537507416699845[0]
// Public signature debug description: test1(kotlin.Function0<kotlin.Unit>){}
fun test1(a: Function0<Unit>): Unit
// CHECK:
// Mangled name: #test2(KRunnable){}
// Public signature: /test2|-6262171320756539088[0]
// Public signature debug description: test2(KRunnable){}
fun test2(a: KRunnable): Unit
// CHECK:
// Mangled name: #test3(kotlin.Function0<kotlin.Unit>){}
// Public signature: /test3|-1760685804488672424[0]
// Public signature debug description: test3(kotlin.Function0<kotlin.Unit>){}
fun test3(a: Function0<Unit>): Unit
// CHECK:
// Mangled name: #test4(kotlin.Function0<kotlin.Unit>;kotlin.Function0<kotlin.Unit>){}
// Public signature: /test4|1443124276429499957[0]
// Public signature debug description: test4(kotlin.Function0<kotlin.Unit>;kotlin.Function0<kotlin.Unit>){}
fun test4(a: Function0<Unit>, b: Function0<Unit>): Unit
// CHECK:
// Mangled name: #test5(kotlin.Any){}
// Public signature: /test5|4504681808078971124[0]
// Public signature debug description: test5(kotlin.Any){}
fun test5(a: Any): Unit
// CHECK:
// Mangled name: #test5x(kotlin.Any){}
// Public signature: /test5x|8044678810048210306[0]
// Public signature debug description: test5x(kotlin.Any){}
fun test5x(a: Any): Unit
// CHECK:
// Mangled name: #test6(kotlin.Any){}
// Public signature: /test6|-7590017673454141671[0]
// Public signature debug description: test6(kotlin.Any){}
fun test6(a: Any): Unit
// CHECK:
// Mangled name: #test7(kotlin.Function1<kotlin.Int,kotlin.Int>){}
// Public signature: /test7|1095013294548842913[0]
// Public signature debug description: test7(kotlin.Function1<kotlin.Int,kotlin.Int>){}
fun test7(a: Function1<Int, Int>): Unit
// CHECK:
// Mangled name: #test7a(0:0){0§<kotlin.Function1<kotlin.Int,kotlin.Int>>}
// Public signature: /test7a|4611209577080015095[0]
// Public signature debug description: test7a(0:0){0§<kotlin.Function1<kotlin.Int,kotlin.Int>>}
fun <T : Function1<Int, Int>> test7a(a: T): Unit
// CHECK:
// Mangled name: #test7b(0:0){0§<kotlin.Function1<kotlin.Int,kotlin.Unit>&kotlin.Function0<kotlin.Unit>>}
// Public signature: /test7b|4558127648037232116[0]
// Public signature debug description: test7b(0:0){0§<kotlin.Function1<kotlin.Int,kotlin.Unit>&kotlin.Function0<kotlin.Unit>>}
fun <T> test7b(a: T): Unit where T : Function0<Unit>, T : Function1<Int, Unit>
// CHECK:
// Mangled name: #test7c(0:0){0§<Unrelated&kotlin.Function0<kotlin.Unit>>}
// Public signature: /test7c|-2955596188911782407[0]
// Public signature debug description: test7c(0:0){0§<Unrelated&kotlin.Function0<kotlin.Unit>>}
fun <T> test7c(a: T): Unit where T : Unrelated, T : Function0<Unit>
// CHECK:
// Mangled name: #test8(kotlin.Function0<kotlin.Unit>){}
// Public signature: /test8|8321269803549472585[0]
// Public signature debug description: test8(kotlin.Function0<kotlin.Unit>){}
fun test8(a: Function0<Unit>): Unit
// CHECK:
// Mangled name: #test9(){}
// Public signature: /test9|9214787561267119658[0]
// Public signature debug description: test9(){}
fun test9(): Unit