Files
kotlin-fork/compiler/testData/codegen/box/intrinsics/kt12125.kt
T
2016-11-09 21:41:12 +03:00

20 lines
443 B
Kotlin
Vendored

// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
fun test(i: Int): Int {
return i
}
fun box(): String {
var b = Byte.MAX_VALUE
b++
var result = test(b.toInt())
if (result != Byte.MIN_VALUE.toInt()) return "fail 1: $result"
var s = Short.MIN_VALUE
s--
result = test(s.toInt())
if (result != Short.MAX_VALUE.toInt()) return "fail 2: $result"
return "OK"
}