Files
kotlin/compiler/testData/codegen/bytecodeText/ieee754/nullableFloatNotEquals10.kt
Alexander Udalov 0871a3cc4d Use API_VERSION instead of LANGUAGE_VERSION in IEEE754 tests
See `ExpressionCodegen.genEqualsForExpressionsPreferIeee754Arithmetic`:
the behavior here actually depends on the API version, not any language
feature
2018-12-20 12:53:22 +01:00

30 lines
721 B
Kotlin
Vendored

// !API_VERSION: 1.0
fun myNotEquals(a: Float?, b: Float?) = a != b
fun myNotEquals1(a: Float?, b: Float) = a != b
fun myNotEquals2(a: Float, b: Float?) = a != b
fun myNotEquals0(a: Float, b: Float) = a != b
fun box(): String {
if (myNotEquals(null, null)) return "fail 1"
if (!myNotEquals(null, 0.0F)) return "fail 2"
if (!myNotEquals(0.0F, null)) return "fail 3"
if (myNotEquals(0.0F, 0.0F)) return "fail 4"
if (!myNotEquals1(null, 0.0F)) return "fail 5"
if (myNotEquals1(0.0F, 0.0F)) return "fail 6"
if (!myNotEquals2(0.0F, null)) return "fail 7"
if (myNotEquals2(0.0F, 0.0F)) return "fail 8"
if (myNotEquals0(0.0F, 0.0F)) return "fail 9"
return "OK"
}
// 0 areEqual