Files
kotlin-fork/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.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

83 lines
1.6 KiB
Kotlin
Vendored

fun test1(c: Boolean?) {
L@ while (true) { // BLOCK
L2@ while ({ // BLOCK
val tmp_0: Boolean? = c
when {
EQEQ(arg0 = tmp_0, arg1 = null) -> break
else -> tmp_0
}
})
}
}
fun test2(c: Boolean?) {
L@ while (true) { // BLOCK
L2@ while ({ // BLOCK
val tmp_1: Boolean? = c
when {
EQEQ(arg0 = tmp_1, arg1 = null) -> continue
else -> tmp_1
}
})
}
}
fun test3(ss: List<String>?) {
L@ while (true) { // BLOCK
{ // BLOCK
val tmp_2: Iterator<String> = { // BLOCK
val tmp_3: List<String>? = ss
when {
EQEQ(arg0 = tmp_3, arg1 = null) -> continue
else -> tmp_3
}
}.iterator()
L2@ while (tmp_2.hasNext()) { // BLOCK
val s: String = tmp_2.next()
}
}
}
}
fun test4(ss: List<String>?) {
L@ while (true) { // BLOCK
{ // BLOCK
val tmp_4: Iterator<String> = { // BLOCK
val tmp_5: List<String>? = ss
when {
EQEQ(arg0 = tmp_5, arg1 = null) -> break
else -> tmp_5
}
}.iterator()
L2@ while (tmp_4.hasNext()) { // BLOCK
val s: String = tmp_4.next()
}
}
}
}
fun test5() {
var i: Int = 0
Outer@ while (true) { // BLOCK
{ // BLOCK
i = i.inc()
i
} /*~> Unit */
var j: Int = 0
{ // BLOCK
Inner@ do// COMPOSITE {
{ // BLOCK
j = j.inc()
j
} /*~> Unit */
// } while (when {
greaterOrEqual(arg0 = j, arg1 = 3) -> false
else -> break
})
}
when {
EQEQ(arg0 = i, arg1 = 3) -> break
}
}
}