[FIR] Enable BytecodeText tests for FIR.

143 out of 767 tests (18.6%) are currently failing.
This commit is contained in:
Mark Punzalan
2020-09-29 00:25:09 +00:00
committed by Mikhail Glukhikh
parent 69cd729506
commit 238cc7c257
146 changed files with 5146 additions and 1 deletions
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM_IR
// TODO KT-36646 Don't box primitive values in equality comparison with nullable primitive values in JVM_IR
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
// IGNORE_BACKEND: JVM, JVM_IR
// ^ TODO support new mangling rules in optimizer
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
interface A {
fun foo(): Any
}
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
abstract class A1<Q> : MutableCollection<Q> {
override fun contains(o: Q): Boolean {
throw UnsupportedOperationException()
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
abstract class A3<W> : java.util.AbstractList<W>()
abstract class A4<W> : java.util.AbstractList<W>() {
override fun contains(o: W): Boolean {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
abstract class A1 : Collection<String> {
override val size: Int get() = 1
}
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// FILE: JClass.java
public class JClass {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// FILE: JClass.java
public class JClass {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM_IR
// TODO KT-36637 Trivial closure optimizatin in JVM_IR
@@ -1,4 +1,5 @@
// !LANGUAGE: -InlineConstVals
// IGNORE_BACKEND_FIR: JVM_IR
const val z = 0
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
package inlineInIfFalseDex
fun inlineIfFalse() {
@@ -1,4 +1,5 @@
// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND_FIR: JVM_IR
// FILE: uint.kt
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
import kotlin.sequences.*
import kotlin.experimental.*
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM_IR
inline class ICInt(val x: Int) // unbox-impl in generated 'equals'
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM_IR
inline class ICAny(val x: Any)
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM_IR
inline class IC0(val x: Any) // IC0.unbox-impl in generated 'equals'
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM_IR
interface I
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM_IR
inline class ICString(val x: String)
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// This test checks, that different variables occupy the same slot
// In JVM_IR, however, loop variable's lifetime goes beyond the loop itself, thus the test has no sense in JVM_IR
// IGNORE_BACKEND: JVM_IR
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun test() {
1.(fun Int.() = 2)()
}
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
open class SuperFoo {
public fun bar() {
if (this is Foo) {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
val arr = arrayOf("a", "b", "c", "d")
fun box(): String {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
val arr = arrayOf("a", "b", "c", "d")
fun box(): String {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
val arr = intArrayOf()
fun box(): String {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
val arr = intArrayOf(10, 20, 30, 40)
fun box(): String {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
val arr = arrayOf("a", "b", "c", "d")
fun box(): String {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
val cs: CharSequence = "abcd"
fun box(): String {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun box(): String {
for ((index, x) in "".withIndex()) {
return "Loop over empty String should not be executed"
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun box(): String {
val s = StringBuilder()
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
val xs = "abcd"
fun box(): String {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
val xs = "abcd"
fun box(): String {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
val xs = "abcd"
fun useAny(x: Any) {}
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
val xs = listOf<Any>()
fun box(): String {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun <T : Iterable<*>> test(iterable: T): String {
val s = StringBuilder()
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
val xs = listOf("a", "b", "c", "d")
fun box(): String {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
val xs = listOf("a", "b", "c", "d")
fun box(): String {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
val xs = listOf("a", "b", "c", "d")
fun box(): String {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
val xs = listOf("a", "b", "c", "d")
fun useAny(x: Any) {}
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun box(): String {
for ((i, v) in (7 downTo 4).withIndex()) {
}
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun box(): String {
for ((i, v) in listOf(4, 5, 6, 7).indices.withIndex()) {
}
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun box(): String {
for ((i, v) in (4..7).withIndex()) {
}
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun box(): String {
for ((i, v) in ((4..11).reversed() step 2).withIndex()) {
}
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun box(): String {
for ((i, v) in (4..7).reversed().withIndex()) {
}
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun box(): String {
for ((i, v) in (4..11 step 2).reversed().withIndex()) {
}
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun box(): String {
for ((i, v) in (4..11 step 2).withIndex()) {
}
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun box(): String {
for ((i, v) in (4 until 8).withIndex()) {
}
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun box(): String {
for ((_, _) in (4..7).withIndex()) {
}
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun box(): String {
for ((outer, iv) in (4..7).withIndex().withIndex()) {
}
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
val xs = listOf<Any>().asSequence()
fun box(): String {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun <T : Sequence<*>> test(sequence: T): String {
val s = StringBuilder()
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
val xs = listOf("a", "b", "c", "d").asSequence()
fun box(): String {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
val xs = listOf("a", "b", "c", "d").asSequence()
fun box(): String {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
val xs = listOf("a", "b", "c", "d").asSequence()
fun box(): String {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// FULL_JDK
val xsl = arrayListOf("a", "b", "c", "d")
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
val xs = listOf("a", "b", "c", "d").asSequence()
fun useAny(x: Any) {}
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
const val M = Int.MIN_VALUE
fun f(a: Int): Int {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
const val M = Long.MIN_VALUE
fun f(a: Long): Int {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
const val M = UInt.MIN_VALUE
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
const val M = ULong.MIN_VALUE
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
val x: () -> Unit = {}
val y = x.hashCode()
@@ -1,4 +1,5 @@
// !LANGUAGE: +ProperIeee754Comparisons
// IGNORE_BACKEND_FIR: JVM_IR
fun equals5(a: Any?, b: Any?) = if (a is Double && b is Double?) a == b else null!!
fun equals6(a: Any?, b: Any?) = if (a is Double? && b is Double) a == b else null!!
@@ -1,4 +1,5 @@
// !LANGUAGE: +ProperIeee754Comparisons
// IGNORE_BACKEND_FIR: JVM_IR
fun equals5(a: Any?, b: Any?) = if (a is Float && b is Float?) a == b else null!!
fun equals6(a: Any?, b: Any?) = if (a is Float? && b is Float) a == b else null!!
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun main(args: Array<String>) {
var i = 10
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM_IR
fun test() {
{
@@ -1,4 +1,5 @@
// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM_IR
// TODO KT-36783 Consider generating GETFIELD instructions instead of unbox-impl calls in special methods of inline classes in JVM_IR
@@ -1,4 +1,5 @@
// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM_IR
// FILE: utils.kt
@@ -1,4 +1,5 @@
// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM_IR
// TODO KT-36783 Consider generating GETFIELD instructions instead of unbox-impl calls in special methods of inline classes in JVM_IR
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// LANGUAGE: +InlineClasses
import kotlin.reflect.KProperty
@@ -1,4 +1,5 @@
// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND_FIR: JVM_IR
// FILE: Z.kt
inline class Z(val x: Int)
@@ -1,4 +1,5 @@
// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND_FIR: JVM_IR
// FILE: Z.kt
inline class Z(val x: Int)
@@ -1,4 +1,5 @@
// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND_FIR: JVM_IR
// FILE: Z.kt
inline class Z(val value: Int)
@@ -1,4 +1,5 @@
// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND_FIR: JVM_IR
// FILE: Z.kt
inline class Z(val value: Int)
@@ -1,4 +1,5 @@
// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND_FIR: JVM_IR
// FILE: test.kt
fun box(): String {
@@ -1,4 +1,5 @@
// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM
// The JVM backend does not generate the g-impl method, but ends up calling it from box.
@@ -1,4 +1,5 @@
// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND_FIR: JVM_IR
interface A<T> {
fun foo(a: T): String
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
@@ -1,4 +1,5 @@
// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND_FIR: JVM_IR
// FILE: Z.kt
inline class Z(val x: Int)
@@ -1,4 +1,5 @@
// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND_FIR: JVM_IR
// Completely incorrect bytecode - see `box/inlineClasses/toStringOfUnboxedNullable.kt`
// IGNORE_BACKEND: JVM
@@ -1,4 +1,5 @@
// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM_IR
// TODO KT-36783 Consider generating GETFIELD instructions instead of unbox-impl calls in special methods of inline classes in JVM_IR
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// FILE: first/JavaSuperclass.java
package first;
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// FILE: JClass.java
import org.jetbrains.annotations.NotNull;
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// FILE: first/Foo.java
package first;
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
interface A<T> {
fun f(x: T): T
}
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
interface A {
fun foo() = 42
}
@@ -1,4 +1,5 @@
// !LANGUAGE: +ProperIeee754Comparisons
// IGNORE_BACKEND_FIR: JVM_IR
fun equals3(a: Byte?, b: Byte?) = a != null && b != null && a == b
fun equals4(a: Byte?, b: Byte?) = if (a is Byte && b is Byte) a == b else null!!
@@ -1,4 +1,5 @@
// !LANGUAGE: -ProperIeee754Comparisons
// IGNORE_BACKEND_FIR: JVM_IR
fun equals3(a: Byte?, b: Byte?) = a != null && b != null && a == b
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun equals3(a: Char?, b: Char?) = a != null && b != null && a == b
fun equals4(a: Char?, b: Char?) = if (a is Char && b is Char) a == b else null!!
@@ -1,4 +1,5 @@
// !LANGUAGE: +ProperIeee754Comparisons
// IGNORE_BACKEND_FIR: JVM_IR
fun equals3(a: Int?, b: Int?) = a != null && b != null && a == b
fun equals4(a: Int?, b: Int?) = if (a is Int && b is Int) a == b else null!!
@@ -1,4 +1,5 @@
// !LANGUAGE: -ProperIeee754Comparisons
// IGNORE_BACKEND_FIR: JVM_IR
fun equals3(a: Int?, b: Int?) = a != null && b != null && a == b
fun equals4(a: Int?, b: Int?) = if (a is Int && b is Int) a == b else null!!
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun equals3(a: Long?, b: Long?) = a != null && b != null && a == b
fun equals4(a: Long?, b: Long?) = if (a is Long && b is Long) a == b else null!!
@@ -1,4 +1,5 @@
// !LANGUAGE: +ProperIeee754Comparisons
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM_IR
fun equals3(a: Short?, b: Short?) = a != null && b != null && a == b
@@ -1,4 +1,5 @@
// !LANGUAGE: -ProperIeee754Comparisons
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM_IR
fun equals3(a: Short?, b: Short?) = a != null && b != null && a == b
+1
View File
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// FILE: Child.java
class Child extends Parent {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// JVM_TARGET: 1.8
fun box(): String {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun cond() = false
fun bar() {}
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun foo() {
if (0 < 1) {
System.out?.println()
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun foo(): Int {
if (false) {
return 1
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun foo(): Int {
if (false) {
return 1
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun foo(): Int {
if (true) {
return 1
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun foo(): Int {
if (true) {
return 1

Some files were not shown because too many files have changed in this diff Show More