[Test] Convert IGNORE: NATIVE directives in box tests from D to I

^KT-59057

Merge-request: KT-MR-10748
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
This commit is contained in:
Vladimir Sukharev
2023-06-23 09:11:17 +00:00
committed by Space Team
parent 919d6401f7
commit a036e41809
38 changed files with 107 additions and 610 deletions
@@ -1,4 +1,4 @@
// IGNORE_BACKEND: JS, JS_IR, NATIVE, WASM
// IGNORE_BACKEND: JS, JS_IR, WASM
// IGNORE_BACKEND: JS_IR_ES6
// IGNORE_BACKEND_K2: JVM_IR
// WASM_MUTE_REASON: IGNORED_IN_JS
@@ -1,8 +1,6 @@
// IGNORE_BACKEND: WASM
// IGNORE_BACKEND: NATIVE
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// IGNORE_BACKEND: JS
// See the end of KT-8135 description: The same problem appears when using delegating properties with unchecked casts inside
// Test fail reason: ClassCastException is not thrown when using delegating properties with unchecked casts inside
// IGNORE_BACKEND: NATIVE, JS, JS_IR, JS_IR_ES6, WASM
import kotlin.reflect.KProperty
@@ -1,3 +1,5 @@
// See the end of KT-8135 description: The same problem appears when using delegating properties with unchecked casts inside
// Test fail reason: ClassCastException is not thrown when using delegating properties with unchecked casts inside
// IGNORE_BACKEND: WASM
// IGNORE_BACKEND: NATIVE
// IGNORE_BACKEND: JVM_IR
@@ -38,7 +40,7 @@ fun box(): String {
val c = A().B()
(del as Delegate<String?>).inner = null
asFailsWithCCE { c.prop } // does not fail in JVM, JS due KT-8135.
asFailsWithCCE { c.prop } // throws AssertionError due to KT-8135.
return "OK"
}
@@ -1,8 +1,5 @@
// IGNORE_BACKEND: WASM
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// IGNORE_BACKEND: JS
// IGNORE_BACKEND: NATIVE
// TARGET_BACKEND: JVM
// TARGET_BACKEND: JVM_IR
// No kotlin-reflect.jar in this test
// WITH_STDLIB
@@ -1,8 +1,5 @@
// IGNORE_BACKEND: WASM
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
// TARGET_BACKEND: JVM
// TARGET_BACKEND: JVM_IR
// WITH_REFLECT
@@ -1,10 +1,6 @@
// LAMBDAS: CLASS
// IGNORE_BACKEND: WASM
// WASM_MUTE_REASON: IGNORED_IN_JS
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
// TARGET_BACKEND: JVM
// TARGET_BACKEND: JVM_IR
// WITH_REFLECT
@@ -1,10 +1,6 @@
// LAMBDAS: CLASS
// IGNORE_BACKEND: WASM
// WASM_MUTE_REASON: IGNORED_IN_JS
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
// TARGET_BACKEND: JVM
// TARGET_BACKEND: JVM_IR
// WITH_REFLECT
+2 -6
View File
@@ -1,9 +1,5 @@
// IGNORE_BACKEND: WASM
// WASM_MUTE_REASON: IGNORED_IN_JS
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
// TARGET_BACKEND: JVM
// TARGET_BACKEND: JVM_IR
public class RunnableFunctionWrapper(val f : () -> Unit) : Runnable {
public override fun run() {
@@ -1,9 +1,5 @@
// IGNORE_BACKEND: WASM
// WASM_MUTE_REASON: IGNORED_IN_JS
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
// TARGET_BACKEND: JVM
// TARGET_BACKEND: JVM_IR
var result = "Fail"
@@ -1,7 +1,6 @@
// TARGET_BACKEND: JS
// Ignore these backangd because they don't support overriding and calling interface methods with default arguments
// IGNORE_BACKEND: JVM, WASM, NATIVE
// Don't test other backends because they don't support overriding and calling interface methods with default arguments
// MODULE: InterfaceModule
// FILE: MyInterface.kt
@@ -1,6 +1,3 @@
// IGNORE_BACKEND: WASM
// WASM_MUTE_REASON: IGNORED_IN_JS
// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6, NATIVE
// WITH_REFLECT
// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
@@ -16,14 +13,14 @@ fun box(): String {
val b = Z("b")
val equals = Z::equals
assertTrue(equals.call(a, a))
assertFalse(equals.call(a, b))
assertTrue(equals.invoke(a, a))
assertFalse(equals.invoke(a, b))
val hashCode = Z::hashCode
assertEquals(a.s.hashCode(), hashCode.call(a))
assertEquals(a.s.hashCode(), hashCode.invoke(a))
val toString = Z::toString
assertEquals("Z(s=${a.s})", toString.call(a))
assertEquals("Z(s=${a.s})", toString.invoke(a))
return "OK"
}
@@ -1,6 +1,3 @@
// IGNORE_BACKEND: WASM
// WASM_MUTE_REASON: IGNORED_IN_JS
// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6, NATIVE
// WITH_REFLECT
// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
@@ -16,14 +13,14 @@ fun box(): String {
val b = Z("b")
val equals = Z<String>::equals
assertTrue(equals.call(a, a))
assertFalse(equals.call(a, b))
assertTrue(equals.invoke(a, a))
assertFalse(equals.invoke(a, b))
val hashCode = Z<String>::hashCode
assertEquals(a.s.hashCode(), hashCode.call(a))
assertEquals(a.s.hashCode(), hashCode.invoke(a))
val toString = Z<String>::toString
assertEquals("Z(s=${a.s})", toString.call(a))
assertEquals("Z(s=${a.s})", toString.invoke(a))
return "OK"
}
+8 -10
View File
@@ -1,7 +1,3 @@
// IGNORE_BACKEND: WASM
// WASM_MUTE_REASON: IGNORED_IN_JS
// IGNORE_BACKEND: JS, JS_IR, NATIVE
// IGNORE_BACKEND: JS_IR_ES6
// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses
@@ -11,14 +7,16 @@ class CharacterLiteral(private val prefix: NamelessString, private val s: Namele
}
OPTIONAL_JVM_INLINE_ANNOTATION
value class NamelessString(val b: ByteArray) {
override fun toString(): String = String(b)
value class NamelessString(val b: CharArray) {
override fun toString(): String = b.concatToString()
}
fun box(): String {
val ns1 = NamelessString("abc".toByteArray())
val ns2 = NamelessString("def".toByteArray())
val abcCharArray = "abc".toCharArray()
if (abcCharArray.toString() == "abc") return "Prerequisite failed: value of abcCharArray.toString() is intended to be not equal to 'abc'"
val ns1 = NamelessString(abcCharArray)
val ns2 = NamelessString("def".toCharArray())
val cl = CharacterLiteral(ns1, ns2)
if (cl.toString() != "abc'def'") return throw AssertionError(cl.toString())
if (cl.toString() != "abc'def'") return cl.toString()
return "OK"
}
}
@@ -1,8 +1,8 @@
// WITH_STDLIB
// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6, WASM, NATIVE
// TODO: Fir2Ir generates overrides as finals.
// WORKS_WHEN_VALUE_CLASS
@JvmInline
OPTIONAL_JVM_INLINE_ANNOTATION
value class Inlined(val value: Int)
sealed interface A {
+15 -1
View File
@@ -1,6 +1,20 @@
// In this test, stdlib class `public value class Result<out T>` within `kotlin` package is replaced with a custom non-generic class
// NATIVE exception: java.util.NoSuchElementException: Collection contains no element matching the predicate
// during `KonanSymbols.kotlinResultGetOrThrow`, since function `Result<T>.getOrThrow()` within `kotlin` package cannot be found during builtins construction,
// since unbound class `Result` is expected, but deserialized one found.
// DONT_TARGET_EXACT_BACKEND: NATIVE
// WASM exception:
// There are still 4 unbound symbols after generation of IR module <main>:
// Unbound public symbol IrClassPublicSymbolImpl: kotlin/Result.Companion|null[0]
// Unbound public symbol IrClassPublicSymbolImpl: kotlin/Result.Failure|null[0]
// Unbound public symbol IrSimpleFunctionPublicSymbolImpl: kotlin/Result.Companion.success|8035950532576827725[0]
// Unbound public symbol IrSimpleFunctionPublicSymbolImpl: kotlin/Result.Failure.exception.<get-exception>|-7777496992132965566[0]
// This could happen if there are two libraries, where one library was compiled against the different version of the other library than the one currently used in the project. Please check that the project configuration is correct and has consistent versions of dependencies.
// IGNORE_BACKEND: WASM
// IGNORE_BACKEND: ANDROID
// IGNORE_BACKEND: NATIVE
// ALLOW_KOTLIN_PACKAGE
// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
@@ -1,6 +1,9 @@
// NATIVE and WASM failure reasons see in `result.kt`
// JS_IR error: <main> @ /box.kt:24:12: Constructor 'Result.<init>' can not be called: No constructor found for symbol 'kotlin/Result.<init>|-8731461708390519279[0]'
// DONT_TARGET_EXACT_BACKEND: NATIVE
// IGNORE_BACKEND: WASM, JS_IR, JS_IR_ES6
// IGNORE_BACKEND: ANDROID
// IGNORE_BACKEND: NATIVE
// ALLOW_KOTLIN_PACKAGE
// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
@@ -1,6 +1,8 @@
// NATIVE, WASM, JS_IR errors are same as for `resultGeneric.kt`
// DONT_TARGET_EXACT_BACKEND: NATIVE
// IGNORE_BACKEND: WASM, JS_IR, JS_IR_ES6
// IGNORE_BACKEND: ANDROID
// IGNORE_BACKEND: NATIVE
// ALLOW_KOTLIN_PACKAGE
// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
@@ -1,7 +1,5 @@
// IGNORE_BACKEND: WASM
// WASM_MUTE_REASON: IGNORED_IN_JS
// IGNORE_BACKEND: JS, JS_IR, NATIVE, JVM
// IGNORE_BACKEND: JS_IR_ES6
// JVM runtime exception: java.lang.ClassCastException: kotlin.Unit cannot be cast to Foo
// IGNORE_BACKEND: JVM
// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses, +ValueClassesSecondaryConstructorWithBody
@@ -9,7 +7,7 @@
OPTIONAL_JVM_INLINE_ANNOTATION
value class Foo(val x: String) {
constructor(y: Int) : this("OK") {
if (y == 0) return throw java.lang.IllegalArgumentException()
if (y == 0) throw IllegalArgumentException()
if (y == 1) return
return Unit
}
@@ -1,7 +1,6 @@
// IGNORE_BACKEND: WASM
// WASM_MUTE_REASON: IGNORED_IN_JS
// IGNORE_BACKEND: JS, JS_IR, NATIVE, JVM
// IGNORE_BACKEND: JS_IR_ES6
// JVM backend throws runtime exception: java.lang.ClassCastException: kotlin.Unit cannot be cast to Foo
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses, +GenericInlineClassParameter, +ValueClassesSecondaryConstructorWithBody
@@ -9,7 +8,7 @@
OPTIONAL_JVM_INLINE_ANNOTATION
value class Foo<T: String>(val x: T) {
constructor(y: Int) : this("OK" as T) {
if (y == 0) return throw java.lang.IllegalArgumentException()
if (y == 0) throw IllegalArgumentException()
if (y == 1) return
return Unit
}
+2 -6
View File
@@ -1,9 +1,5 @@
// IGNORE_BACKEND: WASM
// WASM_MUTE_REASON: IGNORED_IN_JS
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
// TARGET_BACKEND: JVM
// TARGET_BACKEND: JVM_IR
fun box(): String {
val s: String? = "OK"
@@ -1,9 +1,5 @@
// IGNORE_BACKEND: WASM
// WASM_MUTE_REASON: IGNORED_IN_JS
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
// TARGET_BACKEND: JVM
// TARGET_BACKEND: JVM_IR
import kotlin.reflect.KFunction2
import kotlin.reflect.KFunction1
@@ -1,11 +1,14 @@
// https://youtrack.jetbrains.com/issue/KT-42020/Psi2ir-IllegalStateException-IrSimpleFunctionPublicSymbolImpl-for-public-...-is-already-bound-on-generic-function-whose
// IGNORE_BACKEND: WASM
// WASM_MUTE_REASON: SERIALIZATION_REGRESSION
// IGNORE_BACKEND: JS
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// IGNORE_BACKEND: NATIVE
// IGNORE_BACKEND_K2: JVM_IR
// IGNORE_BACKEND_K1: NATIVE, JS_IR
// https://youtrack.jetbrains.com/issue/KT-59279/Psi2Ir-FIR2IR-Signature-clash-leads-to-wrong-method-resolve
// IGNORE_BACKEND: JS
// IGNORE_BACKEND_K2: NATIVE, JS_IR
// FIR status: validation failed. TODO decide if we want to fix KT-42020 for FIR as well
// IGNORE_BACKEND_K2: JVM_IR
// MODULE: lib
// FILE: lib.kt
@@ -22,8 +25,10 @@ class Derived : Base<String>()
fun box(): String {
val d = Derived()
if (d.foo(p1 = "42") != "p1:42") return "FAIL1"
if (d.foo(p2 = "24") != "p2:24") return "FAIL2"
val foo42 = d.foo(p1 = "42")
if (foo42 != "p1:42") return "FAIL1: foo42=$foo42"
val foo24 = d.foo(p2 = "24")
if (foo24 != "p2:24") return "FAIL2: foo24=$foo24"
return "OK"
}
@@ -1,11 +1,13 @@
// IGNORE_BACKEND: WASM
// WASM_MUTE_REASON: SERIALIZATION_REGRESSION
// WASM_MUTE_REASON: SERIALIZATION_REGRESSION: Conflicting overloads: public fun foo(): String defined in pkg in file lib1.kt, public fun foo(): String defined in pkg in file main.kt (6,1)
// EXPECTED_REACHABLE_NODES: 1304
// JS_IR error: Cross module dependency resolution failed due to signature 'pkg/foo|-1041209573719867811[0]' redefinition
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// IGNORE_BACKEND: NATIVE
// IGNORE_BACKEND: ANDROID
// IGNORE_LIGHT_ANALYSIS
// NATIVE error caused by `foo()` clash: kotlin.AssertionError: Test failed with: 42K. Expected <OK>, actual <42K>.
// DONT_TARGET_EXACT_BACKEND: NATIVE
// MODULE: lib1
// FILE: lib1.kt
package pkg