Empty loops.
This commit is contained in:
committed by
Dmitry Petrov
parent
179a06672b
commit
d45811a5da
Vendored
+4
@@ -1,3 +1,7 @@
|
||||
fun testEmpty(ss: List<String>) {
|
||||
for (s in ss);
|
||||
}
|
||||
|
||||
fun testIterable(ss: List<String>) {
|
||||
for (s in ss) {
|
||||
println(s)
|
||||
|
||||
Vendored
+13
@@ -1,4 +1,17 @@
|
||||
FILE /for.kt
|
||||
FUN public fun testEmpty(/*0*/ ss: kotlin.collections.List<kotlin.String>): kotlin.Unit
|
||||
BLOCK_BODY
|
||||
BLOCK type=kotlin.Unit operator=FOR_LOOP
|
||||
VAR val tmp0_iterator: kotlin.collections.Iterator<kotlin.String>
|
||||
CALL .iterator type=kotlin.collections.Iterator<kotlin.String> operator=FOR_LOOP_ITERATOR
|
||||
$this: GET_VAR ss type=kotlin.collections.List<kotlin.String> operator=null
|
||||
WHILE label=null operator=FOR_LOOP_INNER_WHILE
|
||||
condition: CALL .hasNext type=kotlin.Boolean operator=FOR_LOOP_HAS_NEXT
|
||||
$this: GET_VAR tmp0_iterator type=kotlin.collections.Iterator<kotlin.String> operator=null
|
||||
body: BLOCK type=kotlin.Unit operator=FOR_LOOP_INNER_WHILE
|
||||
VAR val s: kotlin.String
|
||||
CALL .next type=kotlin.String operator=FOR_LOOP_NEXT
|
||||
$this: GET_VAR tmp0_iterator type=kotlin.collections.Iterator<kotlin.String> operator=null
|
||||
FUN public fun testIterable(/*0*/ ss: kotlin.collections.List<kotlin.String>): kotlin.Unit
|
||||
BLOCK_BODY
|
||||
BLOCK type=kotlin.Unit operator=FOR_LOOP
|
||||
|
||||
+2
@@ -1,7 +1,9 @@
|
||||
fun test() {
|
||||
var x = 0
|
||||
while (x < 0);
|
||||
while (x < 5) x++
|
||||
while (x < 10) { x++ }
|
||||
do while (x < 0)
|
||||
do x++ while (x < 15)
|
||||
do { x ++ } while (x < 20)
|
||||
}
|
||||
|
||||
+10
@@ -3,6 +3,11 @@ FILE /whileDoWhile.kt
|
||||
BLOCK_BODY
|
||||
VAR var x: kotlin.Int
|
||||
CONST Int type=kotlin.Int value='0'
|
||||
WHILE label=null operator=WHILE_LOOP
|
||||
condition: CALL .LT0 type=kotlin.Boolean operator=LT
|
||||
arg0: CALL .compareTo type=kotlin.Int operator=LT
|
||||
$this: GET_VAR x type=kotlin.Int operator=null
|
||||
other: CONST Int type=kotlin.Int value='0'
|
||||
WHILE label=null operator=WHILE_LOOP
|
||||
condition: CALL .LT0 type=kotlin.Boolean operator=LT
|
||||
arg0: CALL .compareTo type=kotlin.Int operator=LT
|
||||
@@ -28,6 +33,11 @@ FILE /whileDoWhile.kt
|
||||
CALL .inc type=kotlin.Int operator=POSTFIX_INCR
|
||||
$this: GET_VAR tmp1 type=kotlin.Int operator=null
|
||||
GET_VAR tmp1 type=kotlin.Int operator=null
|
||||
DO_WHILE label=null operator=DO_WHILE_LOOP
|
||||
condition: CALL .LT0 type=kotlin.Boolean operator=LT
|
||||
arg0: CALL .compareTo type=kotlin.Int operator=LT
|
||||
$this: GET_VAR x type=kotlin.Int operator=null
|
||||
other: CONST Int type=kotlin.Int value='0'
|
||||
DO_WHILE label=null operator=DO_WHILE_LOOP
|
||||
body: BLOCK type=kotlin.Int operator=POSTFIX_INCR
|
||||
VAR val tmp2: kotlin.Int
|
||||
|
||||
Reference in New Issue
Block a user