Add tests with loop in store-load chains on noinline function parameters

This commit is contained in:
Dmitry Petrov
2017-04-25 15:43:39 +03:00
parent e1731373d8
commit 996a08a3f7
4 changed files with 68 additions and 0 deletions
@@ -0,0 +1,25 @@
// FILE: 1.kt
inline fun cycle(p: String): String {
var z = p
var x = z
for (i in 1..4) {
z = x
x = z
}
return z
}
inline fun test(crossinline foo: String.() -> String): String {
val cycle = cycle("123");
{
cycle.foo()
}()
return cycle.foo()
}
// FILE: 2.kt
fun box(): String = test { "OK" }