Update bytecode text tests for JVM_IR

This commit is contained in:
Dmitry Petrov
2020-02-19 16:26:50 +03:00
parent 071149e0fb
commit 81b30b7399
31 changed files with 107 additions and 73 deletions

View File

@@ -1,4 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// -IGNORE_BACKEND: JVM_IR
inline fun <T> runAfterLoop(fn: () -> T): T {
for (i in 1..2);
return fn()
@@ -6,18 +6,25 @@ inline fun <T> runAfterLoop(fn: () -> T): T {
inline fun bar(x: Int, y: Long, z: Byte, s: String) = runAfterLoop { x.toString() + y.toString() + z.toString() + s }
fun foobar(x: Int, y: Long, s: String, z: Byte) = x.toString() + y.toString() + s + z.toString()
fun foobar(x: Int, y: Long, s: String, z: Byte) {}
fun foo() : String {
return foobar(1, 2L, bar(3, 4L, 5.toByte(), "6"), 7.toByte())
fun foo() {
foobar(1, 2L, bar(3, 4L, 5.toByte(), "6"), 7.toByte())
}
// fake inline variables occupy 7 ISTOREs.
// 16 ISTORE
// 13 ILOAD
// 2 ASTORE
// 8 ALOAD
// 7 ALOAD
// 2 LSTORE
// 4 LLOAD
// 3 LLOAD
// 1 MAXLOCALS = 10
// 0 InlineMarker
// JVM_TEMPLATES
// fake inline variables occupy 7 ISTOREs.
// 16 ISTORE
// 11 ILOAD
// JVM_IR_TEMPLATES
// JVM_IR generates an extra induction variable in 'for (i in 1..2)' (see KT-36837)
// 19 ISTORE
// 14 ILOAD

View File

@@ -1,4 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// -IGNORE_BACKEND: JVM_IR
inline fun <T> runAfterLoop(fn: () -> T): T {
for (i in 1..2);
return fn()
@@ -6,7 +6,7 @@ inline fun <T> runAfterLoop(fn: () -> T): T {
fun bar() : Boolean = true
fun foobar(x: Boolean, y: String, z: String) = x.toString() + y + z
fun foobar(x: Boolean, y: String, z: String) {}
inline fun foo() = runAfterLoop { "-" }
@@ -14,11 +14,18 @@ fun test() {
val result = foobar(if (1 == 1) true else bar(), foo(), "OK")
}
// fake inline variables occupy 7 ISTOREs.
// 14 ISTORE
// 8 ILOAD
// 2 ASTORE
// 7 ALOAD
// 5 ALOAD
// 1 MAXLOCALS = 3
// 1 MAXLOCALS = 4
// 0 InlineMarker
// JVM_TEMPLATES
// fake inline variables occupy 7 ISTOREs.
// 14 ISTORE
// 7 ILOAD
// JVM_IR_TEMPLATES
// JVM_IR generates an extra induction variable in 'for (i in 1..2)' (see KT-36837)
// 17 ISTORE
// 10 ILOAD