1b553ebfaf
Added tests from testData/codegen/box directory. There are blackbox tests in other directories and they are to be added.
17 lines
360 B
Kotlin
17 lines
360 B
Kotlin
fun idiv(a: Int, b: Int): Int =
|
|
if (b == 0) throw Exception("Division by zero") else a / b
|
|
|
|
fun foo(): Int {
|
|
var sum = 0
|
|
for (i in -10 .. 10) {
|
|
sum += try { idiv(100, i) } catch (e: Exception) { continue }
|
|
}
|
|
return sum
|
|
}
|
|
|
|
fun box(): String {
|
|
val test = foo()
|
|
if (test != 0) return "Failed, test=$test"
|
|
|
|
return "OK"
|
|
} |