[IR] add testdata for dumpKotlinLike

This commit is contained in:
Zalim Bashorov
2020-11-05 02:47:53 +03:00
committed by teamcityserver
parent d2022ab115
commit 8d5facb15f
365 changed files with 15516 additions and 0 deletions
@@ -0,0 +1,83 @@
fun test1(c: Boolean?) {
while (true) { //BLOCK
while ({ //BLOCK
val tmp0_elvis_lhs: Boolean? = c
when {
EQEQ(arg0 = tmp0_elvis_lhs, arg1 = null) -> break
true -> tmp0_elvis_lhs
}
})
}
}
fun test2(c: Boolean?) {
while (true) { //BLOCK
while ({ //BLOCK
val tmp0_elvis_lhs: Boolean? = c
when {
EQEQ(arg0 = tmp0_elvis_lhs, arg1 = null) -> continue
true -> tmp0_elvis_lhs
}
})
}
}
fun test3(ss: List<String>?) {
while (true) { //BLOCK
{ //BLOCK
val tmp1_iterator: Iterator<String> = { //BLOCK
val tmp0_elvis_lhs: List<String>? = ss
when {
EQEQ(arg0 = tmp0_elvis_lhs, arg1 = null) -> continue
true -> tmp0_elvis_lhs
}
}.iterator()
while (tmp1_iterator.hasNext()) { //BLOCK
val s: String = tmp1_iterator.next()
}
}
}
}
fun test4(ss: List<String>?) {
while (true) { //BLOCK
{ //BLOCK
val tmp1_iterator: Iterator<String> = { //BLOCK
val tmp0_elvis_lhs: List<String>? = ss
when {
EQEQ(arg0 = tmp0_elvis_lhs, arg1 = null) -> break
true -> tmp0_elvis_lhs
}
}.iterator()
while (tmp1_iterator.hasNext()) { //BLOCK
val s: String = tmp1_iterator.next()
}
}
}
}
fun test5() {
var i: Int = 0
while (true) { //BLOCK
{ //BLOCK
i = i.inc()
i
} /*~> Unit */
var j: Int = 0
{ //BLOCK
do// COMPOSITE {
{ //BLOCK
j = j.inc()
j
} /*~> Unit */
// } while (when {
greaterOrEqual(arg0 = j, arg1 = 3) -> false
true -> break
})
}
when {
EQEQ(arg0 = i, arg1 = 3) -> break
}
}
}