KT-17110 Rewrite branches targeting other branches

- Rewrite branches targeting other branches to target directly the
final destination to avoid runtime performance penalties.

Fix of https://youtrack.jetbrains.com/issue/KT-17110
This commit is contained in:
Mikaël Peltier
2018-02-09 15:40:04 +01:00
committed by Dmitry Petrov
parent c9624ce0f9
commit 9fb0f59813
8 changed files with 133 additions and 8 deletions

View File

@@ -0,0 +1,21 @@
fun test(x: Int, y: Int): String {
var result: String
if (x == 6) {
if (y == 6) {
result = "a"
} else {
result = "b"
}
} else {
result = "c"
}
return result
}
fun box(): String {
if (test(9, 10) != "c")
return "Failures"
return "OK"
}
// 2 GOTO L7