Files
kotlin-fork/compiler/testData/ir/irText/expressions/whileDoWhile.kt.txt
T
Vladimir Sukharev bae8b283c7 [IR] Normalize temp var names in Kotlin-like dump
^KT-61983 Fixed
2023-10-11 07:49:35 +00:00

54 lines
1.0 KiB
Kotlin
Vendored

fun test() {
var x: Int = 0
while (less(arg0 = x, arg1 = 0))
while (less(arg0 = x, arg1 = 5)) { // BLOCK
val tmp_0: Int = x
x = tmp_0.inc()
tmp_0
} /*~> Unit */
while (less(arg0 = x, arg1 = 10)) { // BLOCK
{ // BLOCK
val tmp_1: Int = x
x = tmp_1.inc()
tmp_1
} /*~> Unit */
}
{ // BLOCK
do while (less(arg0 = x, arg1 = 0))
}
{ // BLOCK
do// COMPOSITE {
// } while (less(arg0 = x, arg1 = 7))
}
{ // BLOCK
do{ // BLOCK
val tmp_2: Int = x
x = tmp_2.inc()
tmp_2
} /*~> Unit */ while (less(arg0 = x, arg1 = 15))
}
{ // BLOCK
do// COMPOSITE {
{ // BLOCK
val tmp_3: Int = x
x = tmp_3.inc()
tmp_3
} /*~> Unit */
// } while (less(arg0 = x, arg1 = 20))
}
}
fun testSmartcastInCondition() {
val a: Any? = null
when {
a is Boolean -> { // BLOCK
while (a /*as Boolean */) { // BLOCK
}
{ // BLOCK
do// COMPOSITE {
// } while (a /*as Boolean */)
}
}
}
}