Tests: unmute light analysis tests passing with JVM_IR

This commit is contained in:
Alexander Udalov
2023-06-12 16:47:50 +02:00
parent cab53361f3
commit 1588b07472
61 changed files with 27 additions and 88 deletions
@@ -1,11 +1,11 @@
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// TARGET_BACKEND: JVM
// EMIT_JVM_TYPE_ANNOTATIONS
// !LANGUAGE: +ClassTypeParameterAnnotations
// JVM_TARGET: 1.8
// WITH_REFLECT
// FULL_JDK
package foo
import java.lang.reflect.AnnotatedType
@@ -1,10 +1,10 @@
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// TARGET_BACKEND: JVM
// EMIT_JVM_TYPE_ANNOTATIONS
// JVM_TARGET: 1.8
// WITH_REFLECT
// FULL_JDK
package foo
import java.lang.reflect.AnnotatedType
@@ -1,5 +1,4 @@
// TARGET_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// WITH_STDLIB
// LAMBDAS: CLASS
+1 -2
View File
@@ -1,6 +1,5 @@
// WITH_STDLIB
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// JVM_TARGET: 1.8
// ^ This test causes SIGSEGV on JDK 1.6 with old back-end.
@@ -16,4 +15,4 @@ fun box(): String {
if (test2 != 3) throw Exception("with(ints, IntArray::size) != 3: $test2")
return "OK"
}
}
@@ -1,5 +1,4 @@
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// JVM_IR it this case has an approximated type 'KFun<out Any>', which has a projected top-level argument.
@@ -1,5 +1,4 @@
// TARGET_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// WITH_STDLIB
// WITH_COROUTINES
@@ -1,7 +1,6 @@
// WITH_STDLIB
// WITH_COROUTINES
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// LANGUAGE: +SuspendFunctionsInFunInterfaces, +JvmIrEnabledByDefault
// SKIP_DCE_DRIVEN
@@ -25,4 +24,4 @@ fun box(): String {
}
}
return res
}
}
@@ -1,6 +1,5 @@
// WITH_STDLIB
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// FILE: 1.kt
@file:OptIn(ExperimentalTypeInference::class)
@@ -1,7 +1,6 @@
// WITH_STDLIB
// !JVM_DEFAULT_MODE: all-compatibility
// TARGET_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// IGNORE_BACKEND: JVM
// JVM_TARGET: 1.8
@@ -27,4 +26,4 @@ fun box(): String {
res = A().nextBuffer()
}
return res
}
}
@@ -1,6 +1,5 @@
// WITH_STDLIB
// WITH_COROUTINES
// IGNORE_LIGHT_ANALYSIS
// !INHERIT_MULTIFILE_PARTS
// TARGET_BACKEND: JVM
-1
View File
@@ -1,7 +1,6 @@
// WITH_STDLIB
// WITH_COROUTINES
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
import helpers.*
import kotlin.coroutines.*
@@ -3,7 +3,6 @@
// WITH_COROUTINES
// IGNORE_BACKEND: JVM, JS, JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// IGNORE_LIGHT_ANALYSIS
import helpers.*
import kotlin.coroutines.*
@@ -36,4 +35,4 @@ fun box(): String {
if (test != "OKEmptyOK42") return "failed: $test"
return "OK"
}
}
@@ -2,7 +2,6 @@
// WITH_STDLIB
// WITH_COROUTINES
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
import helpers.*
import kotlin.coroutines.*
@@ -22,4 +21,4 @@ fun box(): String {
test = runS(lambda)
}
return test
}
}
@@ -2,7 +2,6 @@
// WITH_STDLIB
// WITH_COROUTINES
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// IGNORE_INLINER: IR
// `lambda` should not be wrapped in yet another object (so no OnInlineArgumentKt$box$1$1).
@@ -20,4 +19,4 @@ fun box(): String {
val lambda: (String) -> String = { it + "K" }
suspend { test = runS(lambda) }.startCoroutine(EmptyContinuation)
return test
}
}
@@ -3,7 +3,6 @@
// WITH_COROUTINES
// IGNORE_BACKEND: JVM, JS, JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// IGNORE_LIGHT_ANALYSIS
import helpers.*
import kotlin.coroutines.*
@@ -45,4 +44,4 @@ fun box(): String {
}
return test
}
}
@@ -1,5 +1,4 @@
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
object D {
operator fun getValue(a: Any?, b: Any?): String = "OK"
@@ -11,4 +10,4 @@ enum class A {
val b = a
}
fun box() = A.GOO.b
fun box() = A.GOO.b
@@ -4,9 +4,6 @@
// IGNORE_BACKEND: JVM
// IGNORE_FIR_DIAGNOSTICS_DIFF
// Light analysis thinks this test passes but it doesn't because JVM backend does not compile this into a tailrec function.
// IGNORE_LIGHT_ANALYSIS
class C {
companion object {
<!NO_TAIL_CALLS_FOUND!>tailrec<!> fun rec(i: Int) {
-1
View File
@@ -1,6 +1,5 @@
// !LANGUAGE: +EnumEntries
// IGNORE_BACKEND: JS, JVM
// IGNORE_LIGHT_ANALYSIS
// FULL_JDK
// WITH_STDLIB
@@ -1,6 +1,5 @@
// !LANGUAGE: +EnumEntries
// IGNORE_BACKEND: JS, JVM
// IGNORE_LIGHT_ANALYSIS
// FULL_JDK
// WITH_STDLIB
@@ -1,5 +1,4 @@
// TARGET_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// WITH_STDLIB
// JVM_TARGET: 1.8
// IGNORE_BACKEND: ANDROID
@@ -1,5 +1,4 @@
// WITH_STDLIB
// IGNORE_LIGHT_ANALYSIS
// IGNORE_BACKEND: JVM
// LANGUAGE: +InlineClassImplementationByDelegation
@@ -16,4 +15,4 @@ fun box(): String {
val ic: I = IC(i)
res = ic.ok()
return res
}
}
@@ -1,5 +1,4 @@
// WITH_STDLIB
// IGNORE_LIGHT_ANALYSIS
// IGNORE_BACKEND: JVM
// LANGUAGE: +InlineClassImplementationByDelegation
@@ -24,4 +23,4 @@ fun box(): String {
if (res != "OKK") return "FAIL 4: $res"
return "OK"
}
}
@@ -1,5 +1,4 @@
// WITH_STDLIB
// IGNORE_LIGHT_ANALYSIS
// IGNORE_BACKEND: JVM
// LANGUAGE: +InlineClassImplementationByDelegation, +GenericInlineClassParameter
@@ -24,4 +23,4 @@ fun box(): String {
if (res != "OKK") return "FAIL 4: $res"
return "OK"
}
}
@@ -1,5 +1,4 @@
// WITH_STDLIB
// IGNORE_LIGHT_ANALYSIS
// IGNORE_BACKEND: JVM
// LANGUAGE: +InlineClassImplementationByDelegation, +GenericInlineClassParameter
@@ -16,4 +15,4 @@ fun box(): String {
val ic: I = IC(i)
res = ic.ok()
return res
}
}
@@ -1,5 +1,4 @@
// WITH_STDLIB
// IGNORE_LIGHT_ANALYSIS
// IGNORE_BACKEND: JVM
// LANGUAGE: +InlineClassImplementationByDelegation
@@ -18,4 +17,4 @@ fun box(): String {
val ic: I = IC(i)
res = ic.ok()
return res
}
}
@@ -1,5 +1,4 @@
// WITH_STDLIB
// IGNORE_LIGHT_ANALYSIS
// IGNORE_BACKEND: JVM
// LANGUAGE: +InlineClassImplementationByDelegation, +GenericInlineClassParameter
@@ -18,4 +17,4 @@ fun box(): String {
val ic: I = IC(i)
res = ic.ok()
return res
}
}
@@ -1,5 +1,4 @@
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
fun box(): String =
testBug(null)
+1 -2
View File
@@ -1,6 +1,5 @@
// WITH_STDLIB
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses
@@ -54,4 +53,4 @@ fun box(): String {
ex2(Result.success(2))
ex3(Result.success(3))
return if (result == "Ex 1\nEx 2\nEx 3\n") "OK" else "FAIL $result"
}
}
@@ -1,6 +1,5 @@
// WITH_STDLIB
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses
@@ -1,6 +1,5 @@
// WITH_STDLIB
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses, +GenericInlineClassParameter
@@ -1,6 +1,5 @@
// WITH_STDLIB
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
fun <T> foo(a: Result<T>?): T? = bar(a, object : IFace<Result<T>, T> {
override fun call(ic: Result<T>?): T? = ic?.getOrThrow()
@@ -20,4 +19,4 @@ fun box(): String {
res = foo<Int>(null)
if (res != null) return "FAIL $res"
return "OK"
}
}
@@ -1,6 +1,5 @@
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// JVM_TARGET: 1.8
// LAMBDAS: INDY
@@ -1,5 +1,4 @@
// TARGET_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// IGNORE_BACKEND: JVM
// JVM_TARGET: 1.8
// SAM_CONVERSIONS: INDY
@@ -1,5 +1,4 @@
// TARGET_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// IGNORE_BACKEND: JVM
// JVM_TARGET: 1.8
// SAM_CONVERSIONS: INDY
@@ -1,6 +1,5 @@
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// JVM_TARGET: 1.8
// SAM_CONVERSIONS: INDY
@@ -22,4 +21,4 @@ fun box(): String {
if (t.value != 42) return "Failed: t=$t"
return "OK"
}
}
@@ -1,6 +1,5 @@
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// JVM_TARGET: 1.8
// SAM_CONVERSIONS: INDY
@@ -22,4 +21,4 @@ fun box(): String {
if (t.value != 42) return "Failed: t=$t"
return "OK"
}
}
@@ -1,6 +1,5 @@
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// JVM_TARGET: 1.8
// SAM_CONVERSIONS: INDY
@@ -22,4 +21,4 @@ fun box(): String {
if (t.value != 42) return "Failed: t=$t"
return "OK"
}
}
@@ -1,6 +1,5 @@
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// JVM_TARGET: 1.8
// SAM_CONVERSIONS: INDY
@@ -22,4 +21,4 @@ fun box(): String {
if (t.value != 42) return "Failed: t=$t"
return "OK"
}
}
@@ -1,6 +1,5 @@
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// JVM_TARGET: 1.8
// SAM_CONVERSIONS: INDY
@@ -22,4 +21,4 @@ fun box(): String {
if (t.value != "OK") return "Failed: t=$t"
return "OK"
}
}
@@ -1,6 +1,5 @@
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// JVM_TARGET: 1.8
// SAM_CONVERSIONS: INDY
@@ -22,4 +21,4 @@ fun box(): String {
if (t.value != "OK") return "Failed: t=$t"
return "OK"
}
}
@@ -1,6 +1,5 @@
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// JVM_TARGET: 1.8
// SAM_CONVERSIONS: INDY
@@ -35,4 +34,3 @@ fun box(): String {
return "OK"
}
@@ -1,7 +1,6 @@
// !LANGUAGE: +SuspendFunctionsInFunInterfaces +JvmIrEnabledByDefault
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// JVM_TARGET: 1.8
// SAM_CONVERSIONS: INDY
// WITH_STDLIB
@@ -1,8 +1,8 @@
// !JVM_DEFAULT_MODE: all
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// JVM_TARGET: 1.8
// FILE: Kotlin.kt
interface Foo<T> {
fun foo(p: T): T = p
@@ -1,6 +1,5 @@
// TARGET_BACKEND: JVM
// WITH_STDLIB
// IGNORE_LIGHT_ANALYSIS
// !INHERIT_MULTIFILE_PARTS
// FILE: anonymousObject.kt
@@ -1,5 +1,4 @@
// TARGET_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// WITH_STDLIB
// !INHERIT_MULTIFILE_PARTS
// FILE: result.kt
@@ -1,5 +1,4 @@
// TARGET_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// WITH_STDLIB
// !INHERIT_MULTIFILE_PARTS
// FILE: box.kt
@@ -1,5 +1,4 @@
// TARGET_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// WITH_STDLIB
// !INHERIT_MULTIFILE_PARTS
// FILE: box.kt
@@ -1,5 +1,4 @@
// TARGET_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// WITH_STDLIB
// !INHERIT_MULTIFILE_PARTS
// FILE: box.kt
@@ -1,5 +1,4 @@
// TARGET_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// WITH_STDLIB
// !INHERIT_MULTIFILE_PARTS
// FILE: box.kt
@@ -1,5 +1,4 @@
// TARGET_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// WITH_STDLIB
// !INHERIT_MULTIFILE_PARTS
// FILE: box.kt
@@ -1,5 +1,4 @@
// TARGET_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// WITH_STDLIB
// !INHERIT_MULTIFILE_PARTS
// FILE: Baz.java
@@ -1,5 +1,4 @@
// TARGET_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// WITH_STDLIB
// !INHERIT_MULTIFILE_PARTS
@@ -1,6 +1,5 @@
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: ANDROID
// IGNORE_LIGHT_ANALYSIS
// WITH_STDLIB
// !INHERIT_MULTIFILE_PARTS
// FILE: ccc.kt
@@ -1,5 +1,4 @@
// TARGET_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// WITH_STDLIB
// !INHERIT_MULTIFILE_PARTS
// FILE: box.kt
@@ -1,7 +1,6 @@
// !LANGUAGE: +StrictJavaNullabilityAssertions +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated +DefinitelyNonNullableTypes
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// FILE: box.kt
fun box(): String {
@@ -1,5 +1,4 @@
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// WITH_STDLIB
fun box(): String {
@@ -1,6 +1,5 @@
// IGNORE_BACKEND: JVM
// See KT-38833: Runtime exception is "java.lang.ClassCastException: java.lang.Integer cannot be cast to kotlin.UInt"
// IGNORE_LIGHT_ANALYSIS
// WITH_STDLIB
fun box(): String {
@@ -1,6 +1,5 @@
// IGNORE_BACKEND: JVM
// See KT-38833: Runtime exception is "java.lang.ClassCastException: java.lang.Integer cannot be cast to kotlin.UInt"
// IGNORE_LIGHT_ANALYSIS
// WITH_STDLIB
fun box(): String {
@@ -1,6 +1,5 @@
// IGNORE_BACKEND: JVM
// See KT-38833: Runtime exception is "java.lang.ClassCastException: java.lang.Integer cannot be cast to kotlin.UInt"
// IGNORE_LIGHT_ANALYSIS
// WITH_STDLIB
fun box(): String {
@@ -1,6 +1,5 @@
// TARGET_BACKEND: JVM
// WITH_STDLIB
// IGNORE_LIGHT_ANALYSIS
// IGNORE_BACKEND: JVM
// FILE: test.kt
@@ -27,4 +26,4 @@ import c1.*
class C2 : C1() {
fun b() = { test("OK") }
}
}
@@ -1,6 +1,5 @@
// TARGET_BACKEND: JVM
// WITH_STDLIB
// IGNORE_LIGHT_ANALYSIS
// FILE: SingletonCollection.kt
package test
@@ -66,4 +65,4 @@ fun box(): String {
if (test6[0] != 42) return "Failed #6"
return "OK"
}
}