JVM: Add more tests to jvm-abi-gen

This commit is contained in:
Steven Schäfer
2021-01-06 17:19:04 +01:00
committed by Alexander Udalov
parent d08990ebb4
commit 8efb955ab5
25 changed files with 230 additions and 0 deletions
@@ -0,0 +1,5 @@
package test
private val x = object { fun f() = 1 }
fun g() = x.f() + object { fun f() = 0 }.f()
@@ -0,0 +1 @@
// IGNORE_BACKEND_LEGACY: JVM
@@ -0,0 +1,3 @@
package test
fun g() = 1
@@ -0,0 +1,9 @@
package test
class A {
fun f() = 1
val x = 2
}
val y = 3
fun g() = 4
@@ -0,0 +1 @@
// IGNORE_BACKEND_LEGACY: JVM
@@ -0,0 +1,9 @@
package test
fun g() = 4
val y = 3
class A {
val x = 2
fun f() = 1
}
@@ -0,0 +1,4 @@
package test
inline fun f() = 1
inline fun g() = 2
@@ -0,0 +1,7 @@
package test
inline fun g() = 2
inline fun f() = 1
// This changes the line numbers in f, g
@@ -0,0 +1,7 @@
package test
inline fun f() = 1
fun g() = f()
@@ -0,0 +1,2 @@
// IGNORE_BACKEND_LEGACY: JVM
// IGNORE_BACKEND: JVM, JVM_IR
@@ -0,0 +1,8 @@
package test
fun g() = f()
inline fun f() = 1
// This does not change the line numbers in f, but does change the line
// numbers in the SourceDebug extension section which has to be rewritten.
@@ -0,0 +1,6 @@
package test
inline fun f() = 1
fun g() = 2
fun h() = 3
@@ -0,0 +1 @@
// IGNORE_BACKEND_LEGACY: JVM
@@ -0,0 +1,6 @@
package test
inline fun f() = 1
fun h() = 3
fun g() = 2
@@ -0,0 +1,9 @@
package test
private inline fun f(): Int {
return g()
}
private inline fun g() = 1
fun h() = f()
@@ -0,0 +1 @@
// IGNORE_BACKEND_LEGACY: JVM
@@ -0,0 +1,10 @@
package test
fun h() = f()
private inline fun g() = 1
private inline fun f(): Int {
return g()
}
@@ -0,0 +1,4 @@
package test
private inline fun f() = { 1 }()
fun g() = f()
@@ -0,0 +1 @@
// IGNORE_BACKEND_LEGACY: JVM
@@ -0,0 +1,3 @@
package test
fun g() = 1
@@ -0,0 +1,8 @@
package test
private val x = 1
// We don't yet strip out empty top-level classes from the kotlin_module files!
val y = 2
object A { fun f() = x }
@@ -0,0 +1,5 @@
package test
object A { fun f() = 1 }
val y = 2