diff --git a/compiler/testData/codegen/box/when/whenSubjectVariable/ieee754Equality.kt b/compiler/testData/codegen/box/when/whenSubjectVariable/ieee754Equality.kt index 49e4b5678f2..860fbf9aa41 100644 --- a/compiler/testData/codegen/box/when/whenSubjectVariable/ieee754Equality.kt +++ b/compiler/testData/codegen/box/when/whenSubjectVariable/ieee754Equality.kt @@ -2,6 +2,7 @@ // IGNORE_BACKEND: JS val dz = -0.0 +val fz = -0.0f fun box(): String { when (val y = dz) { @@ -9,5 +10,24 @@ fun box(): String { else -> throw AssertionError() } + when (val y = dz) { + else -> { + if (y < 0.0) throw AssertionError() + if (y > 0.0) throw AssertionError() + } + } + + when (val y = fz) { + 0.0f -> {} + else -> throw AssertionError() + } + + when (val y = fz) { + else -> { + if (y < 0.0f) throw AssertionError() + if (y > 0.0f) throw AssertionError() + } + } + return "OK" } \ No newline at end of file diff --git a/compiler/testData/codegen/box/when/whenSubjectVariable/ieee754EqualityWithSmartCast.kt b/compiler/testData/codegen/box/when/whenSubjectVariable/ieee754EqualityWithSmartCast.kt index 56dca102979..2dbaa088afd 100644 --- a/compiler/testData/codegen/box/when/whenSubjectVariable/ieee754EqualityWithSmartCast.kt +++ b/compiler/testData/codegen/box/when/whenSubjectVariable/ieee754EqualityWithSmartCast.kt @@ -2,6 +2,7 @@ // IGNORE_BACKEND: JS val az: Any = -0.0 +val afz: Any = -0.0f fun box(): String { when (val y = az) { @@ -10,5 +11,11 @@ fun box(): String { else -> throw AssertionError() } + when (val y = afz) { + !is Float -> throw AssertionError() + 0.0 -> {} + else -> throw AssertionError() + } + return "OK" } \ No newline at end of file