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
@@ -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