FIR: Unignore all blackbox tests on context receivers

This commit is contained in:
Denis.Zharkov
2022-03-17 13:28:35 +03:00
committed by teamcity
parent 41bc842b9d
commit 2a6700e5d5
30 changed files with 22 additions and 84 deletions
+1 -3
View File
@@ -1,7 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: context receivers aren't yet supported
class EntityContext { class EntityContext {
var d = DoubleArray(16) var d = DoubleArray(16)
@@ -21,4 +19,4 @@ fun box(): String {
eDouble.value = .2 eDouble.value = .2
return if (eDouble.value == .2) "OK" else "fail" return if (eDouble.value == .2) "OK" else "fail"
} }
} }
+1 -3
View File
@@ -1,7 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: context receivers aren't yet supported
class A { class A {
val ok = "OK" val ok = "OK"
@@ -14,4 +12,4 @@ class B {
fun box() = with(A()) { fun box() = with(A()) {
B().result() B().result()
} }
@@ -1,7 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: context receivers aren't yet supported
data class MyContainer(var i: Int) data class MyContainer(var i: Int)
@@ -1,7 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: context receivers aren't yet supported
data class MyContainer(var s: String) data class MyContainer(var s: String)
@@ -22,4 +20,4 @@ fun box(): String {
myContainer[0] = "OK" myContainer[0] = "OK"
myContainer[0] ?: "fail" myContainer[0] ?: "fail"
} }
} }
@@ -1,7 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: context receivers aren't yet supported
data class Result(var i: Int) data class Result(var i: Int)
@@ -1,7 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: context receivers aren't yet supported
fun withContext(f: context(String) () -> String) = f("OK") fun withContext(f: context(String) () -> String) = f("OK")
@@ -1,8 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: context receivers aren't yet supported
// KT-51271 // KT-51271
class Context { class Context {
@@ -36,4 +33,4 @@ fun box(): String = with(Context()) {
result += 1.testInlineWithExtensionAndMultipleContextsAndArgs() result += 1.testInlineWithExtensionAndMultipleContextsAndArgs()
} }
return if (result == 23) "OK" else "fail" return if (result == 23) "OK" else "fail"
} }
@@ -1,7 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: context receivers aren't yet supported
// WITH_STDLIB // WITH_STDLIB
import kotlin.reflect.KProperty import kotlin.reflect.KProperty
@@ -34,4 +32,4 @@ fun box(): String {
result.s = "OK" result.s = "OK"
val returnValue = result.s val returnValue = result.s
return if (operationScore == 2) returnValue else "fail" return if (operationScore == 2) returnValue else "fail"
} }
@@ -1,7 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: context receivers aren't yet supported
interface Canvas { interface Canvas {
val suffix: String val suffix: String
@@ -21,4 +19,4 @@ object MyCanvas : Canvas {
override val suffix = "" override val suffix = ""
} }
fun box() = with(MyCanvas) { Circle().draw() } fun box() = with(MyCanvas) { Circle().draw() }
@@ -1,7 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: context receivers aren't yet supported
data class Pair<A, B>(val first: A, val second: B) data class Pair<A, B>(val first: A, val second: B)
@@ -18,4 +16,4 @@ fun box(): String {
return with(comparator) { return with(comparator) {
Pair("OK", "fail").min Pair("OK", "fail").min
} }
} }
@@ -1,7 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: context receivers aren't yet supported
// WITH_STDLIB // WITH_STDLIB
fun List<Int>.decimateEveryEvenThird() = sequence { fun List<Int>.decimateEveryEvenThird() = sequence {
@@ -16,4 +14,4 @@ fun List<Int>.decimateEveryEvenThird() = sequence {
fun box() = with(listOf(0, 1, 2).decimateEveryEvenThird()) { fun box() = with(listOf(0, 1, 2).decimateEveryEvenThird()) {
if (toList() == listOf(2)) "OK" else "fail" if (toList() == listOf(2)) "OK" else "fail"
} }
@@ -1,7 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: context receivers aren't yet supported
// WITH_STDLIB // WITH_STDLIB
class View { class View {
@@ -17,4 +15,4 @@ fun box(): String {
} }
return "fail" return "fail"
} }
} }
@@ -1,7 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: context receivers aren't yet supported
class Param class Param
class O { class O {
@@ -16,4 +14,4 @@ fun <T> K.f(g: context(O) K.(Param) -> T) = g(this@O, this@K, Param())
fun box() = with(O()) { fun box() = with(O()) {
K().f { o + k } K().f { o + k }
} }
@@ -1,7 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: context receivers aren't yet supported
// WITH_STDLIB // WITH_STDLIB
interface Semigroup<T> { interface Semigroup<T> {
@@ -30,4 +28,4 @@ fun box(): String {
return with(StringMonoid) { return with(StringMonoid) {
listOf("O", "K").sum() listOf("O", "K").sum()
} }
} }
@@ -1,7 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: context receivers aren't yet supported
// WITH_STDLIB // WITH_STDLIB
// WITH_COROUTINES // WITH_COROUTINES
@@ -39,4 +37,4 @@ fun box(): String {
return with(MyCoroutineScope) { return with(MyCoroutineScope) {
simpleFlow().launchFlow() simpleFlow().launchFlow()
} }
} }
@@ -1,7 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: context receivers aren't yet supported
class Result<T>(val x: T) class Result<T>(val x: T)
@@ -18,4 +16,4 @@ fun box(): String {
with(Result<String>("OK")) { with(Result<String>("OK")) {
return x() return x()
} }
} }
@@ -1,7 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: context receivers aren't yet supported
// WITH_STDLIB // WITH_STDLIB
data class Counter(var i: Int = 0) data class Counter(var i: Int = 0)
@@ -26,4 +24,4 @@ fun box(): String {
} }
} }
return if (result == 45) "OK" else "fail" return if (result == 45) "OK" else "fail"
} }
@@ -1,7 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: context receivers aren't yet supported
context(String, Int) context(String, Int)
fun overloaded(value: Any?) = "OK" fun overloaded(value: Any?) = "OK"
@@ -13,4 +11,4 @@ fun box() = with("42") {
with(42) { with(42) {
overloaded(null) overloaded(null)
} }
} }
@@ -1,7 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: context receivers aren't yet supported
context(Int, String) context(Int, String)
fun foo(): String = "O" fun foo(): String = "O"
@@ -19,4 +17,4 @@ fun box(): String {
foo() foo()
} }
return o + k return o + k
} }
@@ -1,7 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: context receivers aren't yet supported
class C { class C {
val result = "OK" val result = "OK"
@@ -9,4 +7,4 @@ class C {
fun contextual(f: context(C) () -> String) = f(C()) fun contextual(f: context(C) () -> String) = f(C())
fun box(): String = contextual { result } fun box(): String = contextual { result }
@@ -1,7 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: context receivers aren't yet supported
// WITH_STDLIB // WITH_STDLIB
@file:Suppress("RESERVED_VAR_PROPERTY_OF_VALUE_CLASS") @file:Suppress("RESERVED_VAR_PROPERTY_OF_VALUE_CLASS")
@@ -71,4 +69,4 @@ fun box(): String = with(EntityContext()) {
v1.z = 4.0 v1.z = 4.0
v1 += v0 v1 += v0
if (v1.x == 3.0 && v1.y == 2.0 && v1.z == 7.0) "OK" else "fail" if (v1.x == 3.0 && v1.y == 2.0 && v1.z == 7.0) "OK" else "fail"
} }
@@ -1,7 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: context receivers aren't yet supported
// WITH_STDLIB // WITH_STDLIB
interface NumberOperations { interface NumberOperations {
@@ -50,4 +48,4 @@ fun box(): String {
with(DoubleOperations) { with(DoubleOperations) {
return if (m1 + m2 == matrixOf(2, 2, 1.4, 2.3, 3.2, 4.1)) "OK" else "fail" return if (m1 + m2 == matrixOf(2, 2, 1.4, 2.3, 3.2, 4.1)) "OK" else "fail"
} }
} }
@@ -1,7 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: context receivers aren't yet supported
class LoggingCounter { class LoggingCounter {
var operationCounter = 0 var operationCounter = 0
@@ -31,4 +29,4 @@ fun box(): String {
} }
val operationsTotal = loggingCounter.operationCounter val operationsTotal = loggingCounter.operationCounter
return if (operationsTotal == 5) "OK" else "$operationsTotal" return if (operationsTotal == 5) "OK" else "$operationsTotal"
} }
@@ -1,7 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: context receivers aren't yet supported
class A { class A {
val o = "O" val o = "O"
@@ -20,4 +18,4 @@ fun B.g(a: A): String {
fun box(): String { fun box(): String {
return B().g(A()) return B().g(A())
} }
@@ -1,9 +1,7 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_COROUTINES // WITH_COROUTINES
// WITH_STDLIB // WITH_STDLIB
// FIR status: context receivers aren't yet supported
import helpers.* import helpers.*
import kotlin.coroutines.* import kotlin.coroutines.*
@@ -36,4 +34,4 @@ fun box(): String {
} }
return result return result
} }
@@ -1,7 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: context receivers aren't yet supported
class A<T>(val a: T) class A<T>(val a: T)
class B(val b: Any?) class B(val b: Any?)
@@ -1,7 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: context receivers aren't yet supported
data class Result(val i: Int) data class Result(val i: Int)
@@ -1,7 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: context receivers aren't yet supported
// MODULE: lib // MODULE: lib
// FILE: A.kt // FILE: A.kt
@@ -1,7 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: context receivers aren't yet supported
// WITH_STDLIB // WITH_STDLIB
// WITH_COROUTINES // WITH_COROUTINES
@@ -1,8 +1,5 @@
// !LANGUAGE: +ContextReceivers // !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: context receivers aren't yet supported
// MODULE: lib // MODULE: lib
// FILE: A.kt // FILE: A.kt