[JS IR BE] Update test data

This commit is contained in:
Roman Artemev
2018-06-06 16:21:21 +03:00
committed by Roman Artemev
parent 17d71f1e46
commit 6ac4fd2e5f
160 changed files with 1239 additions and 172 deletions
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun t1 () { fun t1 () {
val a1 = arrayOfNulls<String>(1) val a1 = arrayOfNulls<String>(1)
a1[0] = "0" //ok a1[0] = "0" //ok
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
open class Content() { open class Content() {
override fun toString() = "OK" override fun toString() = "OK"
} }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// KT-4145 // KT-4145
interface A { interface A {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
interface D1 { interface D1 {
fun foo(): Any fun foo(): Any
} }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
open class A<T> { open class A<T> {
var size: T = 56 as T var size: T = 56 as T
} }
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
package test package test
public interface FunDependencyEdge { public interface FunDependencyEdge {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
open class A<T> { open class A<T> {
open var x: T = "Fail" as T open var x: T = "Fail" as T
get get
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
abstract class A { abstract class A {
inner class InnerInA { inner class InnerInA {
fun returnOk() = "OK" fun returnOk() = "OK"
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// KT-12044 Assertion "Rewrite at slice LEXICAL_SCOPE" for 'if' with property references // KT-12044 Assertion "Rewrite at slice LEXICAL_SCOPE" for 'if' with property references
fun box(): String { fun box(): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
data class Foo(var bar: Int?) data class Foo(var bar: Int?)
fun box(): String { fun box(): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
data class Box(var value: String) data class Box(var value: String)
fun box(): String { fun box(): String {
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class A class A
class B class B
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun println(s: String) { fun println(s: String) {
} }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun foo() {} fun foo() {}
fun bar(): Int? = foo() as? Int fun bar(): Int? = foo() as? Int
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class A class A
class B class B
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class C() { class C() {
companion object { companion object {
fun create() = C() fun create() = C()
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
interface One { interface One {
public open fun foo() : Int public open fun foo() : Int
public open fun faz() : Int = 10 public open fun faz() : Int = 10
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
interface First { interface First {
public open fun foo() : Int public open fun foo() : Int
} }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
open class A(val value: String) { open class A(val value: String) {
inner class B(val s: String) { inner class B(val s: String) {
val result = value + "_" + s val result = value + "_" + s
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class T(val f : () -> Any?) { class T(val f : () -> Any?) {
fun call() : Any? = f() fun call() : Any? = f()
} }
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class Bar { class Bar {
} }
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun test1(str: String): String { fun test1(str: String): String {
data class A(val x: Int) { data class A(val x: Int) {
fun foo() = str fun foo() = str
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
interface A<T> { interface A<T> {
var zzzValue : T var zzzValue : T
fun zzz() : T fun zzz() : T
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun test( fun test(
b: Boolean, b: Boolean,
i: Int i: Int
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
data class A(var string: String) data class A(var string: String)
fun box(): String { fun box(): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// LANGUAGE_VERSION: 1.1 // LANGUAGE_VERSION: 1.1
fun box(): String { fun box(): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
data class A(val a: Foo<String>) {} data class A(val a: Foo<String>) {}
class Foo<T>(val a: T) { } class Foo<T>(val a: T) { }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
data class A(val v: Any?) data class A(val v: Any?)
data class B<T>(val v: T) data class B<T>(val v: T)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class Dummy { class Dummy {
override fun equals(other: Any?) = true override fun equals(other: Any?) = true
} }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
data class A(val x: Int) { data class A(val x: Int) {
override fun hashCode(): Int = -3 override fun hashCode(): Int = -3
} }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
data class A<T>(val t: T) data class A<T>(val t: T)
fun box(): String { fun box(): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
data class A(val a: Any?, var x: Int) data class A(val a: Any?, var x: Int)
data class B(val a: Any?) data class B(val a: Any?)
data class C(val a: Int, var x: Int?) data class C(val a: Int, var x: Int?)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
data class A(var x: Int, val z: Int) data class A(var x: Int, val z: Int)
fun box(): String { fun box(): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
data class A(val x: Int, val y: Any?, val z: String) data class A(val x: Int, val y: Any?, val z: String)
fun box(): String { fun box(): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// See KT-6206 Always generate hashCode() and equals() for data classes even if base classes have non-trivial analogs // See KT-6206 Always generate hashCode() and equals() for data classes even if base classes have non-trivial analogs
abstract class Base { abstract class Base {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
data class A(val x: Int) { data class A(val x: Int) {
override fun toString(): String = "!" override fun toString(): String = "!"
} }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
data class A(var string: String) data class A(var string: String)
fun box(): String { fun box(): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
data class A(var x: Int, val z: Int?) data class A(var x: Int, val z: Int?)
fun box(): String { fun box(): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
data class A(val x: Int, val y: String) data class A(val x: Int, val y: String)
fun box(): String { fun box(): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
data class A(var x: Int, var y: String) data class A(var x: Int, var y: String)
fun box(): String { fun box(): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
data class A<T, F>(val x: T, val y: F) data class A<T, F>(val x: T, val y: F)
fun <X, Y> foo(a: A<X, Y>, block: (A<X, Y>) -> String) = block(a) fun <X, Y> foo(a: A<X, Y>, block: (A<X, Y>) -> String) = block(a)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
data class A(val x: String, val y: String) data class A(val x: String, val y: String)
inline fun foo(a: A, block: (A) -> String): String = block(a) inline fun foo(a: A, block: (A) -> String): String = block(a)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
data class A(val x: String, val y: String) data class A(val x: String, val y: String)
fun foo(a: A, block: (Int, A, String) -> String): String = block(1, a, "#") fun foo(a: A, block: (Int, A, String) -> String): String = block(1, a, "#")
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
data class A(val x: String, val y: String) data class A(val x: String, val y: String)
fun foo(a: A, block: (A) -> String): String = block(a) fun foo(a: A, block: (A) -> String): String = block(a)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
interface Expr { interface Expr {
public fun ttFun() : Int = 12 public fun ttFun() : Int = 12
} }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
public class MPair<out A> ( public class MPair<out A> (
public val first: A public val first: A
) { ) {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box(): String { fun box(): String {
val f = fun (s: String): String = s val f = fun (s: String): String = s
val g = f as String.() -> String val g = f as String.() -> String
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box(): String { fun box(): String {
val plusZero: Any = 0.0 val plusZero: Any = 0.0
val minusZero: Any = -0.0 val minusZero: Any = -0.0
@@ -1,5 +1,4 @@
// !LANGUAGE: +ProperIeee754Comparisons // !LANGUAGE: +ProperIeee754Comparisons
// IGNORE_BACKEND: JS_IR
fun less(x: Comparable<Float>, y: Float) = x is Float && x < y fun less(x: Comparable<Float>, y: Float) = x is Float && x < y
fun less(x: Comparable<Double>, y: Double) = x is Double && x < y fun less(x: Comparable<Double>, y: Double) = x is Double && x < y
@@ -1,5 +1,4 @@
// !LANGUAGE: +ProperIeee754Comparisons // !LANGUAGE: +ProperIeee754Comparisons
// IGNORE_BACKEND: JS_IR
fun equals1(a: Double, b: Double) = a == b fun equals1(a: Double, b: Double) = a == b
@@ -1,5 +1,4 @@
// !LANGUAGE: +ProperIeee754Comparisons // !LANGUAGE: +ProperIeee754Comparisons
// IGNORE_BACKEND: JS_IR
fun equals1(a: Float, b: Float) = a == b fun equals1(a: Float, b: Float) = a == b
@@ -1,5 +1,4 @@
// !LANGUAGE: +ProperIeee754Comparisons // !LANGUAGE: +ProperIeee754Comparisons
// IGNORE_BACKEND: JS_IR
fun equals1(a: Double, b: Double?) = a == b fun equals1(a: Double, b: Double?) = a == b
@@ -1,5 +1,4 @@
// !LANGUAGE: +ProperIeee754Comparisons // !LANGUAGE: +ProperIeee754Comparisons
// IGNORE_BACKEND: JS_IR
fun equals1(a: Float, b: Float?) = a == b fun equals1(a: Float, b: Float?) = a == b
@@ -1,5 +1,4 @@
// !LANGUAGE: +ProperIeee754Comparisons // !LANGUAGE: +ProperIeee754Comparisons
// IGNORE_BACKEND: JS_IR
fun greater1(a: Double, b: Double) = a > b fun greater1(a: Double, b: Double) = a > b
@@ -1,5 +1,4 @@
// !LANGUAGE: +ProperIeee754Comparisons // !LANGUAGE: +ProperIeee754Comparisons
// IGNORE_BACKEND: JS_IR
fun greater1(a: Float, b: Float) = a > b fun greater1(a: Float, b: Float) = a > b
@@ -1,5 +1,4 @@
// !LANGUAGE: +ProperIeee754Comparisons // !LANGUAGE: +ProperIeee754Comparisons
// IGNORE_BACKEND: JS_IR
fun less1(a: Double, b: Double) = a < b fun less1(a: Double, b: Double) = a < b
@@ -1,5 +1,4 @@
// !LANGUAGE: +ProperIeee754Comparisons // !LANGUAGE: +ProperIeee754Comparisons
// IGNORE_BACKEND: JS_IR
fun less1(a: Float, b: Float) = a < b fun less1(a: Float, b: Float) = a < b
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box(): String { fun box(): String {
val plusZero: Any? = 0.0 val plusZero: Any? = 0.0
val minusZero: Any? = -0.0 val minusZero: Any? = -0.0
@@ -1,5 +1,4 @@
// !LANGUAGE: +ProperIeee754Comparisons // !LANGUAGE: +ProperIeee754Comparisons
// IGNORE_BACKEND: JS_IR
fun box(): String { fun box(): String {
val plusZero: Any = 0.0 val plusZero: Any = 0.0
@@ -1,5 +1,4 @@
// !LANGUAGE: +ProperIeee754Comparisons // !LANGUAGE: +ProperIeee754Comparisons
// IGNORE_BACKEND: JS_IR
fun box(): String { fun box(): String {
val plusZero: Any = 0.0 val plusZero: Any = 0.0
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box(): String { fun box(): String {
val nullValue: Any? = null val nullValue: Any? = null
val nullDouble: Double? = null val nullDouble: Double? = null
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// LANGUAGE_VERSION: 1.0 // LANGUAGE_VERSION: 1.0
fun box(): String { fun box(): String {
val nullValue: Any? = null val nullValue: Any? = null
@@ -1,5 +1,4 @@
// !LANGUAGE: +ProperIeee754Comparisons // !LANGUAGE: +ProperIeee754Comparisons
// IGNORE_BACKEND: JS_IR
fun box(): String { fun box(): String {
val plusZero: Any = 0.0 val plusZero: Any = 0.0
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
interface Base interface Base
class Derived: Base class Derived: Base
class Another: Base class Another: Base
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
open class Base open class Base
class Derived: Base() class Derived: Base()
operator fun Derived.inc(): Derived { return Derived() } operator fun Derived.inc(): Derived { return Derived() }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class MyClass class MyClass
operator fun MyClass?.inc(): MyClass? = null operator fun MyClass?.inc(): MyClass? = null
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
interface Base interface Base
class Derived: Base class Derived: Base
class Another: Base class Another: Base
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
open class Base open class Base
class Derived: Base() class Derived: Base()
operator fun Derived.inc(): Derived { return Derived() } operator fun Derived.inc(): Derived { return Derived() }
@@ -1,5 +1,4 @@
// !LANGUAGE: +InlineClasses // !LANGUAGE: +InlineClasses
// IGNORE_BACKEND: JS_IR
inline class UInt(val s: Int) inline class UInt(val s: Int)
@@ -1,5 +1,4 @@
// !LANGUAGE: +InlineClasses // !LANGUAGE: +InlineClasses
// IGNORE_BACKEND: JS_IR
inline class Result<T>(val a: Any?) { inline class Result<T>(val a: Any?) {
fun typed(): T = a as T fun typed(): T = a as T
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
data class A(val a: Int, val b: Int) data class A(val a: Int, val b: Int)
fun box() : String fun box() : String
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
package t package t
class Reproduce { class Reproduce {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
data class Z(val p: String, val k: String) data class Z(val p: String, val k: String)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
sealed class A { sealed class A {
class B : A() class B : A()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
@Target(AnnotationTarget.EXPRESSION) @Target(AnnotationTarget.EXPRESSION)
annotation class Annotation annotation class Annotation
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box() : String { fun box() : String {
return if(true.and(true)) "OK" else "fail" return if(true.and(true)) "OK" else "fail"
} }
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box() : String { fun box() : String {
val b = true as? Boolean //exception val b = true as? Boolean //exception
val i = 1 as Int //exception val i = 1 as Int //exception
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
package demo package demo
fun box() : String { fun box() : String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun foo(x: Int) = x fun foo(x: Int) = x
fun bar(x: Comparable<Int>) = if (x is Int) foo(x) else 0 fun bar(x: Comparable<Int>) = if (x is Int) foo(x) else 0
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
open class A open class A
class B : A() { class B : A() {
fun foo() = 1 fun foo() = 1
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
annotation class Anno annotation class Anno
@Anno val Int.foo: Int @Anno val Int.foo: Int
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME // WITH_RUNTIME
import kotlin.reflect.* import kotlin.reflect.*
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
//KT-10934 compiler throws UninferredParameterTypeConstructor in when block that covers all types //KT-10934 compiler throws UninferredParameterTypeConstructor in when block that covers all types
class Parser<TInput, TValue>(val f: (TInput) -> Result<TInput, TValue>) { class Parser<TInput, TValue>(val f: (TInput) -> Result<TInput, TValue>) {
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
open class Variable { open class Variable {
val lightVar: LightVariable = if (this is LightVariable) this else LightVariable() val lightVar: LightVariable = if (this is LightVariable) this else LightVariable()
} }
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
abstract class C { abstract class C {
fun test(x: Int) { fun test(x: Int) {
if (x == 0) return if (x == 0) return
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
sealed class Season { sealed class Season {
object Warm: Season() object Warm: Season()
object Cold: Season() object Cold: Season()
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
sealed class Season { sealed class Season {
class Warm: Season() class Warm: Season()
class Cold: Season() class Cold: Season()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
internal data class A1(val prop1: String) { internal data class A1(val prop1: String) {
val prop2: String = "const2" val prop2: String = "const2"
var prop3: String = "" var prop3: String = ""
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
open class SuperFoo { open class SuperFoo {
public fun bar(): String { public fun bar(): String {
if (this is Foo) { if (this is Foo) {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// See also KT-7801 // See also KT-7801
class A class A
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
open class A { open class A {
open val a = "OK" open val a = "OK"
} }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
open class A { open class A {
class B : A() { class B : A() {
val a = "FAIL" val a = "FAIL"
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
open class A { open class A {
fun f(): String = fun f(): String =
when (this) { when (this) {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
open class A { open class A {
open fun foo() = "FAIL" open fun foo() = "FAIL"
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun String?.foo() = this ?: "OK" fun String?.foo() = this ?: "OK"
fun foo(i: Int?): String { fun foo(i: Int?): String {
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
interface A<T> { interface A<T> {
val property : T val property : T
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
interface AL { interface AL {
fun get(index: Int) : Any? = null fun get(index: Int) : Any? = null
} }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
open class A open class A
class B : A() { class B : A() {
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
open class Test1 { open class Test1 {
fun test1(): String { fun test1(): String {
if (this is Test2) { if (this is Test2) {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class Box<T>(t: T) { class Box<T>(t: T) {
var value = t var value = t
} }

Some files were not shown because too many files have changed in this diff Show More