[JS IR BE] Refactor equals and compareTo lowering

This commit is contained in:
Svyatoslav Kuzmich
2018-09-10 15:05:39 +03:00
parent 005955326f
commit b79dcbe8e6
19 changed files with 233 additions and 235 deletions
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
fun box(): String {
-1
View File
@@ -1,5 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
data class Test(val z1: Double, val z2: Double?)
fun box(): String {
@@ -1,5 +1,6 @@
// !LANGUAGE: +ProperIeee754Comparisons
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
import kotlin.test.*
@@ -94,6 +95,7 @@ fun box(): String {
assertTrue(adnq == dn, "Double: (Any?)NaN != NaN")
assertTrue(adnq == adn, "Double: (Any?)NaN != (Any)NaN")
// JS IR fails due to: https://bugs.openjdk.java.net/browse/JDK-8141407
assertFalse(dnq == dnq, "Double: NaN? == NaN?")
assertTrue(dnq == adnq, "Double: NaN? != (Any?)NaN")
assertTrue(adnq == dnq, "Double: (Any?)NaN != NaN?")
@@ -114,6 +116,7 @@ fun box(): String {
assertFalse(adnq != dn, "Double: (Any?)NaN != NaN")
assertFalse(adnq != adn, "Double: (Any?)NaN != (Any)NaN")
// JS IR fails due to: https://bugs.openjdk.java.net/browse/JDK-8141407
assertTrue(dnq != dnq, "Double: NaN? == NaN?")
assertFalse(dnq != adnq, "Double: NaN? != (Any?)NaN")
assertFalse(adnq != dnq, "Double: (Any?)NaN != NaN?")
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
inline fun less(a: Comparable<Double>, b: Double): Boolean {
return a < b
}
@@ -1,5 +1,5 @@
// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND: JVM_IR, JS_IR
// IGNORE_BACKEND: JVM_IR
inline class InlineFloat(val data: Float)
@@ -1,6 +1,6 @@
// !LANGUAGE: +InlineClasses
// WITH_RUNTIME
// IGNORE_BACKEND: JVM_IR, JS_IR
// IGNORE_BACKEND: JVM_IR
inline class GCmp<T>(val xc: Comparable<T>)
inline class GSCmp<T>(val sc: Comparable<String>)
@@ -1,5 +1,4 @@
// !LANGUAGE: +ProperIeee754Comparisons
//IGNORE_BACKEND: JS_IR
fun ltDD(x: Comparable<Double>, y: Double) =
x is Double && x < y
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// TARGET_BACKEND: JS
// Contains JS-specific checks, e.g. null == undefined
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
val i1 = 1
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
//KT-1800 error/NonExistentClass generated on runtime
package i
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
fun box(): String {