Enable bytecode text tests for the JVM_IR backend.

This commit is contained in:
Mads Ager
2018-12-21 13:22:56 +01:00
committed by Mikhael Bogdanov
parent d1efac617d
commit 3a11322506
347 changed files with 3651 additions and 0 deletions
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
package b
abstract class B {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
class A {
fun test(x: String?, a: String?, b: String?){}
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
class A {
fun test(x: String? = "x", a: String?, b: String?, y: String? = "y") {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
class A {
fun test(x: String? = "x", a: String?, b: String?, y: String? = "y") {
}
@@ -1,4 +1,5 @@
// !LANGUAGE: +ReleaseCoroutines
// IGNORE_BACKEND: JVM_IR
inline fun inlineMe(crossinline c: suspend () -> Int): suspend () -> Int {
val i: suspend () -> Int = { c() + c() }
@@ -1,4 +1,5 @@
// !LANGUAGE: +ReleaseCoroutines
// IGNORE_BACKEND: JVM_IR
inline suspend fun inlineMe() = 1000
@@ -1,4 +1,5 @@
// !LANGUAGE: +ReleaseCoroutines
// IGNORE_BACKEND: JVM_IR
suspend fun produce(): Int = 1000
@@ -1,4 +1,5 @@
// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND: JVM_IR
// https://youtrack.jetbrains.com/issue/KT-15871
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
inline fun <R, T> foo(x : R?, block : (R?) -> T) : T {
return block(x)
@@ -1,4 +1,5 @@
// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND: JVM_IR
// FILE: Test.kt
@@ -1,4 +1,5 @@
// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND: JVM_IR
// FILE: dependency.kt
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
import kotlin.reflect.KClass
@Retention(AnnotationRetention.RUNTIME)
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
import kotlin.reflect.KClass
@Retention(AnnotationRetention.RUNTIME)
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
fun box(): String {
230?.hashCode()
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// FILE: list.kt
val intList = listOf(1, 2, 3)
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
inline fun <R, T> foo(x : R?, y : R?, block : (R?) -> T) : T {
if (x == null) {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
fun Long.id() = this
fun String.drop2() = if (length >= 2) subSequence(2, length) else null
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
class A(val x : Int, val y : A?)
fun check(a : A?) : Int {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
fun box(): String {
var result = 0
if (1 == 1) {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
fun returningBoxed() : Int? = 1
fun acceptingBoxed(x : Int?) : Int ? = x
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
interface A {
fun foo(): Any
}
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
abstract class A1<Q> : MutableCollection<Q> {
override fun contains(o: Q): Boolean {
throw UnsupportedOperationException()
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
abstract class A8 : MutableCollection<Any> {
override fun contains(o: Any): Boolean {
throw UnsupportedOperationException()
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
abstract class A<T : Any> : MutableCollection<T> {
override fun contains(o: T): Boolean {
throw UnsupportedOperationException()
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
abstract class A1<T> : MutableList<T> {
override fun remove(x: T): Boolean = true
override fun removeAt(index: Int): T = null!!
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
fun box(): String {
return if (call(10, ::calc) == 5) "OK" else "fail"
}
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
fun test() {
var x = 0
run {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
fun test() {
var x = 0
run { ++x }
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
fun runNoInline(f: () -> Unit) = f()
fun test() {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
fun box(): String {
var xl = 0L // Long, size 2
var xi = 0 // Int, size 1
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
fun box(): String {
run {
run {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
fun add(x: Int, y: Int) = x + y
fun test() {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// KT-15411 Unnecessary CHECKCAST bytecode when dealing with null
fun test1(): String? {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
inline fun inlineFunVoid(f: () -> Unit): Unit {
return f()
}
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
fun test() {
val a = inlineFunInt { 1 }
val b = simpleFunInt { 1 }
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
interface A {
fun foo()
}
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
interface A {
fun foo(): Any
}
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
fun test(ss: List<String?>) {
val shortStrings = hashSetOf<String>()
val longStrings = hashSetOf<String>()
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
fun test(list: List<String>) {
val result = mutableListOf<String>()
use1 { list.forEach { result.add(it) } }
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// Checks that methods 'access$getMy$p', 'access$getMy$cp' and 'getMy' are not generated and
// that backed field 'my' is directly used through a 'getstatic'
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// Checks that methods 'access$getMy$p' and 'getMy' are not generated and
// that backed field 'my' is accessed through 'access$getMy$cp'
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// Checks that accessor methods are always used due to the overriding of the default setter of 'my' property.
class My {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// Checks that accessor 'I$Companion.access$getBar\$p' is always used because the property is kept
// into the companion object.
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// Checks that accessor are not used because property can be accessed directly.
interface I {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
val a = false
val b = false
val c = false
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
val a = false
val b = false
val c = false
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
val a = false
val b = false
val c = false
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
val a = false
val b = false
val c = false
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
fun main(p: String?) {
if (!(p == null)) {
"then"
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
val a = 1
fun main() {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
fun testBoolean1(a: Boolean?, b: Boolean) = a == b
fun testBoolean2(a: Boolean?, b: Boolean) = a != b
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
fun testBoolean1(a: Boolean, b: Boolean?) = a == b
fun testBoolean2(a: Boolean, b: Boolean?) = a != b
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
fun testBoolean1(a: Boolean, b: Any?) = a == b
fun testBoolean2(a: Boolean, b: Any?) = a != b
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
fun main(p: String?) {
if (p == null) {
"then"
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
val a = 1
fun main() {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
fun test() {
fun local(){
@@ -1,4 +1,5 @@
// !LANGUAGE: -ReleaseCoroutines
// IGNORE_BACKEND: JVM_IR
// WITH_COROUTINES
// TREAT_AS_ONE_FILE
@@ -1,4 +1,5 @@
// !LANGUAGE: -InlineConstVals
// IGNORE_BACKEND: JVM_IR
// FILE: Foo.kt
private const val OUTER_PRIVATE = 20
@@ -1,4 +1,5 @@
// !LANGUAGE: -InlineConstVals
// IGNORE_BACKEND: JVM_IR
const val z = 0
@@ -1,4 +1,5 @@
// !LANGUAGE: -InlineConstVals
// IGNORE_BACKEND: JVM_IR
const val z = 0
@@ -1,4 +1,5 @@
// !LANGUAGE: +NoConstantValueAttributeForNonConstVals +JvmFieldInInterface
// IGNORE_BACKEND: JVM_IR
class C {
val testClassVal = 100
@@ -1,4 +1,5 @@
// !LANGUAGE: -NoConstantValueAttributeForNonConstVals +JvmFieldInInterface
// IGNORE_BACKEND: JVM_IR
class C {
val testClassVal = 100
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// FILE: util.kt
inline fun ieq(x: Int, y: Int) = x == y
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// FILE: util.kt
const val FLAG = true
const val OTHER_FLAG = false
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// FILE: util.kt
const val MAGIC = 42
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
val a: Byte = 1 + 10
// 1 BIPUSH 11
@@ -1,4 +1,5 @@
// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND: JVM_IR
// FILE: uint.kt
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
object A {
private const val a = "$"
private const val b = "1234$a"
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
val x = 1
class A {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
fun box(): String {
val z = 1;
return "O" + "K".toString() + z
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
val a: Short = 1 + 255
// 1 SIPUSH 256
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
fun box(): String {
return "O" + "K".toString() + 1.toLong()
}
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
fun test(x: Int, y: Int): String {
var result: String
if (x == 6) {
@@ -1,4 +1,5 @@
// !LANGUAGE: -ReleaseCoroutines
// IGNORE_BACKEND: JVM_IR
// WITH_COROUTINES
import helpers.*
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// WITH_COROUTINES
import helpers.*
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
suspend fun dummy() {}
suspend fun tailCall() {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
import kotlin.sequences.*
import kotlin.experimental.*
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// TREAT_AS_ONE_FILE
import kotlin.coroutines.intrinsics.*
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
suspend fun dummy() {}
val c: suspend () -> Unit = {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
data class A(val x: String, val y: String)
suspend inline fun foo(a: A, block: suspend (A) -> String): String = block(a)
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// TREAT_AS_ONE_FILE
import kotlin.coroutines.*
@@ -1,4 +1,5 @@
// !LANGUAGE: -ReleaseCoroutines
// IGNORE_BACKEND: JVM_IR
// WITH_COROUTINES
import helpers.*
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// COMMON_COROUTINES_TEST
// WITH_COROUTINES
// TREAT_AS_ONE_FILE
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// COMMON_COROUTINES_TEST
// WITH_COROUTINES
// TREAT_AS_ONE_FILE
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// COMMON_COROUTINES_TEST
// WITH_COROUTINES
// TREAT_AS_ONE_FILE
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// COMMON_COROUTINES_TEST
// WITH_COROUTINES
// TREAT_AS_ONE_FILE
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// COMMON_COROUTINES_TEST
// WITH_COROUTINES
// TREAT_AS_ONE_FILE
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// COMMON_COROUTINES_TEST
// WITH_COROUTINES
// TREAT_AS_ONE_FILE
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// COMMON_COROUTINES_TEST
// WITH_COROUTINES
// TREAT_AS_ONE_FILE
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// COMMON_COROUTINES_TEST
// WITH_COROUTINES
// TREAT_AS_ONE_FILE
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// COMMON_COROUTINES_TEST
// WITH_COROUTINES
// TREAT_AS_ONE_FILE
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// COMMON_COROUTINES_TEST
// WITH_COROUTINES
// TREAT_AS_ONE_FILE
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// COMMON_COROUTINES_TEST
// WITH_COROUTINES
// TREAT_AS_ONE_FILE
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
class Handler(val func: suspend (Any) -> Unit)
inline fun createHandler(crossinline handler: suspend (Any) -> Unit): Handler {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
fun <T> builder(c: suspend () -> T): T = TODO()
class Test {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// WITH_COROUTINES
import helpers.*
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// WITH_COROUTINES
import helpers.*
@@ -1,4 +1,5 @@
// !LANGUAGE: -ReleaseCoroutines
// IGNORE_BACKEND: JVM_IR
// WITH_COROUTINES
import helpers.*
@@ -1,4 +1,5 @@
// !LANGUAGE: -ReleaseCoroutines
// IGNORE_BACKEND: JVM_IR
// WITH_COROUTINES
import helpers.*
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
class A
fun foo(x: Any?) {}

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