[JS IR BE] Update test data

This commit is contained in:
Roman Artemev
2018-06-13 17:00:56 +03:00
committed by Roman Artemev
parent 02628e8de3
commit f69bd54d6c
174 changed files with 83 additions and 197 deletions
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box() : String { fun box() : String {
try { try {
return "OK" return "OK"
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
var state = "" var state = ""
var topLevel: Int var topLevel: Int
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun <T> castToString(t: T) { fun <T> castToString(t: T) {
t as String t as String
} }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class GameError(msg: String): Exception(msg) { class GameError(msg: String): Exception(msg) {
} }
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun test1() : Boolean { fun test1() : Boolean {
try { try {
return true return true
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class Reluctant() { class Reluctant() {
init { init {
throw Exception("I'm not coming out") throw Exception("I'm not coming out")
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
operator fun Int?.inc() : Int { if (this != null) return this.inc() else throw NullPointerException() } operator fun Int?.inc() : Int { if (this != null) return this.inc() else throw NullPointerException() }
public fun box() : String { public fun box() : String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box(): String { fun box(): String {
OUTER@while (true) { OUTER@while (true) {
var x = "" var x = ""
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box(): String { fun box(): String {
var x = "OK" var x = "OK"
while (true) { while (true) {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box(): String { fun box(): String {
while (true) { while (true) {
try { try {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
var result = "Fail" var result = "Fail"
fun foo() { fun foo() {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box(): String { fun box(): String {
try { try {
} catch (e: Exception) { } catch (e: Exception) {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun nyCompiler() { fun nyCompiler() {
try { try {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box(): String { fun box(): String {
var s = "" var s = ""
try { try {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun foo(args: Array<String>) { fun foo(args: Array<String>) {
try { try {
} finally { } finally {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun foo(): Int { fun foo(): Int {
try { try {
} finally { } finally {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun testIf() { fun testIf() {
val condition = true val condition = true
val result = if (condition) { val result = if (condition) {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun check1() { fun check1() {
val result = if (true) { val result = if (true) {
if (true) 1 else 2 if (true) 1 else 2
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun foo() { fun foo() {
var x = 0 var x = 0
do { do {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class A() { class A() {
fun action() = "OK" fun action() = "OK"
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
inline fun exit(): Nothing = null!! inline fun exit(): Nothing = null!!
fun box(): String { fun box(): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun exit(): Nothing = null!! fun exit(): Nothing = null!!
fun box(): String { fun box(): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box() : String { fun box() : String {
try { try {
} finally { } finally {
@@ -1,3 +1,2 @@
// IGNORE_BACKEND: JS_IR
fun box(): String = fun box(): String =
"O" + try { throw Exception("oops!") } catch (e: Exception) { "K" } "O" + try { throw Exception("oops!") } catch (e: Exception) { "K" }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun cleanup() {} fun cleanup() {}
inline fun concat(x: String, y: String): String = x + y inline fun concat(x: String, y: String): String = x + y
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
inline fun catchAll(x: String, block: () -> Unit): String { inline fun catchAll(x: String, block: () -> Unit): String {
try { try {
block() block()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
public inline fun fails(block: () -> Unit): Throwable? { public inline fun fails(block: () -> Unit): Throwable? {
var thrown: Throwable? = null var thrown: Throwable? = null
try { try {
@@ -1,3 +1,2 @@
// IGNORE_BACKEND: JS_IR
fun box(): String = fun box(): String =
"O" + try { "K" } finally { "hmmm" } "O" + try { "K" } finally { "hmmm" }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
inline fun <T> tryOrElse(f1: () -> T, f2: () -> T): T { inline fun <T> tryOrElse(f1: () -> T, f2: () -> T): T {
try { try {
return f1() return f1()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
inline fun <T> tryOrElse(f1: () -> T, f2: () -> T): T = inline fun <T> tryOrElse(f1: () -> T, f2: () -> T): T =
try { f1() } catch (e: Exception) { f2() } try { f1() } catch (e: Exception) { f2() }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
inline fun <T> tryAndThen(f1: () -> Unit, f2: () -> Unit, f3: () -> T): T { inline fun <T> tryAndThen(f1: () -> Unit, f2: () -> Unit, f3: () -> T): T {
try { try {
f1() f1()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun zap(s: String) = s fun zap(s: String) = s
inline fun tryZap(string: String, fn: (String) -> String) = inline fun tryZap(string: String, fn: (String) -> String) =
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun zap(s: String) = s fun zap(s: String) = s
inline fun tryZap(s1: String, s2: String, fn: (String, String) -> String) = inline fun tryZap(s1: String, s2: String, fn: (String, String) -> String) =
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun zap(s: String) = s fun zap(s: String) = s
inline fun tryZap(s1: String, s2: String, fn: String.(String) -> String) = inline fun tryZap(s1: String, s2: String, fn: String.(String) -> String) =
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun zap(s: String) = s fun zap(s: String) = s
inline fun tryZap(string: String, fn: String.() -> String) = inline fun tryZap(string: String, fn: String.() -> String) =
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun zap(s: String) = s fun zap(s: String) = s
inline fun tryZap(string: String, fn: (String) -> String) = inline fun tryZap(string: String, fn: (String) -> String) =
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun zap(s: String) = s fun zap(s: String) = s
inline fun tryZap(string: String, fn: (String) -> String) = inline fun tryZap(string: String, fn: (String) -> String) =
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun zap(s: String) = s fun zap(s: String) = s
inline fun tryZap1(string: String, fn: (String) -> String) = inline fun tryZap1(string: String, fn: (String) -> String) =
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
interface Callable { interface Callable {
fun call(b: Boolean) fun call(b: Boolean)
} }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
inline fun doCall(f: () -> Any) = f() inline fun doCall(f: () -> Any) = f()
fun test1() { fun test1() {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class Exception1(msg: String): Exception(msg) class Exception1(msg: String): Exception(msg)
class Exception2(msg: String): Exception(msg) class Exception2(msg: String): Exception(msg)
class Exception3(msg: String): Exception(msg) class Exception3(msg: String): Exception(msg)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
inline fun test(s: () -> Int): Int = inline fun test(s: () -> Int): Int =
try { try {
val i = s() val i = s()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun shouldReturnFalse() : Boolean { fun shouldReturnFalse() : Boolean {
try { try {
return true return true
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun shouldReturn11() : Int { fun shouldReturn11() : Int {
var x = 0 var x = 0
while (true) { while (true) {
@@ -1,3 +1,2 @@
// IGNORE_BACKEND: JS_IR
fun box(): String = fun box(): String =
"O" + try { "K" } catch (e: Exception) { "oops!" } "O" + try { "K" } catch (e: Exception) { "oops!" }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box(): String = fun box(): String =
"" + "" +
try { "O" } catch (e: Exception) { "1" } + try { "O" } catch (e: Exception) { "1" } +
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun idiv(a: Int, b: Int): Int = fun idiv(a: Int, b: Int): Int =
if (b == 0) throw Exception("Division by zero") else a / b if (b == 0) throw Exception("Division by zero") else a / b
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box(): String = fun box(): String =
"O" + "O" +
try { try {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class MyException(message: String): Exception(message) class MyException(message: String): Exception(message)
fun box(): String = fun box(): String =
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
inline fun catchAll(x: String, block: () -> Unit): String { inline fun catchAll(x: String, block: () -> Unit): String {
try { try {
block() block()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box(): String { fun box(): String {
try { try {
return "OK" return "OK"
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box(): String { fun box(): String {
if (false) { if (false) {
try { try {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class A { class A {
operator fun component1() = "O" operator fun component1() = "O"
operator fun component2(): String = throw RuntimeException("fail 0") operator fun component2(): String = throw RuntimeException("fail 0")
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
interface PsiElement { interface PsiElement {
fun <T: PsiElement> findChildByType(i: Int): T? = fun <T: PsiElement> findChildByType(i: Int): T? =
if (i == 42) JetOperationReferenceExpression() as T else throw Exception() if (i == 42) JetOperationReferenceExpression() as T else throw Exception()
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun <T> foo(t: T) { fun <T> foo(t: T) {
t!! t!!
} }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
infix fun <T> T.mustBe(t : T) { infix fun <T> T.mustBe(t : T) {
assert("$this must be $t") {this == t} assert("$this must be $t") {this == t}
} }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class MyString { class MyString {
var s = "" var s = ""
operator fun plus(x : String) : MyString { operator fun plus(x : String) : MyString {
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun test1() : String { fun test1() : String {
var s = ""; var s = "";
try { try {
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun f(): Int { fun f(): Int {
try { try {
return 0 return 0
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun fail() = if (true) throw RuntimeException() else 1 fun fail() = if (true) throw RuntimeException() else 1
fun test1(): String { fun test1(): String {
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class MyString { class MyString {
var s = "" var s = ""
operator fun plus(x : String) : MyString { operator fun plus(x : String) : MyString {
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun <T, R> io(s: R, a: (R) -> T): T { fun <T, R> io(s: R, a: (R) -> T): T {
try { try {
return a(s) return a(s)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun a(): IntArray? = null fun a(): IntArray? = null
fun b(): Nothing = throw Exception() fun b(): Nothing = throw Exception()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun a(): String? = null fun a(): String? = null
fun b(): Nothing = throw Exception() fun b(): Nothing = throw Exception()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
//KT-3297 Calling the wrong function inside an extension method to the Function0 class //KT-3297 Calling the wrong function inside an extension method to the Function0 class
infix fun <R> Function0<R>.or(alt: () -> R): R { infix fun <R> Function0<R>.or(alt: () -> R): R {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class A(val p: String) { class A(val p: String) {
val prop: String = throw RuntimeException() val prop: String = throw RuntimeException()
} }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class A { class A {
val p : Int = try{ val p : Int = try{
1 1
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
object A { object A {
operator fun get(i: Int) = 1 operator fun get(i: Int) = 1
operator fun set(i: Int, j: Int) {} operator fun set(i: Int, j: Int) {}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class A() { class A() {
var x = 5 var x = 5
} }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class A() { class A() {
var x = 5 var x = 5
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
var order: String = "" var order: String = ""
fun a(i: Int): Int? { fun a(i: Int): Int? {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box(): String { fun box(): String {
try { try {
if ((null as Int?)!! == 10) return "Fail #1" if ((null as Int?)!! == 10) return "Fail #1"
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class A( class A(
private val x: String, private val x: String,
private var y: Double private var y: Double
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
sealed class Result { sealed class Result {
class Failure(val exception: Exception) : Result() class Failure(val exception: Exception) : Result()
class Success(val message: String) : Result() class Success(val message: String) : Result()
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun foo(): String { fun foo(): String {
val s = try { val s = try {
"OK" "OK"
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
inline fun run(block: () -> Unit) = block() inline fun run(block: () -> Unit) = block()
class A { class A {
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class Bob { class Bob {
fun Bob.bar() = "OK" fun Bob.bar() = "OK"
} }
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
open class KFoo { open class KFoo {
fun foo(): String { fun foo(): String {
if (this is KFooQux) return qux if (this is KFooQux) return qux
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
interface A { interface A {
var bar: Boolean var bar: Boolean
get() = false get() = false
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// Exception in thread "main" java.lang.VerifyError: (class: org/jetbrains/kannotator/controlFlowBuilder/GraphBuilderInterpreter, method: binaryOperation signature: (Lorg/objectweb/asm/tree/AbstractInsnNode;Lorg/jetbrains/kannotator/controlFlowBuilder/AsmPossibleValues;Lorg/jetbrains/kannotator/controlFlowBuilder/AsmPossibleValues;)Lorg/jetbrains/kannotator/controlFlowBuilder/AsmPossibleValues;) Wrong return type in function // Exception in thread "main" java.lang.VerifyError: (class: org/jetbrains/kannotator/controlFlowBuilder/GraphBuilderInterpreter, method: binaryOperation signature: (Lorg/objectweb/asm/tree/AbstractInsnNode;Lorg/jetbrains/kannotator/controlFlowBuilder/AsmPossibleValues;Lorg/jetbrains/kannotator/controlFlowBuilder/AsmPossibleValues;)Lorg/jetbrains/kannotator/controlFlowBuilder/AsmPossibleValues;) Wrong return type in function
fun foo(): Nothing = throw Exception() fun foo(): Nothing = throw Exception()
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun test(x: Int): String = when(x) { fun test(x: Int): String = when(x) {
0 -> "zero" 0 -> "zero"
1 -> "one" 1 -> "one"
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun isZero(x: Int) = when(x) { fun isZero(x: Int) = when(x) {
0 -> true 0 -> true
else -> throw Exception() else -> throw Exception()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt // FILE: 1.kt
package test package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt // FILE: 1.kt
package test package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt // FILE: 1.kt
package test package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt // FILE: 1.kt
package test package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt // FILE: 1.kt
package test package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt // FILE: 1.kt
package test package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt // FILE: 1.kt
package test package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt // FILE: 1.kt
package test package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt // FILE: 1.kt
package test package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt // FILE: 1.kt
package test package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt // FILE: 1.kt
package test package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt // FILE: 1.kt
package test package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt // FILE: 1.kt
package test package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt // FILE: 1.kt
package test package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt // FILE: 1.kt
package test package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt // FILE: 1.kt
package test package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt // FILE: 1.kt
package test package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt // FILE: 1.kt
package test package test

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