Files
kotlin-fork/backend.native/tests/external/codegen/blackbox/controlStructures/continueInWhile.kt
T
Ilya Matveev 1b553ebfaf backend/tests: Add blackbox tests from Kotlin JVM
Added tests from testData/codegen/box directory. There are blackbox tests
in other directories and they are to be added.
2017-01-20 14:04:04 +03:00

17 lines
291 B
Kotlin

fun foo(i: Int): Int {
var count = i;
var result = 0;
while(count > 0) {
count = count - 1;
if (count <= 2) continue;
result = result + count;
}
return result;
}
fun box(): String {
if (foo(4) != 3) return "Fail 1"
if (foo(5) != 7) return "Fail 2"
return "OK"
}