JVM_IR add bytecode shape check to all relevant for-loop tests

This commit is contained in:
Dmitry Petrov
2021-09-06 16:42:48 +03:00
committed by TeamCityServer
parent d9e4dec810
commit 860c80d210
105 changed files with 780 additions and 78 deletions
@@ -32,3 +32,10 @@ fun box(): String {
// The 1st ICONST_0 is for initializing the array. 2nd is for initializing the index in the lowered for-loop.
// 2 ICONST_0
// JVM_IR_TEMPLATES
// 5 ILOAD
// 3 ISTORE
// 0 IADD
// 0 ISUB
// 1 IINC
@@ -32,3 +32,10 @@ fun box(): String {
// The 1st ICONST_0 is for initializing the array. 2nd is for initializing the index in the lowered for-loop.
// 2 ICONST_0
// JVM_IR_TEMPLATES
// 3 ILOAD
// 2 ISTORE
// 0 IADD
// 0 ISUB
// 1 IINC
@@ -29,3 +29,10 @@ fun box(): String {
// The 1st ICONST_0 is for initializing the array. 2nd is for initializing the index in the lowered for-loop.
// 2 ICONST_0
// JVM_IR_TEMPLATES
// 4 ILOAD
// 4 ISTORE
// 0 IADD
// 0 ISUB
// 1 IINC
@@ -30,3 +30,10 @@ fun box(): String {
// The 1st ICONST_0 is for initializing the array. 2nd is for initializing the index in the lowered for-loop.
// 2 ICONST_0
// JVM_IR_TEMPLATES
// 6 ILOAD
// 4 ISTORE
// 0 IADD
// 0 ISUB
// 1 IINC
@@ -32,3 +32,10 @@ fun box(): String {
// The 1st ICONST_0 is for initializing the array. 2nd is for initializing the index in the lowered for-loop.
// 2 ICONST_0
// JVM_IR_TEMPLATES
// 5 ILOAD
// 3 ISTORE
// 0 IADD
// 0 ISUB
// 1 IINC
@@ -23,3 +23,10 @@ fun test() {
// 0 iterator
// 0 hasNext
// 0 nextChar
// JVM_IR_TEMPLATES
// 10 ILOAD
// 8 ISTORE
// 0 IADD
// 0 ISUB
// 3 IINC
@@ -19,3 +19,10 @@ fun <T : CharSequence> test(sequence: T) {
// 0 nextChar
// 1 INVOKEINTERFACE java/lang/CharSequence\.charAt \(I\)C
// 1 INVOKEINTERFACE java/lang/CharSequence\.length \(\)I
// JVM_IR_TEMPLATES
// 3 ILOAD
// 2 ISTORE
// 0 IADD
// 0 ISUB
// 1 IINC
@@ -33,3 +33,10 @@ fun box(): String {
// The ICONST_0 is for initializing the index in the lowered for-loop.
// 1 ICONST_0
// JVM_IR_TEMPLATES
// 5 ILOAD
// 3 ISTORE
// 0 IADD
// 0 ISUB
// 1 IINC
@@ -27,3 +27,10 @@ fun box(): String {
// The ICONST_0 is for initializing the index in the lowered for-loop.
// 1 ICONST_0
// JVM_IR_TEMPLATES
// 4 ILOAD
// 4 ISTORE
// 0 IADD
// 0 ISUB
// 1 IINC
@@ -31,3 +31,10 @@ fun box(): String {
// The ICONST_0 is for initializing the index in the lowered for-loop.
// 1 ICONST_0
// JVM_IR_TEMPLATES
// 6 ILOAD
// 4 ISTORE
// 0 IADD
// 0 ISUB
// 1 IINC
@@ -33,3 +33,10 @@ fun box(): String {
// The ICONST_0 is for initializing the index in the lowered for-loop.
// 1 ICONST_0
// JVM_IR_TEMPLATES
// 5 ILOAD
// 3 ISTORE
// 0 IADD
// 0 ISUB
// 1 IINC
@@ -33,3 +33,10 @@ fun box(): String {
// The ICONST_0 is for initializing the index in the lowered for-loop.
// 1 ICONST_0
// JVM_IR_TEMPLATES
// 4 ILOAD
// 3 ISTORE
// 0 IADD
// 0 ISUB
// 1 IINC
@@ -36,3 +36,10 @@ fun box(): String {
// The ICONST_0 is for initializing the index in the lowered for-loop.
// 1 ICONST_0
// JVM_IR_TEMPLATES
// 7 ILOAD
// 4 ISTORE
// 0 IADD
// 0 ISUB
// 1 IINC
@@ -1,3 +1,5 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IMPORTANT!
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
// examine the resulting bytecode shape carefully.
@@ -23,4 +25,11 @@ fun f(a: Char): Int {
// 0 getFirst
// 0 getLast
// 0 getStep
// 2 IF
// 2 IF
// JVM_IR_TEMPLATES
// 5 ILOAD
// 3 ISTORE
// 1 IADD
// 0 ISUB
// 1 IINC
@@ -1,3 +1,5 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IMPORTANT!
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
// examine the resulting bytecode shape carefully.
@@ -24,4 +26,11 @@ fun f(a: Int): Int {
// 0 getLast
// 0 getStep
// 2 IF_ICMP
// 2 IF
// 2 IF
// JVM_IR_TEMPLATES
// 4 ILOAD
// 2 ISTORE
// 0 IADD
// 0 ISUB
// 2 IINC
@@ -1,3 +1,5 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IMPORTANT!
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
// examine the resulting bytecode shape carefully.
@@ -24,4 +26,11 @@ fun f(a: Long): Int {
// 0 getLast
// 0 getStep
// 2 LCMP
// 2 IF
// 2 IF
// JVM_IR_TEMPLATES
// 1 ILOAD
// 1 ISTORE
// 0 IADD
// 0 ISUB
// 1 IINC
@@ -19,3 +19,10 @@ fun box(): String {
}
// 0 iterator
// JVM_IR_TEMPLATES
// 3 ILOAD
// 2 ISTORE
// 0 IADD
// 0 ISUB
// 0 IINC
@@ -27,3 +27,9 @@ fun test(s: CharSequence): Int {
// 1 IF_ICMPGE
// 1 IF
// JVM_IR_TEMPLATES
// 5 ILOAD
// 4 ISTORE
// 2 IADD
// 0 ISUB
// 1 IINC
@@ -27,3 +27,10 @@ fun <T : CharSequence> test(s: T): Int {
// 0 IF_ICMPLE
// 1 IF_ICMPGE
// 1 IF
// JVM_IR_TEMPLATES
// 5 ILOAD
// 4 ISTORE
// 2 IADD
// 0 ISUB
// 1 IINC
@@ -25,3 +25,10 @@ fun Collection<Int>.sumIndices(): Int {
// 0 IF_ICMPGT
// 0 IF_ICMPLE
// 1 IF
// JVM_IR_TEMPLATES
// 5 ILOAD
// 4 ISTORE
// 1 IADD
// 0 ISUB
// 1 IINC
@@ -24,3 +24,10 @@ fun test() {
// 0 IF_ICMPGT
// 0 IF_ICMPLE
// 1 IF
// JVM_IR_TEMPLATES
// 4 ILOAD
// 4 ISTORE
// 1 IADD
// 0 ISUB
// 1 IINC
@@ -25,3 +25,10 @@ fun <T : Collection<*>> test(c: T) {
// 0 IF_ICMPGT
// 0 IF_ICMPLE
// 1 IF
// JVM_IR_TEMPLATES
// 4 ILOAD
// 4 ISTORE
// 1 IADD
// 0 ISUB
// 1 IINC
@@ -23,3 +23,10 @@ fun test(coll: Collection<*>?): Int {
// 1 getIndices
// 1 getFirst
// 1 getLast
// JVM_IR_TEMPLATES
// 7 ILOAD
// 4 ISTORE
// 1 IADD
// 0 ISUB
// 1 IINC
@@ -24,3 +24,10 @@ fun test() {
// 0 IF_ICMPGT
// 0 IF_ICMPLE
// 1 IF
// JVM_IR_TEMPLATES
// 4 ILOAD
// 4 ISTORE
// 1 IADD
// 0 ISUB
// 1 IINC
@@ -24,3 +24,10 @@ fun test() {
// 0 IF_ICMPGT
// 0 IF_ICMPLE
// 1 IF
// JVM_IR_TEMPLATES
// 4 ILOAD
// 4 ISTORE
// 1 IADD
// 0 ISUB
// 1 IINC
@@ -28,3 +28,10 @@ fun box(): String {
// - Initializing the index in the lowered for-loop.
// 1 ICONST_0
// JVM_IR_TEMPLATES
// 2 ILOAD
// 2 ISTORE
// 1 IADD
// 0 ISUB
// 0 IINC
@@ -25,3 +25,10 @@ fun <T : Iterable<*>> test(iterable: T): String {
// 1 next
// 0 component1
// 0 component2
// JVM_IR_TEMPLATES
// 3 ILOAD
// 3 ISTORE
// 1 IADD
// 0 ISUB
// 0 IINC
@@ -31,3 +31,10 @@ fun box(): String {
// The 1st ICONST_0 is for initializing the list. 2nd is for initializing the index in the lowered for-loop.
// 2 ICONST_0
// JVM_IR_TEMPLATES
// 3 ILOAD
// 3 ISTORE
// 1 IADD
// 0 ISUB
// 0 IINC
@@ -31,3 +31,10 @@ fun box(): String {
// The 1st ICONST_0 is for initializing the list. 2nd is for initializing the index in the lowered for-loop.
// 2 ICONST_0
// JVM_IR_TEMPLATES
// 3 ILOAD
// 3 ISTORE
// 1 IADD
// 0 ISUB
// 0 IINC
@@ -31,3 +31,10 @@ fun box(): String {
// The 1st ICONST_0 is for initializing the list. 2nd is for initializing the index in the lowered for-loop.
// 2 ICONST_0
// JVM_IR_TEMPLATES
// 1 ILOAD
// 2 ISTORE
// 1 IADD
// 0 ISUB
// 0 IINC
@@ -34,3 +34,10 @@ fun box(): String {
// The 1st ICONST_0 is for initializing the list. 2nd is for initializing the index in the lowered for-loop.
// 2 ICONST_0
// JVM_IR_TEMPLATES
// 4 ILOAD
// 3 ISTORE
// 1 IADD
// 0 ISUB
// 0 IINC
@@ -1,3 +1,5 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IMPORTANT!
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
// examine the resulting bytecode shape carefully.
@@ -21,4 +23,11 @@ fun f(): Int {
// 1 INVOKESTATIC .*\.array \(\)
// 1 ARRAYLENGTH
// 1 IF_ICMPGE
// 1 IF
// 1 IF
// JVM_IR_TEMPLATES
// 4 ILOAD
// 3 ISTORE
// 0 IADD
// 0 ISUB
// 2 IINC
@@ -1,3 +1,5 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IMPORTANT!
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
// examine the resulting bytecode shape carefully.
@@ -27,4 +29,11 @@ fun f(): Int {
// 1 INVOKESTATIC .*\.longArray \(\)
// 2 ARRAYLENGTH
// 2 IF_ICMPGE
// 2 IF
// 2 IF
// JVM_IR_TEMPLATES
// 7 ILOAD
// 6 ISTORE
// 0 IADD
// 0 ISUB
// 4 IINC
@@ -37,3 +37,10 @@ fun box(): String {
// 0 getFirst
// 0 getLast
// 0 getStep
// JVM_IR_TEMPLATES
// 4 ILOAD
// 5 ISTORE
// 1 IADD
// 0 ISUB
// 1 IINC
@@ -38,3 +38,10 @@ fun box(): String {
// 0 getLast
// 0 getStep
// 0 getIndices
// JVM_IR_TEMPLATES
// 4 ILOAD
// 4 ISTORE
// 0 IADD
// 0 ISUB
// 1 IINC
@@ -37,3 +37,10 @@ fun box(): String {
// 0 getFirst
// 0 getLast
// 0 getStep
// JVM_IR_TEMPLATES
// 4 ILOAD
// 5 ISTORE
// 1 IADD
// 0 ISUB
// 1 IINC
@@ -39,3 +39,10 @@ fun box(): String {
// 0 getStep
// 0 reversed
// 0 step
// JVM_IR_TEMPLATES
// 7 ILOAD
// 6 ISTORE
// 1 IADD
// 0 ISUB
// 1 IINC
@@ -38,3 +38,10 @@ fun box(): String {
// 0 getLast
// 0 getStep
// 0 reversed
// JVM_IR_TEMPLATES
// 4 ILOAD
// 5 ISTORE
// 1 IADD
// 0 ISUB
// 1 IINC
@@ -39,3 +39,10 @@ fun box(): String {
// 0 getStep
// 0 reversed
// 0 step
// JVM_IR_TEMPLATES
// 5 ILOAD
// 5 ISTORE
// 1 IADD
// 0 ISUB
// 1 IINC
@@ -38,3 +38,10 @@ fun box(): String {
// 0 getLast
// 0 getStep
// 0 step
// JVM_IR_TEMPLATES
// 7 ILOAD
// 6 ISTORE
// 1 IADD
// 0 ISUB
// 1 IINC
@@ -37,3 +37,10 @@ fun box(): String {
// 0 getFirst
// 0 getLast
// 0 getStep
// JVM_IR_TEMPLATES
// 4 ILOAD
// 5 ISTORE
// 1 IADD
// 0 ISUB
// 1 IINC
@@ -37,3 +37,10 @@ fun box(): String {
// 0 getFirst
// 0 getLast
// 0 getStep
// JVM_IR_TEMPLATES
// 2 ILOAD
// 3 ISTORE
// 1 IADD
// 0 ISUB
// 1 IINC
@@ -22,3 +22,10 @@ fun box(): String {
// 1 next
// 0 component1
// 0 component2
// JVM_IR_TEMPLATES
// 0 ILOAD
// 0 ISTORE
// 0 IADD
// 0 ISUB
// 0 IINC
@@ -23,3 +23,10 @@ fun box(): String {
// 1 component1
// 1 component2
// 1 reversed
// JVM_IR_TEMPLATES
// 0 ILOAD
// 2 ISTORE
// 0 IADD
// 0 ISUB
// 0 IINC
@@ -27,3 +27,10 @@ fun box(): String {
// The ICONST_0 is for initializing the index in the lowered for-loop.
// 1 ICONST_0
// JVM_IR_TEMPLATES
// 2 ILOAD
// 3 ISTORE
// 1 IADD
// 0 ISUB
// 0 IINC
@@ -30,4 +30,11 @@ fun test(): Int {
// JVM_IR_TEMPLATES
// 1 IF_ICMPGE
// 1 IF
// 1 IF
// JVM_IR_TEMPLATES
// 5 ILOAD
// 4 ISTORE
// 2 IADD
// 0 ISUB
// 0 IINC
@@ -1,3 +1,5 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IMPORTANT!
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
// examine the resulting bytecode shape carefully.
@@ -24,4 +26,11 @@ fun f(a: Char): Int {
// 0 getLast
// 0 getStep
// 2 IF_ICMP
// 2 IF
// 2 IF
// JVM_IR_TEMPLATES
// 5 ILOAD
// 3 ISTORE
// 1 IADD
// 0 ISUB
// 1 IINC
@@ -27,4 +27,6 @@ fun test(): Int {
// 1 IF
// 4 ILOAD
// 3 ISTORE
// 1 IADD
// 0 ISUB
// 1 IINC
@@ -1,3 +1,5 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IMPORTANT!
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
// examine the resulting bytecode shape carefully.
@@ -24,4 +26,11 @@ fun f(a: Int): Int {
// 0 getLast
// 0 getStep
// 2 IF_ICMP
// 2 IF
// 2 IF
// JVM_IR_TEMPLATES
// 4 ILOAD
// 2 ISTORE
// 0 IADD
// 0 ISUB
// 2 IINC
@@ -35,4 +35,11 @@ fun test(): Long {
// JVM_IR_TEMPLATES
// 1 LCMP
// 1 IFGE
// 1 IF
// 1 IF
// JVM_IR_TEMPLATES
// 0 ILOAD
// 0 ISTORE
// 0 IADD
// 0 ISUB
// 0 IINC
@@ -1,3 +1,5 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IMPORTANT!
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
// examine the resulting bytecode shape carefully.
@@ -24,4 +26,11 @@ fun f(a: Long): Int {
// 0 getLast
// 0 getStep
// 2 LCMP
// 2 IF
// 2 IF
// JVM_IR_TEMPLATES
// 1 ILOAD
// 1 ISTORE
// 0 IADD
// 0 ISUB
// 1 IINC
@@ -33,4 +33,11 @@ fun test(): Int {
// JVM_IR_TEMPLATES
// 1 IF_ICMPGE
// 1 IF
// 1 IF
// JVM_IR_TEMPLATES
// 4 ILOAD
// 3 ISTORE
// 1 IADD
// 0 ISUB
// 1 IINC
@@ -22,4 +22,11 @@ fun Int.digitsUpto(end: Int): Int {
// 0 getLast
// 0 getStep
// 2 IF_ICMP
// 2 IF
// 2 IF
// JVM_IR_TEMPLATES
// 8 ILOAD
// 3 ISTORE
// 1 IADD
// 0 ISUB
// 1 IINC
@@ -35,4 +35,11 @@ fun box(): String {
// JVM_IR_TEMPLATES
// 1 IF_ICMPGT
// 1 IF_ICMPLE
// 2 IF
// 2 IF
// JVM_IR_TEMPLATES
// 7 ILOAD
// 4 ISTORE
// 3 IADD
// 0 ISUB
// 1 IINC
@@ -36,3 +36,10 @@ fun box(): String {
// 1 IF_ICMPGT
// 1 IF_ICMPLE
// 2 IF
// JVM_IR_TEMPLATES
// 7 ILOAD
// 4 ISTORE
// 3 IADD
// 1 ISUB
// 1 IINC
@@ -35,4 +35,11 @@ fun box(): String {
// JVM_IR_TEMPLATES
// 1 IF_ICMPGT
// 1 IF_ICMPLE
// 2 IF
// 2 IF
// JVM_IR_TEMPLATES
// 7 ILOAD
// 4 ISTORE
// 3 IADD
// 0 ISUB
// 1 IINC
@@ -49,4 +49,11 @@ fun box(): String {
// 2 IF_ICMPLE
// 1 IFLE
// 4 IF
// 2 LCMP
// 2 LCMP
// JVM_IR_TEMPLATES
// 11 ILOAD
// 9 ISTORE
// 3 IADD
// 1 ISUB
// 1 IINC
@@ -27,3 +27,10 @@ fun box(): String {
// 0 getFirst
// 0 getLast
// 0 getStep
// JVM_IR_TEMPLATES
// 0 ILOAD
// 2 ISTORE
// 0 IADD
// 0 ISUB
// 0 IINC
@@ -41,3 +41,10 @@ fun box(): String {
// 0 getEnd
// 3 getFirst
// 3 getLast
// JVM_IR_TEMPLATES
// 15 ILOAD
// 9 ISTORE
// 3 IADD
// 1 ISUB
// 1 IINC
@@ -50,4 +50,11 @@ fun box(): String {
// 1 IFGT
// 1 IFLE
// 4 IF
// 2 LCMP
// 2 LCMP
// JVM_IR_TEMPLATES
// 11 ILOAD
// 9 ISTORE
// 3 IADD
// 1 ISUB
// 1 IINC
@@ -27,3 +27,10 @@ fun box(): String {
// 0 getFirst
// 0 getLast
// 0 getStep
// JVM_IR_TEMPLATES
// 8 ILOAD
// 4 ISTORE
// 3 IADD
// 0 ISUB
// 1 IINC
@@ -53,4 +53,11 @@ fun box(): String {
// 1 IFGT
// 1 IFLE
// 4 IF
// 2 LCMP
// 2 LCMP
// JVM_IR_TEMPLATES
// 11 ILOAD
// 9 ISTORE
// 3 IADD
// 1 ISUB
// 1 IINC
@@ -41,3 +41,10 @@ fun box(): String {
// 0 getEnd
// 3 getFirst
// 3 getLast
// JVM_IR_TEMPLATES
// 15 ILOAD
// 9 ISTORE
// 3 IADD
// 1 ISUB
// 1 IINC
@@ -41,3 +41,10 @@ fun box(): String {
// 0 getEnd
// 3 getFirst
// 3 getLast
// JVM_IR_TEMPLATES
// 15 ILOAD
// 9 ISTORE
// 3 IADD
// 1 ISUB
// 1 IINC
@@ -49,4 +49,11 @@ fun box(): String {
// 3 reversed
// 3 getFirst
// 3 getLast
// 3 getStep
// 3 getStep
// JVM_IR_TEMPLATES
// 24 ILOAD
// 12 ISTORE
// 4 IADD
// 1 ISUB
// 0 IINC
@@ -49,4 +49,11 @@ fun box(): String {
// 3 reversed
// 3 getFirst
// 3 getLast
// 3 getStep
// 3 getStep
// JVM_IR_TEMPLATES
// 24 ILOAD
// 12 ISTORE
// 4 IADD
// 1 ISUB
// 0 IINC
@@ -28,3 +28,10 @@ fun box(): String {
// - Initializing the index in the lowered for-loop.
// 1 ICONST_0
// JVM_IR_TEMPLATES
// 2 ILOAD
// 2 ISTORE
// 1 IADD
// 0 ISUB
// 0 IINC
@@ -25,3 +25,10 @@ fun <T : Sequence<*>> test(sequence: T): String {
// 1 next
// 0 component1
// 0 component2
// JVM_IR_TEMPLATES
// 3 ILOAD
// 3 ISTORE
// 1 IADD
// 0 ISUB
// 0 IINC
@@ -31,3 +31,10 @@ fun box(): String {
// The 1st ICONST_0 is for initializing the list. 2nd is for initializing the index in the lowered for-loop.
// 2 ICONST_0
// JVM_IR_TEMPLATES
// 3 ILOAD
// 3 ISTORE
// 1 IADD
// 0 ISUB
// 0 IINC
@@ -31,3 +31,10 @@ fun box(): String {
// The 1st ICONST_0 is for initializing the list. 2nd is for initializing the index in the lowered for-loop.
// 2 ICONST_0
// JVM_IR_TEMPLATES
// 3 ILOAD
// 3 ISTORE
// 1 IADD
// 0 ISUB
// 0 IINC
@@ -31,3 +31,10 @@ fun box(): String {
// The 1st ICONST_0 is for initializing the list. 2nd is for initializing the index in the lowered for-loop.
// 2 ICONST_0
// JVM_IR_TEMPLATES
// 1 ILOAD
// 2 ISTORE
// 1 IADD
// 0 ISUB
// 0 IINC
@@ -41,3 +41,10 @@ fun box(): String {
// The 1st ICONST_0 is for initializing the list. 2nd is for cmeThrown. 3rd is for initializing the index in the lowered for-loop.
// 3 ICONST_0
// JVM_IR_TEMPLATES
// 4 ILOAD
// 5 ISTORE
// 1 IADD
// 0 ISUB
// 0 IINC
@@ -34,3 +34,10 @@ fun box(): String {
// The 1st ICONST_0 is for initializing the list. 2nd is for initializing the index in the lowered for-loop.
// 2 ICONST_0
// JVM_IR_TEMPLATES
// 4 ILOAD
// 3 ISTORE
// 1 IADD
// 0 ISUB
// 0 IINC
@@ -20,3 +20,10 @@ fun test() {
// 0 INVOKEINTERFACE
// 1 charAt \(I\)C
// 1 length \(\)I
// JVM_IR_TEMPLATES
// 4 ILOAD
// 3 ISTORE
// 0 IADD
// 0 ISUB
// 1 IINC
@@ -25,3 +25,10 @@ fun test(a: Char, b: Char): String {
// 1 IF_ICMPGE
// 0 IF_ICMPLT
// 1 IF
// JVM_IR_TEMPLATES
// 5 ILOAD
// 2 ISTORE
// 1 IADD
// 0 ISUB
// 0 IINC
@@ -1,3 +1,5 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IMPORTANT!
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
// examine the resulting bytecode shape carefully.
@@ -27,3 +29,10 @@ fun f(a: Char): Int {
// 1 IF_ICMPGE
// 0 IF_ICMPLT
// 1 IF
// JVM_IR_TEMPLATES
// 4 ILOAD
// 3 ISTORE
// 1 IADD
// 0 ISUB
// 1 IINC
@@ -1,3 +1,5 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IMPORTANT!
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
// examine the resulting bytecode shape carefully.
@@ -25,4 +27,11 @@ fun f(a: Char): Int {
// 0 getStep
// 1 IFGE
// 1 IF
// 1 IF
// JVM_IR_TEMPLATES
// 4 ILOAD
// 3 ISTORE
// 1 IADD
// 0 ISUB
// 1 IINC
@@ -24,3 +24,10 @@ fun test(a: Int, b: Int): Int {
// 1 IF_ICMPGE
// 1 IF
// JVM_IR_TEMPLATES
// 6 ILOAD
// 3 ISTORE
// 1 IADD
// 0 ISUB
// 1 IINC
@@ -1,3 +1,5 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IMPORTANT!
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
// examine the resulting bytecode shape carefully.
@@ -26,3 +28,10 @@ fun f(a: Int): Int {
// 1 IF_ICMPGE
// 1 IF
// JVM_IR_TEMPLATES
// 3 ILOAD
// 2 ISTORE
// 0 IADD
// 0 ISUB
// 2 IINC
@@ -1,3 +1,5 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IMPORTANT!
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
// examine the resulting bytecode shape carefully.
@@ -29,3 +31,10 @@ fun f(a: Int): Int {
// 1 IF_ICMPGE
// 1 IF
// JVM_IR_TEMPLATES
// 3 ILOAD
// 2 ISTORE
// 0 IADD
// 0 ISUB
// 2 IINC
@@ -25,3 +25,10 @@ fun test(a: Long, b: Long): Long {
// 1 LCMP
// 1 IFGE
// 1 IF
// JVM_IR_TEMPLATES
// 0 ILOAD
// 0 ISTORE
// 0 IADD
// 0 ISUB
// 0 IINC
@@ -1,3 +1,5 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IMPORTANT!
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
// examine the resulting bytecode shape carefully.
@@ -27,3 +29,10 @@ fun f(a: Long): Int {
// 1 LCMP
// 1 IFGE
// 1 IF
// JVM_IR_TEMPLATES
// 1 ILOAD
// 1 ISTORE
// 0 IADD
// 0 ISUB
// 1 IINC
@@ -1,3 +1,5 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IMPORTANT!
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
// examine the resulting bytecode shape carefully.
@@ -26,3 +28,10 @@ fun f(a: Long): Int {
// 1 IFGE
// 1 IF
// JVM_IR_TEMPLATES
// 1 ILOAD
// 1 ISTORE
// 0 IADD
// 0 ISUB
// 1 IINC
@@ -21,4 +21,11 @@ fun test(): Int {
// 0 getFirst
// 0 getLast
// 1 IF_ICMP
// 1 IF
// 1 IF
// JVM_IR_TEMPLATES
// 5 ILOAD
// 4 ISTORE
// 1 IADD
// 0 ISUB
// 1 IINC
@@ -40,5 +40,8 @@ fun uShortRangeTo(a: UShort, b: UShort) { for (i in a .. b) {} }
// 16 IINC
// JVM_IR_TEMPLATES
// 136 ILOAD
// 56 ISTORE
// 0 IADD
// 20 IINC
// 0 ISUB
// 20 IINC
@@ -35,4 +35,11 @@ fun testObjectArray(n: Int) =
// 0 IF_ICMPGT
// 0 IF_CMPEQ
// 8 IF_ICMPGE
// 8 IF_ICMPGE
// JVM_IR_TEMPLATES
// 56 ILOAD
// 24 ISTORE
// 8 IADD
// 0 ISUB
// 0 IINC
@@ -27,3 +27,10 @@ fun f() {
// JVM_IR_TEMPLATES
// 1 IF_ICMPGE
// 1 IF
// JVM_IR_TEMPLATES
// 1 ILOAD
// 1 ISTORE
// 0 IADD
// 0 ISUB
// 1 IINC
@@ -19,4 +19,11 @@ fun f(a: Int, b: Int) {
// 0 getLast
// 0 getStep
// 2 IF_ICMP
// 2 IF
// 2 IF
// JVM_IR_TEMPLATES
// 5 ILOAD
// 1 ISTORE
// 0 IADD
// 0 ISUB
// 1 IINC
@@ -29,4 +29,11 @@ fun box(): String {
// 1 NEW java/lang/IllegalArgumentException
// 1 ATHROW
// 0 IF
// 0 ARETURN
// 0 ARETURN
// JVM_IR_TEMPLATES
// 0 ILOAD
// 0 ISTORE
// 0 IADD
// 0 ISUB
// 0 IINC
@@ -18,20 +18,6 @@ fun box(): String {
// For "step" progressions in JVM IR, when the step is constant and == 1, and "step" is called on a literal progression which we already
// know to have a step whose absolute value is 1, we can essentially ignore the "step" call.
//
// Expected lowered form of loop:
//
// // Standard form of loop over progression
// var inductionVar = 1
// val last = 4
// if (inductionVar <= last) {
// // Loop is not empty
// do {
// val i = inductionVar
// inductionVar += 1
// // Loop body
// } while (inductionVar <= last)
// }
// 0 iterator
// 0 getStart
@@ -43,4 +29,11 @@ fun box(): String {
// 0 NEW java/lang/IllegalArgumentException
// 0 ATHROW
// 1 IF_ICMPLE
// 1 IF
// 1 IF
// JVM_IR_TEMPLATES
// 2 ILOAD
// 2 ISTORE
// 0 IADD
// 0 ISUB
// 1 IINC
@@ -18,20 +18,7 @@ fun box(): String {
// For "step" progressions in JVM IR, when the step is constant and == 1, and "step" is called on a literal progression which we already
// know to have a step whose absolute value is 1, we can essentially ignore the "step" call.
//
// Expected lowered form of loop:
//
// // Standard form of loop over progression
// var inductionVar = 1
// val last = 4
// if (inductionVar <= last) {
// // Loop is not empty
// do {
// val i = inductionVar
// inductionVar += 1
// // Loop body
// } while (inductionVar <= last)
// }
// 0 iterator
// 0 getStart
@@ -43,4 +30,11 @@ fun box(): String {
// 0 NEW java/lang/IllegalArgumentException
// 0 ATHROW
// 1 IF_ICMPLE
// 1 IF
// 1 IF
// JVM_IR_TEMPLATES
// 2 ILOAD
// 2 ISTORE
// 0 IADD
// 0 ISUB
// 1 IINC
@@ -19,20 +19,6 @@ fun box(): String {
// For "step" progressions in JVM IR, a call to getProgressionLastElement() is made to compute the "last" value.
// If the step is non-constant, there is a check that it is > 0, and if not, an IllegalArgumentException is thrown. However, when the
// step is constant and > 0, this check does not need to be added.
//
// Expected lowered form of loop:
//
// // Standard form of loop over progression
// val last = 1
// var inductionVar = getProgressionLastElement(1, 8, 2)
// if (last <= inductionVar) {
// // Loop is not empty
// do {
// val i = inductionVar
// inductionVar += -2
// // Loop body
// } while (last <= inductionVar)
// }
// 0 reversed
// 0 iterator
@@ -46,4 +32,11 @@ fun box(): String {
// 0 ATHROW
// 1 IF_ICMPGT
// 1 IF_ICMPLE
// 2 IF
// 2 IF
// JVM_IR_TEMPLATES
// 3 ILOAD
// 2 ISTORE
// 0 IADD
// 0 ISUB
// 1 IINC
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
// IMPORTANT!
@@ -29,3 +30,11 @@ fun f(a: UInt): Int {
// 2 IF
// 0 INVOKESTATIC kotlin/UInt.constructor-impl
// 0 INVOKE\w+ kotlin/UInt.(un)?box-impl
// JVM_IR_TEMPLATES
// 8 ILOAD
// 6 ISTORE
// 0 IADD
// 0 ISUB
// 2 IINC
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
// IMPORTANT!
@@ -29,3 +30,11 @@ fun f(a: ULong): Int {
// 2 IF
// 0 INVOKESTATIC kotlin/ULong.constructor-impl
// 0 INVOKE\w+ kotlin/ULong.(un)?box-impl
// JVM_IR_TEMPLATES
// 1 ILOAD
// 1 ISTORE
// 0 IADD
// 0 ISUB
// 1 IINC
@@ -67,3 +67,11 @@ fun testULongDownTo(a: ULong, b: ULong): Int {
// 0 getStep
// 0 INVOKESTATIC kotlin/U(Int|Long).constructor-impl
// 0 INVOKE\w+ kotlin/U(Int|Long).(un)?box-impl
// JVM_IR_TEMPLATES
// 40 ILOAD
// 27 ISTORE
// 6 IADD
// 0 ISUB
// 3 IINC
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
// IMPORTANT!
@@ -29,3 +30,10 @@ fun f(a: UInt): Int {
// 2 IF
// 0 INVOKESTATIC kotlin/UInt.constructor-impl
// 0 INVOKE\w+ kotlin/UInt.(un)?box-impl
// JVM_IR_TEMPLATES
// 9 ILOAD
// 6 ISTORE
// 0 IADD
// 0 ISUB
// 2 IINC
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
// IMPORTANT!
@@ -29,3 +30,10 @@ fun f(a: ULong): Int {
// 2 IF
// 0 INVOKESTATIC kotlin/ULong.constructor-impl
// 0 INVOKE\w+ kotlin/ULong.(un)?box-impl
// JVM_IR_TEMPLATES
// 1 ILOAD
// 1 ISTORE
// 0 IADD
// 0 ISUB
// 1 IINC
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
// IMPORTANT!
@@ -36,4 +37,11 @@ fun f(a: UInt): Int {
// JVM_IR_TEMPLATES
// 1 INVOKESTATIC kotlin/UnsignedKt.uintCompare
// 1 IFGE
// 1 IF
// 1 IF
// JVM_IR_TEMPLATES
// 7 ILOAD
// 6 ISTORE
// 0 IADD
// 0 ISUB
// 2 IINC
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
// IMPORTANT!
@@ -36,3 +37,10 @@ fun f(a: UInt): Int {
// JVM_IR_TEMPLATES
// 1 IF
// JVM_IR_TEMPLATES
// 7 ILOAD
// 6 ISTORE
// 0 IADD
// 0 ISUB
// 2 IINC
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
// IMPORTANT!
@@ -39,4 +40,11 @@ fun f(a: ULong): Int {
// JVM_IR_TEMPLATES
// 1 INVOKESTATIC kotlin/UnsignedKt.ulongCompare
// 1 IFGE
// 1 IF
// 1 IF
// JVM_IR_TEMPLATES
// 1 ILOAD
// 1 ISTORE
// 0 IADD
// 0 ISUB
// 1 IINC

Some files were not shown because too many files have changed in this diff Show More