IR KT-49372 cache progression loop parameters if their values can change

This commit is contained in:
Dmitry Petrov
2021-10-22 16:44:13 +03:00
committed by teamcityserver
parent 7fb82232cd
commit 45a4cea655
16 changed files with 113 additions and 24 deletions
@@ -0,0 +1,16 @@
// WITH_RUNTIME
fun test(): Int {
var sum = 0
for (i in sum downTo sum) {
sum += 1 + i
}
return sum
}
fun box(): String {
val t1 = test()
if (t1 != 1) return "Failed: t1=$t1"
return "OK"
}