diff --git a/compiler/testData/codegen/box/ieee754/equalsDouble.kt b/compiler/testData/codegen/box/ieee754/equalsDouble.kt index 28d5c90e7f6..c9f3cae5697 100644 --- a/compiler/testData/codegen/box/ieee754/equalsDouble.kt +++ b/compiler/testData/codegen/box/ieee754/equalsDouble.kt @@ -1,3 +1,6 @@ +// !LANGUAGE: -ProperIeee754Comparisons +// IGNORE_BACKEND: JS + fun equals1(a: Double, b: Double) = a == b fun equals2(a: Double?, b: Double?) = a!! == b!! @@ -15,7 +18,9 @@ fun box(): String { if (!equals2(-0.0, 0.0)) return "fail 2" if (!equals3(-0.0, 0.0)) return "fail 3" if (!equals4(-0.0, 0.0)) return "fail 4" - if (!equals5(-0.0, 0.0)) return "fail 5" + + // Smart casts behavior in 1.2 + if (equals5(-0.0, 0.0)) return "fail 5" return "OK" } diff --git a/compiler/testData/codegen/box/ieee754/equalsDouble_properIeeeComparisons.kt b/compiler/testData/codegen/box/ieee754/equalsDouble_properIeeeComparisons.kt new file mode 100644 index 00000000000..7c9b369ca24 --- /dev/null +++ b/compiler/testData/codegen/box/ieee754/equalsDouble_properIeeeComparisons.kt @@ -0,0 +1,24 @@ +// !LANGUAGE: +ProperIeee754Comparisons + +fun equals1(a: Double, b: Double) = a == b + +fun equals2(a: Double?, b: Double?) = a!! == b!! + +fun equals3(a: Double?, b: Double?) = a != null && b != null && a == b + +fun equals4(a: Double?, b: Double?) = if (a is Double && b is Double) a == b else null!! + +fun equals5(a: Any?, b: Any?) = if (a is Double && b is Double) a == b else null!! + + +fun box(): String { + if (-0.0 != 0.0) return "fail 0" + if (!equals1(-0.0, 0.0)) return "fail 1" + if (!equals2(-0.0, 0.0)) return "fail 2" + if (!equals3(-0.0, 0.0)) return "fail 3" + if (!equals4(-0.0, 0.0)) return "fail 4" + if (!equals5(-0.0, 0.0)) return "fail 5" + + return "OK" +} + diff --git a/compiler/testData/codegen/box/ieee754/equalsFloat.kt b/compiler/testData/codegen/box/ieee754/equalsFloat.kt index 26187f688d0..822c6e17950 100644 --- a/compiler/testData/codegen/box/ieee754/equalsFloat.kt +++ b/compiler/testData/codegen/box/ieee754/equalsFloat.kt @@ -1,3 +1,6 @@ +// !LANGUAGE: -ProperIeee754Comparisons +// IGNORE_BACKEND: JS + fun equals1(a: Float, b: Float) = a == b fun equals2(a: Float?, b: Float?) = a!! == b!! @@ -15,7 +18,9 @@ fun box(): String { if (!equals2(-0.0F, 0.0F)) return "fail 2" if (!equals3(-0.0F, 0.0F)) return "fail 3" if (!equals4(-0.0F, 0.0F)) return "fail 4" - if (!equals5(-0.0F, 0.0F)) return "fail 5" + + // Smart casts behavior in 1.2 + if (equals5(-0.0F, 0.0F)) return "fail 5" return "OK" } diff --git a/compiler/testData/codegen/box/ieee754/equalsFloat_properIeeeComparisons.kt b/compiler/testData/codegen/box/ieee754/equalsFloat_properIeeeComparisons.kt new file mode 100644 index 00000000000..7a7589838d3 --- /dev/null +++ b/compiler/testData/codegen/box/ieee754/equalsFloat_properIeeeComparisons.kt @@ -0,0 +1,24 @@ +// !LANGUAGE: +ProperIeee754Comparisons + +fun equals1(a: Float, b: Float) = a == b + +fun equals2(a: Float?, b: Float?) = a!! == b!! + +fun equals3(a: Float?, b: Float?) = a != null && b != null && a == b + +fun equals4(a: Float?, b: Float?) = if (a is Float && b is Float) a == b else null!! + +fun equals5(a: Any?, b: Any?) = if (a is Float && b is Float) a == b else null!! + + +fun box(): String { + if (-0.0F != 0.0F) return "fail 0" + if (!equals1(-0.0F, 0.0F)) return "fail 1" + if (!equals2(-0.0F, 0.0F)) return "fail 2" + if (!equals3(-0.0F, 0.0F)) return "fail 3" + if (!equals4(-0.0F, 0.0F)) return "fail 4" + if (!equals5(-0.0F, 0.0F)) return "fail 5" + + return "OK" +} + diff --git a/compiler/testData/codegen/box/ieee754/equalsNaN.kt b/compiler/testData/codegen/box/ieee754/equalsNaN.kt index 3a396bd432d..1e6ab618d1f 100644 --- a/compiler/testData/codegen/box/ieee754/equalsNaN.kt +++ b/compiler/testData/codegen/box/ieee754/equalsNaN.kt @@ -1,4 +1,6 @@ +// !LANGUAGE: -ProperIeee754Comparisons // WITH_RUNTIME +// IGNORE_BACKEND: JS import kotlin.test.* @@ -117,14 +119,14 @@ fun box(): String { assertFalse(adnq != dnq, "Double: (Any?)NaN != NaN?") assertFalse(adnq != adnq, "Double: (Any?)NaN != (Any?)NaN") - // Stable smart-casts + // Stable smart-casts -- effectively not takein into account in 1.2 if (adn is Double) { - assertFalse(adn == adn, "Double smart-cast: NaN == NaN") - assertTrue(adn != adn, "Double smart-cast: NaN == NaN") + assertTrue(adn == adn, "Double smart-cast: NaN == NaN") + assertFalse(adn != adn, "Double smart-cast: NaN == NaN") } if (adnq is Double?) { - assertFalse(adnq == adnq, "Double? smart-cast: NaN? == NaN?") - assertTrue(adnq != adnq, "Double? smart-cast: NaN? == NaN?") + assertTrue(adnq == adnq, "Double? smart-cast: NaN? == NaN?") + assertFalse(adnq != adnq, "Double? smart-cast: NaN? == NaN?") } // Unstable smart-casts if (gdn is Double) { @@ -192,14 +194,14 @@ fun box(): String { assertFalse(afnq != fnq, "Float: (Any?)NaN != NaN?") assertFalse(afnq != afnq, "Float: (Any?)NaN != (Any?)NaN") - // Stable smart-casts + // Stable smart-casts -- effectively not takein into account in 1.2 if (afn is Float) { - assertFalse(afn == afn, "Float smart-cast: NaN == NaN") - assertTrue(afn != afn, "Float smart-cast: NaN == NaN") + assertTrue(afn == afn, "Float smart-cast: NaN == NaN") + assertFalse(afn != afn, "Float smart-cast: NaN == NaN") } if (afnq is Float?) { - assertFalse(afnq == afnq, "Float? smart-cast: NaN? == NaN?") - assertTrue(afnq != afnq, "Float? smart-cast: NaN? == NaN?") + assertTrue(afnq == afnq, "Float? smart-cast: NaN? == NaN?") + assertFalse(afnq != afnq, "Float? smart-cast: NaN? == NaN?") } // Unstable smart-casts if (gfn is Float) { diff --git a/compiler/testData/codegen/box/ieee754/equalsNaN_properIeeeComparisons.kt b/compiler/testData/codegen/box/ieee754/equalsNaN_properIeeeComparisons.kt new file mode 100644 index 00000000000..e7095255c55 --- /dev/null +++ b/compiler/testData/codegen/box/ieee754/equalsNaN_properIeeeComparisons.kt @@ -0,0 +1,224 @@ +// !LANGUAGE: +ProperIeee754Comparisons +// WITH_RUNTIME + +import kotlin.test.* + +object O { + var equalsCalled: Boolean = false + get(): Boolean { + val result = field + field = false + return result + } + set(v: Boolean) { + field = v + } + + override fun equals(a: Any?): Boolean { + equalsCalled = true + return true + } +} + +val A: Any = O + +fun testDouble(d: Double, v: T, vararg va: T) { + assertFalse(d == d, "Double: d != d") + assertFalse(d == v, "Double: d != v") + assertFalse(d == va[0], "Double: d != va[0]") + assertFalse(v == d, "Double: v != d") + assertFalse(v == v, "Double: v != v") + assertFalse(v == va[0], "Double: v != va[0]") + assertFalse(va[0] == d, "Double: va[0] != d") + assertFalse(va[0] == v, "Double: va[0] != v") + assertFalse(va[0] == va[0], "Double: va[0] != va[0]") + + assertTrue(d != d, "Double: d == d") + assertTrue(d != v, "Double: d == v") + assertTrue(d != va[0], "Double: d == va[0]") + assertTrue(v != d, "Double: v == d") + assertTrue(v != v, "Double: v == v") + assertTrue(v != va[0], "Double: v == va[0]") + assertTrue(va[0] != d, "Double: va[0] == d") + assertTrue(va[0] != v, "Double: va[0] == v") + assertTrue(va[0] != va[0], "Double: va[0] == va[0]") +} + +fun testFloat(d: Float, v: T, vararg va: T) { + assertFalse(d == d, "Float: d != d") + assertFalse(d == v, "Float: d != v") + assertFalse(d == va[0], "Float: d != va[0]") + assertFalse(v == d, "Float: v != d") + assertFalse(v == v, "Float: v != v") + assertFalse(v == va[0], "Float: v != va[0]") + assertFalse(va[0] == d, "Float: va[0] != d") + assertFalse(va[0] == v, "Float: va[0] != v") + assertFalse(va[0] == va[0], "Float: va[0] != va[0]") + + assertTrue(d != d, "Float: d == d") + assertTrue(d != v, "Float: d == v") + assertTrue(d != va[0], "Float: d == va[0]") + assertTrue(v != d, "Float: v == d") + assertTrue(v != v, "Float: v == v") + assertTrue(v != va[0], "Float: v == va[0]") + assertTrue(va[0] != d, "Float: va[0] == d") + assertTrue(va[0] != v, "Float: va[0] == v") + assertTrue(va[0] != va[0], "Float: va[0] == va[0]") +} + +var gdn: Any = Double.NaN +var gfn: Any = Float.NaN + +fun box(): String { + + // Double + + val dn = Double.NaN + val adn: Any = dn + val dnq: Double? = dn + val adnq: Any? = dn + + assertFalse(dn == dn, "Double: NaN == NaN") + assertTrue(dn == adn, "Double: NaN != (Any)NaN") + assertTrue(adn == dn, "Double: (Any)NaN != NaN") + assertTrue(adn == adn, "Double: (Any)NaN != (Any)NaN") + + assertFalse(dn == dnq, "Double: NaN == NaN?") + assertTrue(dn == adnq, "Double: NaN != (Any?)NaN") + assertTrue(adn == dnq, "Double: (Any)NaN != NaN?") + assertTrue(adn == adnq, "Double: (Any)NaN != (Any?)NaN") + + assertFalse(dnq == dn, "Double: NaN? == NaN") + assertTrue(dnq == adn, "Double: NaN? != (Any)NaN") + assertTrue(adnq == dn, "Double: (Any?)NaN != NaN") + assertTrue(adnq == adn, "Double: (Any?)NaN != (Any)NaN") + + assertFalse(dnq == dnq, "Double: NaN? == NaN?") + assertTrue(dnq == adnq, "Double: NaN? != (Any?)NaN") + assertTrue(adnq == dnq, "Double: (Any?)NaN != NaN?") + assertTrue(adnq == adnq, "Double: (Any?)NaN != (Any?)NaN") + + assertTrue(dn != dn, "Double: NaN == NaN") + assertFalse(dn != adn, "Double: NaN != (Any)NaN") + assertFalse(adn != dn, "Double: (Any)NaN != NaN") + assertFalse(adn != adn, "Double: (Any)NaN != (Any)NaN") + + assertTrue(dn != dnq, "Double: NaN == NaN?") + assertFalse(dn != adnq, "Double: NaN != (Any?)NaN") + assertFalse(adn != dnq, "Double: (Any)NaN != NaN?") + assertFalse(adn != adnq, "Double: (Any)NaN != (Any?)NaN") + + assertTrue(dnq != dn, "Double: NaN? == NaN") + assertFalse(dnq != adn, "Double: NaN? != (Any)NaN") + assertFalse(adnq != dn, "Double: (Any?)NaN != NaN") + assertFalse(adnq != adn, "Double: (Any?)NaN != (Any)NaN") + + assertTrue(dnq != dnq, "Double: NaN? == NaN?") + assertFalse(dnq != adnq, "Double: NaN? != (Any?)NaN") + assertFalse(adnq != dnq, "Double: (Any?)NaN != NaN?") + assertFalse(adnq != adnq, "Double: (Any?)NaN != (Any?)NaN") + + // Stable smart-casts + if (adn is Double) { + assertFalse(adn == adn, "Double smart-cast: NaN == NaN") + assertTrue(adn != adn, "Double smart-cast: NaN == NaN") + } + if (adnq is Double?) { + assertFalse(adnq == adnq, "Double? smart-cast: NaN? == NaN?") + assertTrue(adnq != adnq, "Double? smart-cast: NaN? == NaN?") + } + // Unstable smart-casts + if (gdn is Double) { + assertTrue(gdn == gdn, "Unstable Double smart-cast: NaN != NaN") + assertFalse(gdn != gdn, "Unstable Double smart-cast: NaN != NaN") + } + if (gdn is Double?) { + assertTrue(gdn == gdn, "Unstable Double smart-cast: NaN != NaN") + assertFalse(gdn != gdn, "Unstable Double smart-cast: NaN != NaN") + } + + // Explicit .equals + assertTrue(A == dn && O.equalsCalled, "A.equals not called for A == dn") + assertTrue(dn != A && !O.equalsCalled, "A.equals called for dn == A") + assertFalse(A != dn || !O.equalsCalled, "A.equals not called for A != dn") + assertFalse(dn == A || O.equalsCalled, "A.equals called for dn != A") + + // Generics and varags + testDouble(Double.NaN, Double.NaN, Double.NaN) + + // Float + + val fn = Float.NaN + val afn: Any = fn + val fnq: Float? = fn + val afnq: Any? = fn + + assertFalse(fn == fn, "Float: NaN == NaN") + assertTrue(fn == afn, "Float: NaN != (Any)NaN") + assertTrue(afn == fn, "Float: (Any)NaN != NaN") + assertTrue(afn == afn, "Float: (Any)NaN != (Any)NaN") + + assertFalse(fn == fnq, "Float: NaN == NaN?") + assertTrue(fn == afnq, "Float: NaN != (Any?)NaN") + assertTrue(afn == fnq, "Float: (Any)NaN != NaN?") + assertTrue(afn == afnq, "Float: (Any)NaN != (Any?)NaN") + + assertFalse(fnq == fn, "Float: NaN? == NaN") + assertTrue(fnq == afn, "Float: NaN? != (Any)NaN") + assertTrue(afnq == fn, "Float: (Any?)NaN != NaN") + assertTrue(afnq == afn, "Float: (Any?)NaN != (Any)NaN") + + assertFalse(fnq == fnq, "Float: NaN? == NaN?") + assertTrue(fnq == afnq, "Float: NaN? != (Any?)NaN") + assertTrue(afnq == fnq, "Float: (Any?)NaN != NaN?") + assertTrue(afnq == afnq, "Float: (Any?)NaN != (Any?)NaN") + + assertTrue(fn != fn, "Float: NaN == NaN") + assertFalse(fn != afn, "Float: NaN != (Any)NaN") + assertFalse(afn != fn, "Float: (Any)NaN != NaN") + assertFalse(afn != afn, "Float: (Any)NaN != (Any)NaN") + + assertTrue(fn != fnq, "Float: NaN == NaN?") + assertFalse(fn != afnq, "Float: NaN != (Any?)NaN") + assertFalse(afn != fnq, "Float: (Any)NaN != NaN?") + assertFalse(afn != afnq, "Float: (Any)NaN != (Any?)NaN") + + assertTrue(fnq != fn, "Float: NaN? == NaN") + assertFalse(fnq != afn, "Float: NaN? != (Any)NaN") + assertFalse(afnq != fn, "Float: (Any?)NaN != NaN") + assertFalse(afnq != afn, "Float: (Any?)NaN != (Any)NaN") + + assertTrue(fnq != fnq, "Float: NaN? == NaN?") + assertFalse(fnq != afnq, "Float: NaN? != (Any?)NaN") + assertFalse(afnq != fnq, "Float: (Any?)NaN != NaN?") + assertFalse(afnq != afnq, "Float: (Any?)NaN != (Any?)NaN") + + // Stable smart-casts + if (afn is Float) { + assertFalse(afn == afn, "Float smart-cast: NaN == NaN") + assertTrue(afn != afn, "Float smart-cast: NaN == NaN") + } + if (afnq is Float?) { + assertFalse(afnq == afnq, "Float? smart-cast: NaN? == NaN?") + assertTrue(afnq != afnq, "Float? smart-cast: NaN? == NaN?") + } + // Unstable smart-casts + if (gfn is Float) { + assertTrue(gfn == gfn, "Unstable Float smart-cast: NaN != NaN") + assertFalse(gfn != gfn, "Unstable Float smart-cast: NaN != NaN") + } + if (gfn is Float?) { + assertTrue(gfn == gfn, "Unstable Float smart-cast: NaN != NaN") + assertFalse(gfn != gfn, "Unstable Float smart-cast: NaN != NaN") + } + + assertTrue(A == fn && O.equalsCalled, "A.equals not called for A == fn") + assertTrue(fn != A && !O.equalsCalled, "A.equals called for fn == A") + assertFalse(A != fn || !O.equalsCalled, "A.equals not called for A != fn") + assertFalse(fn == A || O.equalsCalled, "A.equals called for fn != A") + + // Generics and varags + testFloat(Float.NaN, Float.NaN, Float.NaN) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ieee754/equalsNullableDouble.kt b/compiler/testData/codegen/box/ieee754/equalsNullableDouble.kt index f6e04610024..6da3e3dc1b1 100644 --- a/compiler/testData/codegen/box/ieee754/equalsNullableDouble.kt +++ b/compiler/testData/codegen/box/ieee754/equalsNullableDouble.kt @@ -1,3 +1,6 @@ +// !LANGUAGE: -ProperIeee754Comparisons +// IGNORE_BACKEND: JS + fun equals1(a: Double, b: Double?) = a == b fun equals2(a: Double?, b: Double?) = a!! == b!! @@ -20,11 +23,16 @@ fun box(): String { if (!equals2(-0.0, 0.0)) return "fail 2" if (!equals3(-0.0, 0.0)) return "fail 3" if (!equals4(-0.0, 0.0)) return "fail 4" - if (!equals5(-0.0, 0.0)) return "fail 5" - if (!equals6(-0.0, 0.0)) return "fail 6" + + // Smart casts behavior in 1.2 + if (equals5(-0.0, 0.0)) return "fail 5" + if (equals6(-0.0, 0.0)) return "fail 6" + if (!equals7(-0.0, 0.0)) return "fail 7" - if (!equals8(-0.0, 0.0)) return "fail 8" + // Smart casts behavior in 1.2 + if (equals8(-0.0, 0.0)) return "fail 8" + if (!equals8(null, null)) return "fail 9" if (equals8(null, 0.0)) return "fail 10" if (equals8(0.0, null)) return "fail 11" diff --git a/compiler/testData/codegen/box/ieee754/equalsNullableDouble_properIeeeComparisons.kt b/compiler/testData/codegen/box/ieee754/equalsNullableDouble_properIeeeComparisons.kt new file mode 100644 index 00000000000..3573cfbc43a --- /dev/null +++ b/compiler/testData/codegen/box/ieee754/equalsNullableDouble_properIeeeComparisons.kt @@ -0,0 +1,39 @@ +// !LANGUAGE: +ProperIeee754Comparisons + +fun equals1(a: Double, b: Double?) = a == b + +fun equals2(a: Double?, b: Double?) = a!! == b!! + +fun equals3(a: Double?, b: Double?) = a != null && a == b + +fun equals4(a: Double?, b: Double?) = if (a is Double) a == b else null!! + +fun equals5(a: Any?, b: Any?) = if (a is Double && b is Double?) a == b else null!! + +fun equals6(a: Any?, b: Any?) = if (a is Double? && b is Double) a == b else null!! + +fun equals7(a: Double?, b: Double?) = a == b + +fun equals8(a: Any?, b: Any?) = if (a is Double? && b is Double?) a == b else null!! + + +fun box(): String { + if (!equals1(-0.0, 0.0)) return "fail 1" + if (!equals2(-0.0, 0.0)) return "fail 2" + if (!equals3(-0.0, 0.0)) return "fail 3" + if (!equals4(-0.0, 0.0)) return "fail 4" + + if (!equals5(-0.0, 0.0)) return "fail 5" + if (!equals6(-0.0, 0.0)) return "fail 6" + + if (!equals7(-0.0, 0.0)) return "fail 7" + + if (!equals8(-0.0, 0.0)) return "fail 8" + + if (!equals8(null, null)) return "fail 9" + if (equals8(null, 0.0)) return "fail 10" + if (equals8(0.0, null)) return "fail 11" + + return "OK" +} + diff --git a/compiler/testData/codegen/box/ieee754/equalsNullableFloat.kt b/compiler/testData/codegen/box/ieee754/equalsNullableFloat.kt index 3ab6193b186..d3db8eae0cb 100644 --- a/compiler/testData/codegen/box/ieee754/equalsNullableFloat.kt +++ b/compiler/testData/codegen/box/ieee754/equalsNullableFloat.kt @@ -1,3 +1,6 @@ +// !LANGUAGE: -ProperIeee754Comparisons +// IGNORE_BACKEND: JS + fun equals1(a: Float, b: Float?) = a == b fun equals2(a: Float?, b: Float?) = a!! == b!! @@ -20,11 +23,16 @@ fun box(): String { if (!equals2(-0.0F, 0.0F)) return "fail 2" if (!equals3(-0.0F, 0.0F)) return "fail 3" if (!equals4(-0.0F, 0.0F)) return "fail 4" - if (!equals5(-0.0F, 0.0F)) return "fail 5" - if (!equals6(-0.0F, 0.0F)) return "fail 6" + + // Smart casts behavior in 1.2 + if (equals5(-0.0F, 0.0F)) return "fail 5" + if (equals6(-0.0F, 0.0F)) return "fail 6" + if (!equals7(-0.0F, 0.0F)) return "fail 7" - if (!equals8(-0.0F, 0.0F)) return "fail 8" + // Smart casts behavior in 1.2 + if (equals8(-0.0F, 0.0F)) return "fail 8" + if (!equals8(null, null)) return "fail 9" if (equals8(null, 0.0F)) return "fail 10" if (equals8(0.0F, null)) return "fail 11" diff --git a/compiler/testData/codegen/box/ieee754/equalsNullableFloat_properIeeeComparisons.kt b/compiler/testData/codegen/box/ieee754/equalsNullableFloat_properIeeeComparisons.kt new file mode 100644 index 00000000000..692ba98ad18 --- /dev/null +++ b/compiler/testData/codegen/box/ieee754/equalsNullableFloat_properIeeeComparisons.kt @@ -0,0 +1,39 @@ +// !LANGUAGE: +ProperIeee754Comparisons + +fun equals1(a: Float, b: Float?) = a == b + +fun equals2(a: Float?, b: Float?) = a!! == b!! + +fun equals3(a: Float?, b: Float?) = a != null && a == b + +fun equals4(a: Float?, b: Float?) = if (a is Float) a == b else null!! + +fun equals5(a: Any?, b: Any?) = if (a is Float && b is Float?) a == b else null!! + +fun equals6(a: Any?, b: Any?) = if (a is Float? && b is Float) a == b else null!! + +fun equals7(a: Float?, b: Float?) = a == b + +fun equals8(a: Any?, b: Any?) = if (a is Float? && b is Float?) a == b else null!! + + +fun box(): String { + if (!equals1(-0.0F, 0.0F)) return "fail 1" + if (!equals2(-0.0F, 0.0F)) return "fail 2" + if (!equals3(-0.0F, 0.0F)) return "fail 3" + if (!equals4(-0.0F, 0.0F)) return "fail 4" + + if (!equals5(-0.0F, 0.0F)) return "fail 5" + if (!equals6(-0.0F, 0.0F)) return "fail 6" + + if (!equals7(-0.0F, 0.0F)) return "fail 7" + + if (!equals8(-0.0F, 0.0F)) return "fail 8" + + if (!equals8(null, null)) return "fail 9" + if (equals8(null, 0.0F)) return "fail 10" + if (equals8(0.0F, null)) return "fail 11" + + return "OK" +} + diff --git a/compiler/testData/codegen/box/ieee754/greaterDouble.kt b/compiler/testData/codegen/box/ieee754/greaterDouble.kt index 2359ca5d077..c2d2c17aa77 100644 --- a/compiler/testData/codegen/box/ieee754/greaterDouble.kt +++ b/compiler/testData/codegen/box/ieee754/greaterDouble.kt @@ -1,3 +1,6 @@ +// !LANGUAGE: -ProperIeee754Comparisons +// IGNORE_BACKEND: JS + fun greater1(a: Double, b: Double) = a > b fun greater2(a: Double?, b: Double?) = a!! > b!! @@ -14,7 +17,9 @@ fun box(): String { if (greater2(0.0, -0.0)) return "fail 2" if (greater3(0.0, -0.0)) return "fail 3" if (greater4(0.0, -0.0)) return "fail 4" - if (greater5(0.0, -0.0)) return "fail 5" + + // Smart casts behavior in 1.2 + if (!greater5(0.0, -0.0)) return "fail 5" return "OK" } \ No newline at end of file diff --git a/compiler/testData/codegen/box/ieee754/greaterDouble_properIeeeComparisons.kt b/compiler/testData/codegen/box/ieee754/greaterDouble_properIeeeComparisons.kt new file mode 100644 index 00000000000..27740d7c318 --- /dev/null +++ b/compiler/testData/codegen/box/ieee754/greaterDouble_properIeeeComparisons.kt @@ -0,0 +1,22 @@ +// !LANGUAGE: +ProperIeee754Comparisons + +fun greater1(a: Double, b: Double) = a > b + +fun greater2(a: Double?, b: Double?) = a!! > b!! + +fun greater3(a: Double?, b: Double?) = a != null && b != null && a > b + +fun greater4(a: Double?, b: Double?) = if (a is Double && b is Double) a > b else null!! + +fun greater5(a: Any?, b: Any?) = if (a is Double && b is Double) a > b else null!! + +fun box(): String { + if (0.0 > -0.0) return "fail 0" + if (greater1(0.0, -0.0)) return "fail 1" + if (greater2(0.0, -0.0)) return "fail 2" + if (greater3(0.0, -0.0)) return "fail 3" + if (greater4(0.0, -0.0)) return "fail 4" + if (greater5(0.0, -0.0)) return "fail 5" + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ieee754/greaterFloat.kt b/compiler/testData/codegen/box/ieee754/greaterFloat.kt index ebcf4ef7147..3e4c3dea819 100644 --- a/compiler/testData/codegen/box/ieee754/greaterFloat.kt +++ b/compiler/testData/codegen/box/ieee754/greaterFloat.kt @@ -1,3 +1,6 @@ +// !LANGUAGE: -ProperIeee754Comparisons +// IGNORE_BACKEND: JS + fun greater1(a: Float, b: Float) = a > b fun greater2(a: Float?, b: Float?) = a!! > b!! @@ -14,7 +17,9 @@ fun box(): String { if (greater2(0.0F, -0.0F)) return "fail 2" if (greater3(0.0F, -0.0F)) return "fail 3" if (greater4(0.0F, -0.0F)) return "fail 4" - if (greater5(0.0F, -0.0F)) return "fail 5" + + // Smart casts behavior in 1.2 + if (!greater5(0.0F, -0.0F)) return "fail 5" return "OK" } \ No newline at end of file diff --git a/compiler/testData/codegen/box/ieee754/greaterFloat_properIeeeComparisons.kt b/compiler/testData/codegen/box/ieee754/greaterFloat_properIeeeComparisons.kt new file mode 100644 index 00000000000..baa388c59bf --- /dev/null +++ b/compiler/testData/codegen/box/ieee754/greaterFloat_properIeeeComparisons.kt @@ -0,0 +1,23 @@ +// !LANGUAGE: +ProperIeee754Comparisons + +fun greater1(a: Float, b: Float) = a > b + +fun greater2(a: Float?, b: Float?) = a!! > b!! + +fun greater3(a: Float?, b: Float?) = a != null && b != null && a > b + +fun greater4(a: Float?, b: Float?) = if (a is Float && b is Float) a > b else null!! + +fun greater5(a: Any?, b: Any?) = if (a is Float && b is Float) a > b else null!! + +fun box(): String { + if (0.0F > -0.0F) return "fail 0" + if (greater1(0.0F, -0.0F)) return "fail 1" + if (greater2(0.0F, -0.0F)) return "fail 2" + if (greater3(0.0F, -0.0F)) return "fail 3" + if (greater4(0.0F, -0.0F)) return "fail 4" + + if (greater5(0.0F, -0.0F)) return "fail 5" + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ieee754/lessDouble.kt b/compiler/testData/codegen/box/ieee754/lessDouble.kt index b25363bdb65..6de4793e15e 100644 --- a/compiler/testData/codegen/box/ieee754/lessDouble.kt +++ b/compiler/testData/codegen/box/ieee754/lessDouble.kt @@ -1,3 +1,6 @@ +// !LANGUAGE: -ProperIeee754Comparisons +// IGNORE_BACKEND: JS + fun less1(a: Double, b: Double) = a < b fun less2(a: Double?, b: Double?) = a!! < b!! @@ -14,7 +17,9 @@ fun box(): String { if (less2(-0.0, 0.0)) return "fail 2" if (less3(-0.0, 0.0)) return "fail 3" if (less4(-0.0, 0.0)) return "fail 4" - if (less5(-0.0, 0.0)) return "fail 5" + + // Smart casts behavior in 1.2 + if (!less5(-0.0, 0.0)) return "fail 5" return "OK" } \ No newline at end of file diff --git a/compiler/testData/codegen/box/ieee754/lessDouble_properIeeeComparisons.kt b/compiler/testData/codegen/box/ieee754/lessDouble_properIeeeComparisons.kt new file mode 100644 index 00000000000..c12061d393b --- /dev/null +++ b/compiler/testData/codegen/box/ieee754/lessDouble_properIeeeComparisons.kt @@ -0,0 +1,23 @@ +// !LANGUAGE: +ProperIeee754Comparisons + +fun less1(a: Double, b: Double) = a < b + +fun less2(a: Double?, b: Double?) = a!! < b!! + +fun less3(a: Double?, b: Double?) = a != null && b != null && a < b + +fun less4(a: Double?, b: Double?) = if (a is Double && b is Double) a < b else null!! + +fun less5(a: Any?, b: Any?) = if (a is Double && b is Double) a < b else null!! + +fun box(): String { + if (-0.0 < 0.0) return "fail 0" + if (less1(-0.0, 0.0)) return "fail 1" + if (less2(-0.0, 0.0)) return "fail 2" + if (less3(-0.0, 0.0)) return "fail 3" + if (less4(-0.0, 0.0)) return "fail 4" + + if (less5(-0.0, 0.0)) return "fail 5" + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ieee754/lessFloat.kt b/compiler/testData/codegen/box/ieee754/lessFloat.kt index efea2decef4..6fd2d721a06 100644 --- a/compiler/testData/codegen/box/ieee754/lessFloat.kt +++ b/compiler/testData/codegen/box/ieee754/lessFloat.kt @@ -1,3 +1,6 @@ +// !LANGUAGE: -ProperIeee754Comparisons +// IGNORE_BACKEND: JS + fun less1(a: Float, b: Float) = a < b fun less2(a: Float?, b: Float?) = a!! < b!! @@ -14,7 +17,9 @@ fun box(): String { if (less2(-0.0F, 0.0F)) return "fail 2" if (less3(-0.0F, 0.0F)) return "fail 3" if (less4(-0.0F, 0.0F)) return "fail 4" - if (less5(-0.0F, 0.0F)) return "fail 5" + + // Smart casts behavior in 1.2 + if (!less5(-0.0F, 0.0F)) return "fail 5" return "OK" } \ No newline at end of file diff --git a/compiler/testData/codegen/box/ieee754/lessFloat_properIeeeComparisons.kt b/compiler/testData/codegen/box/ieee754/lessFloat_properIeeeComparisons.kt new file mode 100644 index 00000000000..03307553086 --- /dev/null +++ b/compiler/testData/codegen/box/ieee754/lessFloat_properIeeeComparisons.kt @@ -0,0 +1,23 @@ +// !LANGUAGE: +ProperIeee754Comparisons + +fun less1(a: Float, b: Float) = a < b + +fun less2(a: Float?, b: Float?) = a!! < b!! + +fun less3(a: Float?, b: Float?) = a != null && b != null && a < b + +fun less4(a: Float?, b: Float?) = if (a is Float && b is Float) a < b else true + +fun less5(a: Any?, b: Any?) = if (a is Float && b is Float) a < b else true + +fun box(): String { + if (-0.0F < 0.0F) return "fail 0" + if (less1(-0.0F, 0.0F)) return "fail 1" + if (less2(-0.0F, 0.0F)) return "fail 2" + if (less3(-0.0F, 0.0F)) return "fail 3" + if (less4(-0.0F, 0.0F)) return "fail 4" + + if (less5(-0.0F, 0.0F)) return "fail 5" + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ieee754/when.kt b/compiler/testData/codegen/box/ieee754/when.kt index de5b07e4889..0c0119f664b 100644 --- a/compiler/testData/codegen/box/ieee754/when.kt +++ b/compiler/testData/codegen/box/ieee754/when.kt @@ -1,25 +1,32 @@ +// !LANGUAGE: -ProperIeee754Comparisons +// IGNORE_BACKEND: JS + fun box(): String { val plusZero: Any = 0.0 val minusZero: Any = -0.0 val nullDouble: Double? = null if (plusZero is Double) { + // Smart casts behavior in 1.2 when (plusZero) { nullDouble -> { return "fail 1" } -0.0 -> { + return "fail 2" } - else -> return "fail 2" + else -> {} } if (minusZero is Double) { + // Smart casts behavior in 1.2 when (plusZero) { nullDouble -> { return "fail 3" } minusZero -> { + return "fail 4" } - else -> return "fail 4" + else -> {} } } } diff --git a/compiler/testData/codegen/box/ieee754/when10.kt b/compiler/testData/codegen/box/ieee754/when10.kt index cf42bdd6ac8..517efc7bebf 100644 --- a/compiler/testData/codegen/box/ieee754/when10.kt +++ b/compiler/testData/codegen/box/ieee754/when10.kt @@ -1,4 +1,6 @@ // LANGUAGE_VERSION: 1.0 +// IGNORE_BACKEND: JS + fun box(): String { val plusZero: Any = 0.0 val minusZero: Any = -0.0 @@ -9,8 +11,9 @@ fun box(): String { return "fail 1" } -0.0 -> { + return "fail 2" } - else -> return "fail 2" + else -> {} } if (minusZero is Double) { @@ -19,8 +22,9 @@ fun box(): String { return "fail 3" } minusZero -> { + return "fail 4" } - else -> return "fail 4" + else -> {} } } } diff --git a/compiler/testData/codegen/box/ieee754/when10_properIeeeComparisons.kt b/compiler/testData/codegen/box/ieee754/when10_properIeeeComparisons.kt new file mode 100644 index 00000000000..dd3ec4586ba --- /dev/null +++ b/compiler/testData/codegen/box/ieee754/when10_properIeeeComparisons.kt @@ -0,0 +1,34 @@ +// !LANGUAGE: +ProperIeee754Comparisons + +fun box(): String { + val plusZero: Any = 0.0 + val minusZero: Any = -0.0 + val nullDouble: Double? = null + if (plusZero is Double) { + when (plusZero) { + nullDouble -> { + return "fail 1" + } + -0.0 -> { + } + else -> { + return "fail 2" + } + } + + if (minusZero is Double) { + when (plusZero) { + nullDouble -> { + return "fail 3" + } + minusZero -> { + } + else -> { + return "fail 4" + } + } + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ieee754/whenNoSubject.kt b/compiler/testData/codegen/box/ieee754/whenNoSubject.kt index 308c9a24cfe..0a8a99040d1 100644 --- a/compiler/testData/codegen/box/ieee754/whenNoSubject.kt +++ b/compiler/testData/codegen/box/ieee754/whenNoSubject.kt @@ -1,3 +1,6 @@ +// !LANGUAGE: -ProperIeee754Comparisons +// IGNORE_BACKEND: JS + fun box(): String { val plusZero: Any = 0.0 val minusZero: Any = -0.0 @@ -7,18 +10,18 @@ fun box(): String { return "fail 1" } - plusZero > minusZero -> { - return "fail 2" - } + plusZero > minusZero -> {} else -> { + return "fail 2" } } when { plusZero == minusZero -> { + return "fail 3" } - else -> return "fail 3" + else -> {} } } diff --git a/compiler/testData/codegen/box/ieee754/whenNoSubject_properIeeeComparisons.kt b/compiler/testData/codegen/box/ieee754/whenNoSubject_properIeeeComparisons.kt new file mode 100644 index 00000000000..2dc15da6894 --- /dev/null +++ b/compiler/testData/codegen/box/ieee754/whenNoSubject_properIeeeComparisons.kt @@ -0,0 +1,28 @@ +// !LANGUAGE: +ProperIeee754Comparisons + +fun box(): String { + val plusZero: Any = 0.0 + val minusZero: Any = -0.0 + if (plusZero is Double && minusZero is Double) { + when { + plusZero < minusZero -> { + return "fail 1" + } + + plusZero > minusZero -> { + return "fail 2" + } + else -> {} + } + + + when { + plusZero == minusZero -> {} + else -> { + return "fail 3" + } + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ieee754/when_properIeeeComparisons.kt b/compiler/testData/codegen/box/ieee754/when_properIeeeComparisons.kt new file mode 100644 index 00000000000..dd3ec4586ba --- /dev/null +++ b/compiler/testData/codegen/box/ieee754/when_properIeeeComparisons.kt @@ -0,0 +1,34 @@ +// !LANGUAGE: +ProperIeee754Comparisons + +fun box(): String { + val plusZero: Any = 0.0 + val minusZero: Any = -0.0 + val nullDouble: Double? = null + if (plusZero is Double) { + when (plusZero) { + nullDouble -> { + return "fail 1" + } + -0.0 -> { + } + else -> { + return "fail 2" + } + } + + if (minusZero is Double) { + when (plusZero) { + nullDouble -> { + return "fail 3" + } + minusZero -> { + } + else -> { + return "fail 4" + } + } + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/CodegenTestCase.java b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/CodegenTestCase.java index 4b49975a61e..e1d9880c4ee 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/CodegenTestCase.java +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/CodegenTestCase.java @@ -35,9 +35,11 @@ import org.jetbrains.kotlin.checkers.CheckerTestUtil; import org.jetbrains.kotlin.checkers.CompilerTestLanguageVersionSettings; import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys; import org.jetbrains.kotlin.cli.common.output.outputUtils.OutputUtilsKt; +import org.jetbrains.kotlin.cli.jvm.compiler.CliLightClassGenerationSupport; import org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles; import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment; import org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime; +import org.jetbrains.kotlin.codegen.state.GenerationState; import org.jetbrains.kotlin.config.*; import org.jetbrains.kotlin.fileClasses.JvmFileClassUtil; import org.jetbrains.kotlin.name.FqName; @@ -462,8 +464,11 @@ public abstract class CodegenTestCase extends KtUsefulTestCase { protected ClassFileFactory generateClassesInFile() { if (classFileFactory == null) { try { - classFileFactory = - GenerationUtils.compileFiles(myFiles.getPsiFiles(), myEnvironment, getClassBuilderFactory()).getFactory(); + GenerationState generationState = GenerationUtils.compileFiles( + myFiles.getPsiFiles(), myEnvironment, getClassBuilderFactory(), + new CliLightClassGenerationSupport.NoScopeRecordCliBindingTrace() + ); + classFileFactory = generationState.getFactory(); if (verifyWithDex() && DxChecker.RUN_DX_CHECKER) { DxChecker.check(classFileFactory); diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/GenerationUtils.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/GenerationUtils.kt index c6d9862f8c9..58e134bb047 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/GenerationUtils.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/GenerationUtils.kt @@ -19,6 +19,7 @@ package org.jetbrains.kotlin.codegen import com.intellij.psi.search.GlobalSearchScope import org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory import org.jetbrains.kotlin.cli.common.output.outputUtils.writeAllTo +import org.jetbrains.kotlin.cli.jvm.compiler.CliLightClassGenerationSupport import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment import org.jetbrains.kotlin.codegen.state.GenerationState import org.jetbrains.kotlin.config.CompilerConfiguration @@ -26,6 +27,7 @@ import org.jetbrains.kotlin.config.JVMConfigurationKeys import org.jetbrains.kotlin.descriptors.PackagePartProvider import org.jetbrains.kotlin.psi.KtFile import org.jetbrains.kotlin.resolve.AnalyzingUtils +import org.jetbrains.kotlin.resolve.BindingTrace import org.jetbrains.kotlin.resolve.lazy.JvmResolveUtil import java.io.File @@ -45,18 +47,21 @@ object GenerationUtils { fun compileFiles( files: List, environment: KotlinCoreEnvironment, - classBuilderFactory: ClassBuilderFactory = ClassBuilderFactories.TEST + classBuilderFactory: ClassBuilderFactory = ClassBuilderFactories.TEST, + trace: BindingTrace = CliLightClassGenerationSupport.CliBindingTrace() ): GenerationState = - compileFiles(files, environment.configuration, classBuilderFactory, environment::createPackagePartProvider) + compileFiles(files, environment.configuration, classBuilderFactory, environment::createPackagePartProvider, trace) @JvmStatic fun compileFiles( files: List, configuration: CompilerConfiguration, classBuilderFactory: ClassBuilderFactory, - packagePartProvider: (GlobalSearchScope) -> PackagePartProvider + packagePartProvider: (GlobalSearchScope) -> PackagePartProvider, + trace: BindingTrace = CliLightClassGenerationSupport.CliBindingTrace() ): GenerationState { - val analysisResult = JvmResolveUtil.analyzeAndCheckForErrors(files.first().project, files, configuration, packagePartProvider) + val analysisResult = + JvmResolveUtil.analyzeAndCheckForErrors(files.first().project, files, configuration, packagePartProvider, trace) analysisResult.throwIfError() val state = GenerationState.Builder( diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/resolve/lazy/JvmResolveUtil.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/resolve/lazy/JvmResolveUtil.kt index 1fadb910913..6750b0d6462 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/resolve/lazy/JvmResolveUtil.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/resolve/lazy/JvmResolveUtil.kt @@ -27,6 +27,7 @@ import org.jetbrains.kotlin.container.ComponentProvider import org.jetbrains.kotlin.descriptors.PackagePartProvider import org.jetbrains.kotlin.psi.KtFile import org.jetbrains.kotlin.resolve.AnalyzingUtils +import org.jetbrains.kotlin.resolve.BindingTrace import org.jetbrains.kotlin.resolve.lazy.declarations.FileBasedDeclarationProviderFactory object JvmResolveUtil { @@ -51,13 +52,14 @@ object JvmResolveUtil { project: Project, files: Collection, configuration: CompilerConfiguration, - packagePartProvider: (GlobalSearchScope) -> PackagePartProvider + packagePartProvider: (GlobalSearchScope) -> PackagePartProvider, + trace: BindingTrace = CliLightClassGenerationSupport.CliBindingTrace() ): AnalysisResult { for (file in files) { AnalyzingUtils.checkForSyntacticErrors(file) } - return analyze(project, files, configuration, packagePartProvider).apply { + return analyze(project, files, configuration, packagePartProvider, trace).apply { AnalyzingUtils.throwExceptionOnErrors(bindingContext) } } @@ -82,10 +84,11 @@ object JvmResolveUtil { project: Project, files: Collection, configuration: CompilerConfiguration, - packagePartProviderFactory: (GlobalSearchScope) -> PackagePartProvider + packagePartProviderFactory: (GlobalSearchScope) -> PackagePartProvider, + trace: BindingTrace = CliLightClassGenerationSupport.CliBindingTrace() ): AnalysisResult { return TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration( - project, files, CliLightClassGenerationSupport.CliBindingTrace(), configuration, packagePartProviderFactory + project, files, trace, configuration, packagePartProviderFactory ) } } diff --git a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index 1ae8505c59e..a23887c7ddf 100644 --- a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -10035,30 +10035,60 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes doTest(fileName); } + @TestMetadata("equalsDouble_properIeeeComparisons.kt") + public void testEqualsDouble_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsDouble_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("equalsFloat.kt") public void testEqualsFloat() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsFloat.kt"); doTest(fileName); } + @TestMetadata("equalsFloat_properIeeeComparisons.kt") + public void testEqualsFloat_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsFloat_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("equalsNaN.kt") public void testEqualsNaN() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsNaN.kt"); doTest(fileName); } + @TestMetadata("equalsNaN_properIeeeComparisons.kt") + public void testEqualsNaN_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsNaN_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("equalsNullableDouble.kt") public void testEqualsNullableDouble() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsNullableDouble.kt"); doTest(fileName); } + @TestMetadata("equalsNullableDouble_properIeeeComparisons.kt") + public void testEqualsNullableDouble_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsNullableDouble_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("equalsNullableFloat.kt") public void testEqualsNullableFloat() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsNullableFloat.kt"); doTest(fileName); } + @TestMetadata("equalsNullableFloat_properIeeeComparisons.kt") + public void testEqualsNullableFloat_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsNullableFloat_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("explicitCompareCall.kt") public void testExplicitCompareCall() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/explicitCompareCall.kt"); @@ -10083,12 +10113,24 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes doTest(fileName); } + @TestMetadata("greaterDouble_properIeeeComparisons.kt") + public void testGreaterDouble_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/greaterDouble_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("greaterFloat.kt") public void testGreaterFloat() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/greaterFloat.kt"); doTest(fileName); } + @TestMetadata("greaterFloat_properIeeeComparisons.kt") + public void testGreaterFloat_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/greaterFloat_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("inline.kt") public void testInline() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/inline.kt"); @@ -10101,12 +10143,24 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes doTest(fileName); } + @TestMetadata("lessDouble_properIeeeComparisons.kt") + public void testLessDouble_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/lessDouble_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("lessFloat.kt") public void testLessFloat() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/lessFloat.kt"); doTest(fileName); } + @TestMetadata("lessFloat_properIeeeComparisons.kt") + public void testLessFloat_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/lessFloat_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("nullableAnyToReal.kt") public void testNullableAnyToReal() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/nullableAnyToReal.kt"); @@ -10227,12 +10281,24 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes doTest(fileName); } + @TestMetadata("when10_properIeeeComparisons.kt") + public void testWhen10_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/when10_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("whenNoSubject.kt") public void testWhenNoSubject() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/whenNoSubject.kt"); doTest(fileName); } + @TestMetadata("whenNoSubject_properIeeeComparisons.kt") + public void testWhenNoSubject_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/whenNoSubject_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("whenNullableSmartCast.kt") public void testWhenNullableSmartCast() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/whenNullableSmartCast.kt"); @@ -10244,6 +10310,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/whenNullableSmartCast10.kt"); doTest(fileName); } + + @TestMetadata("when_properIeeeComparisons.kt") + public void testWhen_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/when_properIeeeComparisons.kt"); + doTest(fileName); + } } @TestMetadata("compiler/testData/codegen/box/increment") diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index 2c17a06c03f..962d54d0a15 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -10035,30 +10035,60 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { doTest(fileName); } + @TestMetadata("equalsDouble_properIeeeComparisons.kt") + public void testEqualsDouble_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsDouble_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("equalsFloat.kt") public void testEqualsFloat() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsFloat.kt"); doTest(fileName); } + @TestMetadata("equalsFloat_properIeeeComparisons.kt") + public void testEqualsFloat_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsFloat_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("equalsNaN.kt") public void testEqualsNaN() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsNaN.kt"); doTest(fileName); } + @TestMetadata("equalsNaN_properIeeeComparisons.kt") + public void testEqualsNaN_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsNaN_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("equalsNullableDouble.kt") public void testEqualsNullableDouble() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsNullableDouble.kt"); doTest(fileName); } + @TestMetadata("equalsNullableDouble_properIeeeComparisons.kt") + public void testEqualsNullableDouble_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsNullableDouble_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("equalsNullableFloat.kt") public void testEqualsNullableFloat() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsNullableFloat.kt"); doTest(fileName); } + @TestMetadata("equalsNullableFloat_properIeeeComparisons.kt") + public void testEqualsNullableFloat_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsNullableFloat_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("explicitCompareCall.kt") public void testExplicitCompareCall() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/explicitCompareCall.kt"); @@ -10083,12 +10113,24 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { doTest(fileName); } + @TestMetadata("greaterDouble_properIeeeComparisons.kt") + public void testGreaterDouble_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/greaterDouble_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("greaterFloat.kt") public void testGreaterFloat() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/greaterFloat.kt"); doTest(fileName); } + @TestMetadata("greaterFloat_properIeeeComparisons.kt") + public void testGreaterFloat_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/greaterFloat_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("inline.kt") public void testInline() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/inline.kt"); @@ -10101,12 +10143,24 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { doTest(fileName); } + @TestMetadata("lessDouble_properIeeeComparisons.kt") + public void testLessDouble_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/lessDouble_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("lessFloat.kt") public void testLessFloat() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/lessFloat.kt"); doTest(fileName); } + @TestMetadata("lessFloat_properIeeeComparisons.kt") + public void testLessFloat_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/lessFloat_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("nullableAnyToReal.kt") public void testNullableAnyToReal() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/nullableAnyToReal.kt"); @@ -10227,12 +10281,24 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { doTest(fileName); } + @TestMetadata("when10_properIeeeComparisons.kt") + public void testWhen10_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/when10_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("whenNoSubject.kt") public void testWhenNoSubject() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/whenNoSubject.kt"); doTest(fileName); } + @TestMetadata("whenNoSubject_properIeeeComparisons.kt") + public void testWhenNoSubject_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/whenNoSubject_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("whenNullableSmartCast.kt") public void testWhenNullableSmartCast() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/whenNullableSmartCast.kt"); @@ -10244,6 +10310,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/whenNullableSmartCast10.kt"); doTest(fileName); } + + @TestMetadata("when_properIeeeComparisons.kt") + public void testWhen_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/when_properIeeeComparisons.kt"); + doTest(fileName); + } } @TestMetadata("compiler/testData/codegen/box/increment") diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 41988133f24..9372e80471c 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -10035,30 +10035,60 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes doTest(fileName); } + @TestMetadata("equalsDouble_properIeeeComparisons.kt") + public void testEqualsDouble_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsDouble_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("equalsFloat.kt") public void testEqualsFloat() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsFloat.kt"); doTest(fileName); } + @TestMetadata("equalsFloat_properIeeeComparisons.kt") + public void testEqualsFloat_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsFloat_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("equalsNaN.kt") public void testEqualsNaN() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsNaN.kt"); doTest(fileName); } + @TestMetadata("equalsNaN_properIeeeComparisons.kt") + public void testEqualsNaN_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsNaN_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("equalsNullableDouble.kt") public void testEqualsNullableDouble() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsNullableDouble.kt"); doTest(fileName); } + @TestMetadata("equalsNullableDouble_properIeeeComparisons.kt") + public void testEqualsNullableDouble_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsNullableDouble_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("equalsNullableFloat.kt") public void testEqualsNullableFloat() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsNullableFloat.kt"); doTest(fileName); } + @TestMetadata("equalsNullableFloat_properIeeeComparisons.kt") + public void testEqualsNullableFloat_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsNullableFloat_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("explicitCompareCall.kt") public void testExplicitCompareCall() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/explicitCompareCall.kt"); @@ -10083,12 +10113,24 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes doTest(fileName); } + @TestMetadata("greaterDouble_properIeeeComparisons.kt") + public void testGreaterDouble_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/greaterDouble_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("greaterFloat.kt") public void testGreaterFloat() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/greaterFloat.kt"); doTest(fileName); } + @TestMetadata("greaterFloat_properIeeeComparisons.kt") + public void testGreaterFloat_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/greaterFloat_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("inline.kt") public void testInline() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/inline.kt"); @@ -10101,12 +10143,24 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes doTest(fileName); } + @TestMetadata("lessDouble_properIeeeComparisons.kt") + public void testLessDouble_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/lessDouble_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("lessFloat.kt") public void testLessFloat() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/lessFloat.kt"); doTest(fileName); } + @TestMetadata("lessFloat_properIeeeComparisons.kt") + public void testLessFloat_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/lessFloat_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("nullableAnyToReal.kt") public void testNullableAnyToReal() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/nullableAnyToReal.kt"); @@ -10227,12 +10281,24 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes doTest(fileName); } + @TestMetadata("when10_properIeeeComparisons.kt") + public void testWhen10_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/when10_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("whenNoSubject.kt") public void testWhenNoSubject() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/whenNoSubject.kt"); doTest(fileName); } + @TestMetadata("whenNoSubject_properIeeeComparisons.kt") + public void testWhenNoSubject_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/whenNoSubject_properIeeeComparisons.kt"); + doTest(fileName); + } + @TestMetadata("whenNullableSmartCast.kt") public void testWhenNullableSmartCast() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/whenNullableSmartCast.kt"); @@ -10244,6 +10310,12 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/whenNullableSmartCast10.kt"); doTest(fileName); } + + @TestMetadata("when_properIeeeComparisons.kt") + public void testWhen_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/when_properIeeeComparisons.kt"); + doTest(fileName); + } } @TestMetadata("compiler/testData/codegen/box/increment") diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index 595318fde87..5ba5d64d5f7 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -10980,30 +10980,90 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { @TestMetadata("equalsDouble.kt") public void testEqualsDouble() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsDouble.kt"); + try { + doTest(fileName); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("equalsDouble_properIeeeComparisons.kt") + public void testEqualsDouble_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsDouble_properIeeeComparisons.kt"); doTest(fileName); } @TestMetadata("equalsFloat.kt") public void testEqualsFloat() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsFloat.kt"); + try { + doTest(fileName); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("equalsFloat_properIeeeComparisons.kt") + public void testEqualsFloat_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsFloat_properIeeeComparisons.kt"); doTest(fileName); } @TestMetadata("equalsNaN.kt") public void testEqualsNaN() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsNaN.kt"); + try { + doTest(fileName); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("equalsNaN_properIeeeComparisons.kt") + public void testEqualsNaN_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsNaN_properIeeeComparisons.kt"); doTest(fileName); } @TestMetadata("equalsNullableDouble.kt") public void testEqualsNullableDouble() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsNullableDouble.kt"); + try { + doTest(fileName); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("equalsNullableDouble_properIeeeComparisons.kt") + public void testEqualsNullableDouble_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsNullableDouble_properIeeeComparisons.kt"); doTest(fileName); } @TestMetadata("equalsNullableFloat.kt") public void testEqualsNullableFloat() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsNullableFloat.kt"); + try { + doTest(fileName); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("equalsNullableFloat_properIeeeComparisons.kt") + public void testEqualsNullableFloat_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/equalsNullableFloat_properIeeeComparisons.kt"); doTest(fileName); } @@ -11040,12 +11100,36 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { @TestMetadata("greaterDouble.kt") public void testGreaterDouble() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/greaterDouble.kt"); + try { + doTest(fileName); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("greaterDouble_properIeeeComparisons.kt") + public void testGreaterDouble_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/greaterDouble_properIeeeComparisons.kt"); doTest(fileName); } @TestMetadata("greaterFloat.kt") public void testGreaterFloat() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/greaterFloat.kt"); + try { + doTest(fileName); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("greaterFloat_properIeeeComparisons.kt") + public void testGreaterFloat_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/greaterFloat_properIeeeComparisons.kt"); doTest(fileName); } @@ -11064,12 +11148,36 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { @TestMetadata("lessDouble.kt") public void testLessDouble() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/lessDouble.kt"); + try { + doTest(fileName); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("lessDouble_properIeeeComparisons.kt") + public void testLessDouble_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/lessDouble_properIeeeComparisons.kt"); doTest(fileName); } @TestMetadata("lessFloat.kt") public void testLessFloat() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/lessFloat.kt"); + try { + doTest(fileName); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("lessFloat_properIeeeComparisons.kt") + public void testLessFloat_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/lessFloat_properIeeeComparisons.kt"); doTest(fileName); } @@ -11208,18 +11316,48 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { @TestMetadata("when.kt") public void testWhen() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/when.kt"); - doTest(fileName); + try { + doTest(fileName); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); } @TestMetadata("when10.kt") public void testWhen10() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/when10.kt"); + try { + doTest(fileName); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("when10_properIeeeComparisons.kt") + public void testWhen10_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/when10_properIeeeComparisons.kt"); doTest(fileName); } @TestMetadata("whenNoSubject.kt") public void testWhenNoSubject() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/whenNoSubject.kt"); + try { + doTest(fileName); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("whenNoSubject_properIeeeComparisons.kt") + public void testWhenNoSubject_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/whenNoSubject_properIeeeComparisons.kt"); doTest(fileName); } @@ -11234,6 +11372,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/whenNullableSmartCast10.kt"); doTest(fileName); } + + @TestMetadata("when_properIeeeComparisons.kt") + public void testWhen_properIeeeComparisons() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/ieee754/when_properIeeeComparisons.kt"); + doTest(fileName); + } } @TestMetadata("compiler/testData/codegen/box/increment")