[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 {
try {
return "OK"
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
var state = ""
var topLevel: Int
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun <T> castToString(t: T) {
t as String
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class GameError(msg: String): Exception(msg) {
}
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun test1() : Boolean {
try {
return true
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class Reluctant() {
init {
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() }
public fun box() : String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box(): String {
OUTER@while (true) {
var x = ""
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box(): String {
var x = "OK"
while (true) {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box(): String {
while (true) {
try {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
var result = "Fail"
fun foo() {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box(): String {
try {
} catch (e: Exception) {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun nyCompiler() {
try {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box(): String {
var s = ""
try {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun foo(args: Array<String>) {
try {
} finally {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun foo(): Int {
try {
} finally {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun testIf() {
val condition = true
val result = if (condition) {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun check1() {
val result = if (true) {
if (true) 1 else 2
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun foo() {
var x = 0
do {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class A() {
fun action() = "OK"
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
inline fun exit(): Nothing = null!!
fun box(): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun exit(): Nothing = null!!
fun box(): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box() : String {
try {
} finally {
@@ -1,3 +1,2 @@
// IGNORE_BACKEND: JS_IR
fun box(): String =
"O" + try { throw Exception("oops!") } catch (e: Exception) { "K" }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun cleanup() {}
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 {
try {
block()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
public inline fun fails(block: () -> Unit): Throwable? {
var thrown: Throwable? = null
try {
@@ -1,3 +1,2 @@
// IGNORE_BACKEND: JS_IR
fun box(): String =
"O" + try { "K" } finally { "hmmm" }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
inline fun <T> tryOrElse(f1: () -> T, f2: () -> T): T {
try {
return f1()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
inline fun <T> tryOrElse(f1: () -> T, f2: () -> T): T =
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 {
try {
f1()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun zap(s: String) = s
inline fun tryZap(string: String, fn: (String) -> String) =
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun zap(s: String) = s
inline fun tryZap(s1: String, s2: String, fn: (String, String) -> String) =
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun zap(s: String) = s
inline fun tryZap(s1: String, s2: String, fn: String.(String) -> String) =
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun zap(s: String) = s
inline fun tryZap(string: String, fn: String.() -> String) =
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun zap(s: String) = s
inline fun tryZap(string: String, fn: (String) -> String) =
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun zap(s: String) = s
inline fun tryZap(string: String, fn: (String) -> String) =
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun zap(s: String) = s
inline fun tryZap1(string: String, fn: (String) -> String) =
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
interface Callable {
fun call(b: Boolean)
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
inline fun doCall(f: () -> Any) = f()
fun test1() {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class Exception1(msg: String): Exception(msg)
class Exception2(msg: String): Exception(msg)
class Exception3(msg: String): Exception(msg)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
inline fun test(s: () -> Int): Int =
try {
val i = s()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun shouldReturnFalse() : Boolean {
try {
return true
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun shouldReturn11() : Int {
var x = 0
while (true) {
@@ -1,3 +1,2 @@
// IGNORE_BACKEND: JS_IR
fun box(): String =
"O" + try { "K" } catch (e: Exception) { "oops!" }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box(): String =
"" +
try { "O" } catch (e: Exception) { "1" } +
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun idiv(a: Int, b: Int): Int =
if (b == 0) throw Exception("Division by zero") else a / b
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box(): String =
"O" +
try {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class MyException(message: String): Exception(message)
fun box(): String =
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
inline fun catchAll(x: String, block: () -> Unit): String {
try {
block()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box(): String {
try {
return "OK"
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box(): String {
if (false) {
try {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class A {
operator fun component1() = "O"
operator fun component2(): String = throw RuntimeException("fail 0")
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
interface PsiElement {
fun <T: PsiElement> findChildByType(i: Int): T? =
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) {
t!!
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
infix fun <T> T.mustBe(t : T) {
assert("$this must be $t") {this == t}
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class MyString {
var s = ""
operator fun plus(x : String) : MyString {
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun test1() : String {
var s = "";
try {
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun f(): Int {
try {
return 0
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun fail() = if (true) throw RuntimeException() else 1
fun test1(): String {
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class MyString {
var s = ""
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 {
try {
return a(s)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun a(): IntArray? = null
fun b(): Nothing = throw Exception()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun a(): String? = null
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
infix fun <R> Function0<R>.or(alt: () -> R): R {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class A(val p: String) {
val prop: String = throw RuntimeException()
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class A {
val p : Int = try{
1
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
object A {
operator fun get(i: Int) = 1
operator fun set(i: Int, j: Int) {}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class A() {
var x = 5
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class A() {
var x = 5
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
var order: String = ""
fun a(i: Int): Int? {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box(): String {
try {
if ((null as Int?)!! == 10) return "Fail #1"
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class A(
private val x: String,
private var y: Double
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
sealed class Result {
class Failure(val exception: Exception) : Result()
class Success(val message: String) : Result()
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun foo(): String {
val s = try {
"OK"
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
inline fun run(block: () -> Unit) = block()
class A {
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
class Bob {
fun Bob.bar() = "OK"
}
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
open class KFoo {
fun foo(): String {
if (this is KFooQux) return qux
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
interface A {
var bar: Boolean
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
fun foo(): Nothing = throw Exception()
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun test(x: Int): String = when(x) {
0 -> "zero"
1 -> "one"
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun isZero(x: Int) = when(x) {
0 -> true
else -> throw Exception()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt
package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt
package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt
package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt
package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt
package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt
package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt
package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt
package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt
package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt
package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt
package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt
package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt
package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt
package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt
package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt
package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt
package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// FILE: 1.kt
package test

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