[test] Run irText tests against K1 frontend for JS

This commit is contained in:
Sergej Jaskiewicz
2023-03-14 20:20:53 +01:00
committed by Space Team
parent 502a0b7e10
commit 27ccef868a
135 changed files with 6607 additions and 697 deletions
@@ -1,5 +1,5 @@
// IGNORE_BACKEND_K2: JS_IR
// IGNORE_BACKEND_K2: JS_IR_ES6
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
annotation class TestAnn(val x: String)
@@ -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
annotation class Ann
@@ -1,5 +1,5 @@
// IGNORE_BACKEND_K2: JS_IR
// IGNORE_BACKEND_K2: JS_IR_ES6
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
annotation class TestAnn(val x: String)
@@ -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, D }
@@ -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
annotation class A(val x: String)
@@ -1,4 +1,7 @@
// FIR_IDENTICAL
// IGNORE_BACKEND_K1: JS_IR
// IGNORE_BACKEND_K1: JS_IR_ES6
annotation class A1
annotation class A2
annotation class A3
@@ -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
class C {
val test1 = 0
@@ -1,7 +1,7 @@
// FIR_IDENTICAL
// !LANGUAGE: +ContextReceivers
// IGNORE_BACKEND_K2: JS_IR
// IGNORE_BACKEND_K2: JS_IR_ES6
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
class Outer {
val x: Int = 1
@@ -1,5 +1,7 @@
// FIR_IDENTICAL
// !LANGUAGE: +ContextReceivers
// IGNORE_BACKEND_K1: JS_IR
// IGNORE_BACKEND_K1: JS_IR_ES6
class Context {
fun foo() = 1
@@ -1,7 +1,7 @@
// FIR_IDENTICAL
// !LANGUAGE: +ContextReceivers
// IGNORE_BACKEND_K2: JS_IR
// IGNORE_BACKEND_K2: JS_IR_ES6
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
class O(val o: String)
@@ -1,7 +1,7 @@
// FIR_IDENTICAL
// !LANGUAGE: +ContextReceivers
// IGNORE_BACKEND_K2: JS_IR
// IGNORE_BACKEND_K2: JS_IR_ES6
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
class C {
val c = 42
@@ -1,6 +1,6 @@
// !LANGUAGE: +ContextReceivers
// IGNORE_BACKEND_K2: JS_IR
// IGNORE_BACKEND_K2: JS_IR_ES6
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
class Param
class C {
@@ -1,6 +1,9 @@
// FIR_IDENTICAL
// !LANGUAGE: +ContextReceivers
// IGNORE_BACKEND_K1: JS_IR
// IGNORE_BACKEND_K1: JS_IR_ES6
context(T) class A<T>
context(Collection<P>) class B<P>
@@ -11,4 +14,4 @@ fun Int.foo() {
fun Collection<Int>.bar() {
B<Int>()
}
}
@@ -1,7 +1,7 @@
// FIR_IDENTICAL
// !LANGUAGE: +ContextReceivers
// IGNORE_BACKEND_K2: JS_IR
// IGNORE_BACKEND_K2: JS_IR_ES6
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
interface Lazy<T>
@@ -1,7 +1,7 @@
// FIR_IDENTICAL
// !LANGUAGE: +ContextReceivers
// IGNORE_BACKEND_K2: JS_IR
// IGNORE_BACKEND_K2: JS_IR_ES6
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
class Context
@@ -1,7 +1,7 @@
// FIR_IDENTICAL
// !LANGUAGE: +ContextReceivers
// IGNORE_BACKEND_K2: JS_IR
// IGNORE_BACKEND_K2: JS_IR_ES6
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
context(Int, String)
fun foo(): Int {
@@ -1,8 +1,8 @@
// FIR_IDENTICAL
// !LANGUAGE: +ContextReceivers
// !DIAGNOSTICS: -UNUSED_PARAMETER
// IGNORE_BACKEND_K2: JS_IR
// IGNORE_BACKEND_K2: JS_IR_ES6
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
interface NumberOperations {
fun Number.plus(other: Number): Number
@@ -1,5 +1,7 @@
// FIR_IDENTICAL
// !LANGUAGE: +ContextReceivers
// IGNORE_BACKEND_K1: JS_IR
// IGNORE_BACKEND_K1: JS_IR_ES6
class A<T>(val a: T)
class B(val b: Any)
@@ -1,7 +1,7 @@
// FIR_IDENTICAL
// !LANGUAGE: +ContextReceivers
// IGNORE_BACKEND_K2: JS_IR
// IGNORE_BACKEND_K2: JS_IR_ES6
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
context(T)
fun <T> useContext(block: (T) -> Unit) { }
@@ -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
val test1 by lazy { 42 }
@@ -1,3 +1,6 @@
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
inline class IT(val x: Int)
inline class InlineMutableSet(private val ms: MutableSet<IT>) : MutableSet<IT> {
+2 -2
View File
@@ -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
suspend fun foo() = baz<Unit>()
suspend fun bar() = baz<Any>()
+3
View File
@@ -1,4 +1,7 @@
// SKIP_KT_DUMP
// IGNORE_BACKEND_K1: JS_IR
// IGNORE_BACKEND_K1: JS_IR_ES6
// MODULE: a
// FILE: a.kt
package a
+2 -2
View File
@@ -1,7 +1,7 @@
// ISSUE: KT-47527
// WITH_STDLIB
// IGNORE_BACKEND_K2: JS_IR
// IGNORE_BACKEND_K2: JS_IR_ES6
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
fun test_1(value: Any?): String? = value?.let { return "O" }
fun test_2(value: Any?): String? = run {
+2 -2
View File
@@ -1,6 +1,6 @@
// ISSUE: KT-52677
// IGNORE_BACKEND_K2: JS_IR
// IGNORE_BACKEND_K2: JS_IR_ES6
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
@Target(AnnotationTarget.TYPE)
annotation class MySerializable(val c: kotlin.reflect.KClass<*>)
@@ -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() {
val x by lazy { 42 }
@@ -2,6 +2,9 @@
// IGNORE_BACKEND_K2: ANY
// FIR status: In FIR, declaring the same `expect` and `actual` classes in one compiler module is not possible (see KT-55177).
// IGNORE_BACKEND_K1: JS_IR
// IGNORE_BACKEND_K1: JS_IR_ES6
expect enum class MyEnum {
FOO,
BAR
@@ -11,4 +14,4 @@ actual enum class MyEnum {
FOO,
BAR,
BAZ
}
}
@@ -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
val test1 = 0
@@ -1 +1,4 @@
data class Test<T>(val x: T, val y: String = "")
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
data class Test<T>(val x: T, val y: String = "")
@@ -1,6 +1,8 @@
// IGNORE_BACKEND_K2: ANY
// accessing uninitialized parameter is illegal in FIR
// LANGUAGE: -ProhibitIllegalValueParameterUsageInDefaultArguments
// IGNORE_BACKEND_K1: JS_IR
// IGNORE_BACKEND_K1: JS_IR_ES6
fun f(
f1: () -> String = { f2() },