[K2, MPP] Make MPP tests from k2/basic target-wide
^KT-57349
This commit is contained in:
committed by
Space Team
parent
ee73e4774b
commit
4e67d82cd3
+3
-5
@@ -1,8 +1,7 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// IGNORE_BACKEND_K1: JS, JS_IR, JS_IR_ES6
|
||||
// !LANGUAGE: +MultiPlatformProjects
|
||||
|
||||
// MODULE: common
|
||||
// TARGET_PLATFORM: Common
|
||||
// FILE: common.kt
|
||||
|
||||
val LocalClass = object {
|
||||
@@ -11,8 +10,7 @@ val LocalClass = object {
|
||||
|
||||
fun ok() = LocalClass.toString()
|
||||
|
||||
// MODULE: jvm()()(common)
|
||||
// TARGET_PLATFORM: JVM
|
||||
// FILE: main.kt
|
||||
// MODULE: platform()()(common)
|
||||
// FILE: platform.kt
|
||||
|
||||
fun box() = ok()
|
||||
+4
-4
@@ -1,5 +1,6 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// IGNORE_BACKEND_K1: JS, JS_IR, JS_IR_ES6
|
||||
// !LANGUAGE: +MultiPlatformProjects
|
||||
|
||||
// MODULE: lib
|
||||
// FILE: lib.kt
|
||||
|
||||
@@ -9,9 +10,8 @@ fun transform(x: String, f: (String) -> String): String {
|
||||
return f(x) + "K"
|
||||
}
|
||||
|
||||
// MODULE: lib2()()(lib)
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// FILE: main.kt
|
||||
// MODULE: platform()()(lib)
|
||||
// FILE: platform.kt
|
||||
|
||||
package bar
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// IGNORE_BACKEND_K1: JS, JS_IR, JS_IR_ES6
|
||||
// !LANGUAGE: +MultiPlatformProjects
|
||||
|
||||
// MODULE: common
|
||||
@@ -11,9 +11,8 @@ expect enum class Base2 { K }
|
||||
|
||||
fun k() = Base2.K.name
|
||||
|
||||
// MODULE: jvm()()(common)
|
||||
// TARGET_PLATFORM: JVM
|
||||
// FILE: main.kt
|
||||
// MODULE: platform()()(common)
|
||||
// FILE: platform.kt
|
||||
|
||||
actual enum class Base2 { K }
|
||||
|
||||
|
||||
+3
-4
@@ -1,4 +1,4 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_K1: JS, JS_IR, JS_IR_ES6
|
||||
// !LANGUAGE: +MultiPlatformProjects
|
||||
|
||||
// MODULE: common
|
||||
@@ -11,9 +11,8 @@ expect fun ret(): R
|
||||
|
||||
fun foo() = ::ret
|
||||
|
||||
// MODULE: main()()(common)
|
||||
// TARGET_PLATFORM: JVM
|
||||
// FILE: main.kt
|
||||
// MODULE: platform()()(common)
|
||||
// FILE: platform.kt
|
||||
|
||||
actual fun ret(): R = "OK"
|
||||
|
||||
|
||||
+3
-4
@@ -1,4 +1,4 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// IGNORE_BACKEND_K1: JS, JS_IR, JS_IR_ES6
|
||||
// !LANGUAGE: +MultiPlatformProjects
|
||||
|
||||
// MODULE: common
|
||||
@@ -11,9 +11,8 @@ expect fun BooleanArray.getChecked(index: Int): Boolean
|
||||
|
||||
fun ok() = if (!BooleanArray(1).getChecked(0)) "OK" else "FAIL"
|
||||
|
||||
// MODULE: jvm()()(common)
|
||||
// TARGET_PLATFORM: JVM
|
||||
// FILE: main.kt
|
||||
// MODULE: platform()()(common)
|
||||
// FILE: platform.kt
|
||||
|
||||
actual fun <T> Array<T>.getChecked(index: Int) = get(index)
|
||||
|
||||
|
||||
+3
-3
@@ -1,5 +1,6 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_K1: JS, JS_IR, JS_IR_ES6
|
||||
// !LANGUAGE: +MultiPlatformProjects
|
||||
|
||||
// MODULE: common
|
||||
// TARGET_PLATFORM: Common
|
||||
|
||||
@@ -25,8 +26,7 @@ expect class A() {
|
||||
fun g(): Int
|
||||
}
|
||||
|
||||
// MODULE: main()()(common)
|
||||
// TARGET_PLATFORM: JVM
|
||||
// MODULE: platform()()(common)
|
||||
|
||||
// FILE: p11.kt
|
||||
|
||||
|
||||
+4
-4
@@ -1,5 +1,6 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_K1: JS, JS_IR, JS_IR_ES6
|
||||
// !LANGUAGE: +MultiPlatformProjects
|
||||
|
||||
// MODULE: common
|
||||
// TARGET_PLATFORM: Common
|
||||
// FILE: commonMain.kt
|
||||
@@ -15,9 +16,8 @@ fun test(s: String): String {
|
||||
return a.foo(s) + a.bar
|
||||
}
|
||||
|
||||
// MODULE: main()()(common)
|
||||
// TARGET_PLATFORM: JVM
|
||||
// FILE: main.kt
|
||||
// MODULE: platform()()(common)
|
||||
// FILE: platform.kt
|
||||
|
||||
open class B {
|
||||
fun foo(s: String) = s
|
||||
|
||||
+3
-4
@@ -1,4 +1,4 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// IGNORE_BACKEND_K1: JS, JS_IR, JS_IR_ES6
|
||||
// !LANGUAGE: +MultiPlatformProjects
|
||||
|
||||
// MODULE: common0
|
||||
@@ -25,9 +25,8 @@ expect fun f2(): String
|
||||
|
||||
fun g2() = f2()
|
||||
|
||||
// MODULE: jvm()()(common1, common2)
|
||||
// TARGET_PLATFORM: JVM
|
||||
// FILE: jvm.kt
|
||||
// MODULE: platform()()(common1, common2)
|
||||
// FILE: platform.kt
|
||||
|
||||
actual fun f0(): Boolean = true
|
||||
actual fun f1(): String = "O"
|
||||
|
||||
+4
-4
@@ -1,5 +1,6 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_K1: JS, JS_IR, JS_IR_ES6
|
||||
// !LANGUAGE: +MultiPlatformProjects
|
||||
|
||||
// MODULE: common
|
||||
// TARGET_PLATFORM: Common
|
||||
// FILE: commonMain.kt
|
||||
@@ -12,9 +13,8 @@ expect fun foo(i: Int): Int
|
||||
|
||||
fun test(s: S) = foo(s)
|
||||
|
||||
// MODULE: main()()(common)
|
||||
// TARGET_PLATFORM: JVM
|
||||
// FILE: main.kt
|
||||
// MODULE: platform()()(common)
|
||||
// FILE: platform.kt
|
||||
|
||||
actual fun foo(i: Int) = i
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// IGNORE_BACKEND_K1: JS, JS_IR, JS_IR_ES6
|
||||
// !LANGUAGE: +MultiPlatformProjects
|
||||
|
||||
// MODULE: common
|
||||
@@ -14,9 +14,8 @@ fun test(): String {
|
||||
return func() + prop
|
||||
}
|
||||
|
||||
// MODULE: jvm()()(common)
|
||||
// TARGET_PLATFORM: JVM
|
||||
// FILE: main.kt
|
||||
// MODULE: platform()()(common)
|
||||
// FILE: platform.kt
|
||||
|
||||
actual fun func(): String = "O"
|
||||
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
// IGNORE_BACKEND_K1: JS, JS_IR, JS_IR_ES6
|
||||
|
||||
// TARGET_BACKEND: JS_IR
|
||||
// !LANGUAGE: +MultiPlatformProjects
|
||||
|
||||
// MODULE: common
|
||||
// TARGET_PLATFORM: Common
|
||||
// FILE: common.kt
|
||||
|
||||
expect fun func(): String
|
||||
|
||||
expect var prop: String
|
||||
|
||||
fun test(): String {
|
||||
prop = "K"
|
||||
return func() + prop
|
||||
}
|
||||
|
||||
// MODULE: js()()(common)
|
||||
// TARGET_PLATFORM: JS
|
||||
// FILE: main.kt
|
||||
|
||||
actual fun func(): String = "O"
|
||||
|
||||
actual var prop: String = "!"
|
||||
|
||||
fun box() = test()
|
||||
+3
-4
@@ -1,4 +1,4 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_K1: JS, JS_IR, JS_IR_ES6
|
||||
// !LANGUAGE: +MultiPlatformProjects
|
||||
|
||||
// MODULE: common
|
||||
@@ -13,9 +13,8 @@ expect fun foo(): S
|
||||
|
||||
fun test(): S = foo()
|
||||
|
||||
// MODULE: jvm()()(common)
|
||||
// TARGET_PLATFORM: JVM
|
||||
// FILE: main.kt
|
||||
// MODULE: platform()()(common)
|
||||
// FILE: platform.kt
|
||||
|
||||
actual typealias S = String
|
||||
|
||||
|
||||
+3
-4
@@ -1,4 +1,4 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// IGNORE_BACKEND_K1: JS, JS_IR, JS_IR_ES6
|
||||
// !LANGUAGE: +MultiPlatformProjects
|
||||
|
||||
// MODULE: common
|
||||
@@ -14,9 +14,8 @@ open class A : S1, S2
|
||||
|
||||
class B : A()
|
||||
|
||||
// MODULE: jvm()()(common)
|
||||
// TARGET_PLATFORM: JVM
|
||||
// FILE: main.kt
|
||||
// MODULE: platform()()(common)
|
||||
// FILE: platform.kt
|
||||
|
||||
actual interface S1 {
|
||||
fun o(): S = "O"
|
||||
|
||||
+3
-4
@@ -1,4 +1,4 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// IGNORE_BACKEND_K1: JS, JS_IR, JS_IR_ES6
|
||||
// !LANGUAGE: +MultiPlatformProjects
|
||||
|
||||
// MODULE: common
|
||||
@@ -11,9 +11,8 @@ interface Foo {
|
||||
|
||||
fun test(e: Foo) = e.ok()
|
||||
|
||||
// MODULE: jvm()()(common)
|
||||
// TARGET_PLATFORM: JVM
|
||||
// FILE: main.kt
|
||||
// MODULE: platform()()(common)
|
||||
// FILE: platform.kt
|
||||
|
||||
interface Bar : Foo
|
||||
|
||||
|
||||
+5
-4
@@ -1,5 +1,7 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_K1: JS, JS_IR, JS_IR_ES6
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
// !LANGUAGE: +MultiPlatformProjects
|
||||
// TODO: K2 JS_IR Fail Reason: IrSimpleFunctionPublicSymbolImpl for kotlin/assertArrayEquals|-1961670457646030164[0] is already bound...
|
||||
|
||||
// MODULE: common1
|
||||
// TARGET_PLATFORM: Common
|
||||
@@ -13,8 +15,7 @@ fun o() = "O"
|
||||
|
||||
fun k() = "K"
|
||||
|
||||
// MODULE: jvm()()(common1, common2)
|
||||
// TARGET_PLATFORM: JVM
|
||||
// FILE: main.kt
|
||||
// MODULE: platform()()(common1, common2)
|
||||
// FILE: platform.kt
|
||||
|
||||
fun box() = o() + k()
|
||||
@@ -1,4 +1,4 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// IGNORE_BACKEND_K1: JS, JS_IR, JS_IR_ES6
|
||||
// !LANGUAGE: +MultiPlatformProjects
|
||||
// ISSUE: KT-56329
|
||||
|
||||
@@ -15,7 +15,6 @@ expect fun <T> foo(y: T, x: S): String
|
||||
fun ok() = foo(1) + foo(2, "K" as S)
|
||||
|
||||
// MODULE: jvm()()(common)
|
||||
// TARGET_PLATFORM: JVM
|
||||
// FILE: main.kt
|
||||
|
||||
actual typealias S = String
|
||||
|
||||
Reference in New Issue
Block a user