Files
kotlin-fork/backend.native/tests/external/codegen/blackbox/ieee754/nullableAnyToReal.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

15 lines
447 B
Kotlin

fun box(): String {
val plusZero: Any? = 0.0
val minusZero: Any? = -0.0
if ((minusZero as Double) < (plusZero as Double)) return "fail 0"
val plusZeroF: Any? = 0.0F
val minusZeroF: Any? = -0.0F
if ((minusZeroF as Float) < (plusZeroF as Float)) return "fail 1"
if ((minusZero as Double) != (plusZero as Double)) return "fail 3"
if ((minusZeroF as Float) != (plusZeroF as Float)) return "fail 4"
return "OK"
}