[test] Run irText tests against K1 frontend for JS
This commit is contained in:
committed by
Space Team
parent
502a0b7e10
commit
27ccef868a
@@ -1,6 +1,6 @@
|
||||
// FIR_IDENTICAL
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
|
||||
fun <R : Number> Number.convert(): R = TODO()
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
|
||||
fun test() {
|
||||
val x = intArrayOf(1, 2, 3)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
|
||||
fun foo(): IntArray = intArrayOf(1, 2, 3)
|
||||
fun bar() = 42
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// IGNORE_BACKEND_K2: JVM_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
// !IGNORE_ERRORS
|
||||
|
||||
fun test1() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// LANGUAGE: +BreakContinueInInlineLambdas
|
||||
// IGNORE_BACKEND_K2: JVM_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
// !IGNORE_ERRORS
|
||||
// WITH_STDLIB
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// IGNORE_BACKEND_K1: JS_IR
|
||||
// IGNORE_BACKEND_K1: JS_IR_ES6
|
||||
|
||||
fun test1(c: Boolean?) {
|
||||
L@ while (true) {
|
||||
L2@while (c ?: break)
|
||||
@@ -32,4 +35,4 @@ fun test5() {
|
||||
} while (if (j >= 3) false else break) // break@Inner
|
||||
if (i == 3) break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// !LANGUAGE: +AllowBreakAndContinueInsideWhen
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
|
||||
fun testBreakFor() {
|
||||
val xs = IntArray(10) { i -> i }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// SKIP_KT_DUMP
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
|
||||
class ObjectAssert<ACTUAL> {
|
||||
fun describedAs(description: String?, vararg args: Any?): ObjectAssert<ACTUAL>? = null
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
|
||||
fun test(f: () -> Unit) =
|
||||
try { f() } catch (e: Exception) { throw e }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
|
||||
enum class X {
|
||||
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
|
||||
enum class MyEnum {
|
||||
Z {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
|
||||
enum class A { V1 }
|
||||
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
// WITH_STDLIB
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
|
||||
fun testEmpty(ss: List<String>) {
|
||||
for (s in ss);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// WITH_STDLIB
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
|
||||
object FiveTimes
|
||||
|
||||
|
||||
+3
@@ -1,3 +1,6 @@
|
||||
// IGNORE_BACKEND_K1: JS_IR
|
||||
// IGNORE_BACKEND_K1: JS_IR_ES6
|
||||
|
||||
fun testSimple() = Box<Long>(2L * 3)
|
||||
|
||||
inline fun <reified T> testArray(n: Int, crossinline block: () -> T): Array<T> {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
|
||||
var p: Int = 0
|
||||
val arr = intArrayOf(1, 2, 3)
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
// WITH_STDLIB
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
|
||||
interface X {
|
||||
val xs: MutableList<Any>
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
|
||||
fun <T> magic(): T = throw Exception()
|
||||
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
// FIR_IDENTICAL
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
|
||||
fun a() = "string"
|
||||
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
// ISSUE: KT-48708
|
||||
|
||||
fun test(b: Boolean) {
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
// ISSUE: KT-48806
|
||||
|
||||
class A {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
// WITH_STDLIB
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
// SKIP_KT_DUMP
|
||||
|
||||
class A {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
|
||||
object A
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
// IGNORE_BACKEND_K2: ANY
|
||||
// FIR status: KT-46419, ILT conversions to Byte and Short are not supported by design
|
||||
|
||||
// IGNORE_BACKEND_K1: JS_IR
|
||||
// IGNORE_BACKEND_K1: JS_IR_ES6
|
||||
|
||||
val test1: Long = 42
|
||||
val test2: Short = 42
|
||||
val test3: Byte = 42
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
|
||||
class Ref(var value: Int)
|
||||
|
||||
interface IHost {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// WITH_STDLIB
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
// !LANGUAGE: +ImplicitSignedToUnsignedIntegerConversion
|
||||
|
||||
// FILE: signedToUnsignedConversions_annotation.kt
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_STDLIB
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
|
||||
fun expectsString(s: String) {}
|
||||
fun expectsInt(i: Int) {}
|
||||
|
||||
@@ -5,7 +5,7 @@ fun useSuspendVararg(vararg sfn: suspend () -> Unit) {}
|
||||
|
||||
fun testSuspendConversionInVarargElementsSome(
|
||||
f1: () -> Unit,
|
||||
sf2: suspend () -> Unit
|
||||
sf2: suspend () -> Unit,
|
||||
f3: () -> Unit,
|
||||
) {
|
||||
useSuspendVararg(f1, sf2, f3)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
|
||||
val n: Any? = null
|
||||
|
||||
|
||||
+4
-1
@@ -1,3 +1,6 @@
|
||||
// IGNORE_BACKEND_K1: JS_IR
|
||||
// IGNORE_BACKEND_K1: JS_IR_ES6
|
||||
|
||||
fun test1() {
|
||||
throw Throwable()
|
||||
}
|
||||
@@ -6,4 +9,4 @@ fun testImplicitCast(a: Any) {
|
||||
if (a is Throwable) {
|
||||
throw a
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
// WITH_STDLIB
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
|
||||
fun test1() {
|
||||
try {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// FIR_IDENTICAL
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
// WITH_STDLIB
|
||||
|
||||
val testSimpleUIntLiteral = 1u
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
|
||||
enum class Enum { A }
|
||||
object A
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// FIR_IDENTICAL
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
|
||||
fun testScalar(a: Any): IntArray {
|
||||
if (a !is Int) return intArrayOf()
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
// WITH_STDLIB
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
|
||||
object A
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// FIR_IDENTICAL
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
|
||||
fun run(block: () -> Unit) {}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// IGNORE_BACKEND_K2: JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
|
||||
enum class En { A, B, C }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user