K2 Scripting: add Fir script codegen tests

27 failing tests are muted
This commit is contained in:
Ilya Chernikov
2023-06-02 16:21:49 +02:00
committed by Space Team
parent 83d0dbe436
commit 5824b9c59c
35 changed files with 631 additions and 42 deletions
@@ -1,3 +1,5 @@
// IGNORE_BACKEND_K2: JVM_IR
package script.long.name.inside.packag
interface I {
@@ -1,3 +1,5 @@
// IGNORE_BACKEND_K2: JVM_IR
val (abc, def) = A()
val rv = abc + def
@@ -1,3 +1,5 @@
// IGNORE_BACKEND_K2: JVM_IR
val (_, b, _) = A()
class A {
+2
View File
@@ -1,3 +1,5 @@
// IGNORE_BACKEND_K2: JVM_IR
// expected: rv: 2
inline fun foo(l: (Int) -> Int ): Int {
return l(1)
+1
View File
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_K2: JVM_IR
val b = "K"
+2
View File
@@ -1,3 +1,5 @@
// IGNORE_BACKEND_K2: JVM_IR
enum class Build { Debug, Release }
fun applySomething(build: Build) = when (build) {
+1
View File
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_K2: JVM_IR
data class Pair(val first: Int, val second: Int)
+1
View File
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_K2: JVM_IR
val p = 0
@@ -1,3 +1,5 @@
// IGNORE_BACKEND_K2: JVM_IR
import kotlin.reflect.KProperty
class Delegate {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_K2: JVM_IR
// WITH_REFLECT
import kotlin.reflect.KProperty
@@ -1,3 +1,5 @@
// IGNORE_BACKEND_K2: JVM_IR
import kotlin.reflect.KProperty
class Delegate {
+2
View File
@@ -1,3 +1,5 @@
// IGNORE_BACKEND_K2: JVM_IR
// param: 10
fun addX(y: Int) = java.lang.Integer.parseInt(args[0]) + y
@@ -1,4 +1,5 @@
// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6, NATIVE, WASM
// IGNORE_BACKEND_K2: JVM_IR
// expected: rv: 42
@@ -1,5 +1,6 @@
// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6, NATIVE, WASM
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND_K2: JVM_IR
// expected: rv: kotlin.Unit
@@ -1,5 +1,6 @@
// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6, NATIVE, WASM
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND_K2: JVM_IR
// expected: rv: kotlin.Unit
@@ -1,4 +1,5 @@
// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6, NATIVE, WASM
// IGNORE_BACKEND_K2: JVM_IR
// expected: rv: 42
@@ -1,4 +1,5 @@
// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6, NATIVE, WASM
// IGNORE_BACKEND_K2: JVM_IR
// expected: rv: abc
@@ -1,5 +1,6 @@
// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6, NATIVE, WASM
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND_K2: JVM_IR
// expected: rv: 42
@@ -1,5 +1,6 @@
// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6, NATIVE, WASM
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND_K2: JVM_IR
// expected: rv: 42
@@ -1,5 +1,6 @@
// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6, NATIVE, WASM
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND_K2: JVM_IR
// expected: rv: 42
@@ -1,4 +1,5 @@
// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6, NATIVE, WASM
// IGNORE_BACKEND_K2: JVM_IR
// expected: rv: abcabc
@@ -1,4 +1,5 @@
// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6, NATIVE, WASM
// IGNORE_BACKEND_K2: JVM_IR
// expected: rv: abc!
+2
View File
@@ -1,3 +1,5 @@
// IGNORE_BACKEND_K2: JVM_IR
class SimpleClass(val s: String) {
fun foo() = s
}
@@ -1,3 +1,5 @@
// IGNORE_BACKEND_K2: JVM_IR
import kotlin.reflect.KProperty
class Delegate {
@@ -1,3 +1,5 @@
// IGNORE_BACKEND_K2: JVM_IR
var log = "begin"
fun append(msg: String) {
log = "$log;$msg"
@@ -1,3 +1,5 @@
// IGNORE_BACKEND_K2: JVM_IR
import kotlin.reflect.KProperty
class Delegate {
@@ -1,3 +1,5 @@
// IGNORE_BACKEND_K2: JVM_IR
class SimpleClass(val s: String) {
fun foo() = s
}