Remove directives that have no effect from bytecode text tests

All bytecode text tests are run with stdlib in the classpath and only
for JVM backend, therefore directives WITH_RUNTIME, TARGET_BACKEND,
IGNORE_BACKEND are not needed
This commit is contained in:
Alexander Udalov
2018-12-18 17:35:14 +01:00
parent 00caa23307
commit f5ff3d2fa9
90 changed files with 86 additions and 227 deletions
@@ -1,9 +1,10 @@
// WITH_RUNTIME
// FILE: list.kt // FILE: list.kt
val intList = listOf(1, 2, 3) val intList = listOf(1, 2, 3)
val longList = listOf(1L, 2L, 3L) val longList = listOf(1L, 2L, 3L)
// FILE: box.kt // FILE: box.kt
fun box(): String { fun box(): String {
val intListMin = intList.minBy { it } ?: -1 val intListMin = intList.minBy { it } ?: -1
if (intListMin != 1) return "Fail intListMin=$intListMin" if (intListMin != 1) return "Fail intListMin=$intListMin"
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test() { fun test() {
var x = 0 var x = 0
run { run {
@@ -13,4 +11,4 @@ fun test() {
// 0 NEW // 0 NEW
// 0 GETFIELD // 0 GETFIELD
// 0 PUTFIELD // 0 PUTFIELD
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test() { fun test() {
var x = 0 var x = 0
run { ++x } run { ++x }
@@ -7,4 +5,4 @@ fun test() {
// 0 NEW // 0 NEW
// 0 GETFIELD // 0 GETFIELD
// 0 PUTFIELD // 0 PUTFIELD
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test() { fun test() {
var x = 0 var x = 0
run { run {
@@ -12,4 +10,4 @@ fun test() {
// 1 NEW kotlin/jvm/internal/Ref\$IntRef // 1 NEW kotlin/jvm/internal/Ref\$IntRef
// 2 GETFIELD kotlin/jvm/internal/Ref\$IntRef\.element // 2 GETFIELD kotlin/jvm/internal/Ref\$IntRef\.element
// 2 PUTFIELD kotlin/jvm/internal/Ref\$IntRef\.element // 2 PUTFIELD kotlin/jvm/internal/Ref\$IntRef\.element
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun runNoInline(f: () -> Unit) = f() fun runNoInline(f: () -> Unit) = f()
fun test() { fun test() {
@@ -9,4 +7,4 @@ fun test() {
// 1 NEW kotlin/jvm/internal/Ref\$IntRef // 1 NEW kotlin/jvm/internal/Ref\$IntRef
// 2 GETFIELD kotlin/jvm/internal/Ref\$IntRef\.element // 2 GETFIELD kotlin/jvm/internal/Ref\$IntRef\.element
// 2 PUTFIELD kotlin/jvm/internal/Ref\$IntRef\.element // 2 PUTFIELD kotlin/jvm/internal/Ref\$IntRef\.element
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun runNoInline(f: () -> Unit) = f() fun runNoInline(f: () -> Unit) = f()
fun test() { fun test() {
@@ -17,4 +15,4 @@ fun test() {
// 1 NEW kotlin/jvm/internal/Ref\$IntRef // 1 NEW kotlin/jvm/internal/Ref\$IntRef
// 2 GETFIELD kotlin/jvm/internal/Ref\$IntRef\.element // 2 GETFIELD kotlin/jvm/internal/Ref\$IntRef\.element
// 2 PUTFIELD kotlin/jvm/internal/Ref\$IntRef\.element // 2 PUTFIELD kotlin/jvm/internal/Ref\$IntRef\.element
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun box(): String { fun box(): String {
var xl = 0L // Long, size 2 var xl = 0L // Long, size 2
var xi = 0 // Int, size 1 var xi = 0 // Int, size 1
@@ -22,4 +20,4 @@ fun box(): String {
return "OK" return "OK"
} }
// 0 NEW // 0 NEW
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun box(): String { fun box(): String {
run { run {
run { run {
@@ -29,4 +27,4 @@ fun box(): String {
// 0 NEW // 0 NEW
// 0 GETFIELD // 0 GETFIELD
// 0 PUTFIELD // 0 PUTFIELD
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun add(x: Int, y: Int) = x + y fun add(x: Int, y: Int) = x + y
fun test() { fun test() {
@@ -11,4 +9,4 @@ fun test() {
// 0 NEW // 0 NEW
// 0 GETFIELD // 0 GETFIELD
// 0 PUTFIELD // 0 PUTFIELD
@@ -1,7 +1,5 @@
// WITH_RUNTIME
fun testPrimitiveArray(ints: IntArray) = fun testPrimitiveArray(ints: IntArray) =
10 in ints.indices 10 in ints.indices
// 0 DUP // 0 DUP
// 0 POP // 0 POP
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test(list: List<String>) { fun test(list: List<String>) {
val result = mutableListOf<String>() val result = mutableListOf<String>()
use1 { list.forEach { result.add(it) } } use1 { list.forEach { result.add(it) } }
@@ -1,5 +1,4 @@
// !LANGUAGE: -ReleaseCoroutines // !LANGUAGE: -ReleaseCoroutines
// WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// TREAT_AS_ONE_FILE // TREAT_AS_ONE_FILE
@@ -1,8 +1,8 @@
// WITH_RUNTIME
// COMMON_COROUTINES_TEST // COMMON_COROUTINES_TEST
// WITH_COROUTINES // WITH_COROUTINES
import helpers.*
// TREAT_AS_ONE_FILE // TREAT_AS_ONE_FILE
import helpers.*
import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.*
import COROUTINES_PACKAGE.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
@@ -1,8 +1,8 @@
// WITH_RUNTIME
// COMMON_COROUTINES_TEST // COMMON_COROUTINES_TEST
// WITH_COROUTINES // WITH_COROUTINES
import helpers.*
// TREAT_AS_ONE_FILE // TREAT_AS_ONE_FILE
import helpers.*
import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.*
import COROUTINES_PACKAGE.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
@@ -1,8 +1,8 @@
// WITH_RUNTIME
// COMMON_COROUTINES_TEST // COMMON_COROUTINES_TEST
// WITH_COROUTINES // WITH_COROUTINES
import helpers.*
// TREAT_AS_ONE_FILE // TREAT_AS_ONE_FILE
import helpers.*
import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.*
import COROUTINES_PACKAGE.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
@@ -1,8 +1,8 @@
// WITH_RUNTIME
// COMMON_COROUTINES_TEST // COMMON_COROUTINES_TEST
// WITH_COROUTINES // WITH_COROUTINES
import helpers.*
// TREAT_AS_ONE_FILE // TREAT_AS_ONE_FILE
import helpers.*
import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.*
import COROUTINES_PACKAGE.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
@@ -1,8 +1,8 @@
// WITH_RUNTIME
// COMMON_COROUTINES_TEST // COMMON_COROUTINES_TEST
// WITH_COROUTINES // WITH_COROUTINES
import helpers.*
// TREAT_AS_ONE_FILE // TREAT_AS_ONE_FILE
import helpers.*
import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.*
import COROUTINES_PACKAGE.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
@@ -1,8 +1,8 @@
// WITH_RUNTIME
// COMMON_COROUTINES_TEST // COMMON_COROUTINES_TEST
// WITH_COROUTINES // WITH_COROUTINES
import helpers.*
// TREAT_AS_ONE_FILE // TREAT_AS_ONE_FILE
import helpers.*
import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.*
import COROUTINES_PACKAGE.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
@@ -1,9 +1,8 @@
// WITH_RUNTIME
// COMMON_COROUTINES_TEST // COMMON_COROUTINES_TEST
// WITH_COROUTINES // WITH_COROUTINES
import helpers.*
// TREAT_AS_ONE_FILE // TREAT_AS_ONE_FILE
// TARGET_BACKEND: JVM
import helpers.*
import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.*
import COROUTINES_PACKAGE.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
@@ -1,8 +1,8 @@
// WITH_RUNTIME
// COMMON_COROUTINES_TEST // COMMON_COROUTINES_TEST
// WITH_COROUTINES // WITH_COROUTINES
import helpers.*
// TREAT_AS_ONE_FILE // TREAT_AS_ONE_FILE
import helpers.*
import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.*
import COROUTINES_PACKAGE.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
@@ -1,9 +1,8 @@
// WITH_RUNTIME
// COMMON_COROUTINES_TEST // COMMON_COROUTINES_TEST
// WITH_COROUTINES // WITH_COROUTINES
import helpers.*
// TREAT_AS_ONE_FILE // TREAT_AS_ONE_FILE
// TARGET_BACKEND: JVM
import helpers.*
import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.*
import COROUTINES_PACKAGE.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
@@ -1,8 +1,8 @@
// WITH_RUNTIME
// COMMON_COROUTINES_TEST // COMMON_COROUTINES_TEST
// WITH_COROUTINES // WITH_COROUTINES
import helpers.*
// TREAT_AS_ONE_FILE // TREAT_AS_ONE_FILE
import helpers.*
import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.*
import COROUTINES_PACKAGE.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
@@ -1,11 +1,10 @@
// WITH_RUNTIME
// COMMON_COROUTINES_TEST // COMMON_COROUTINES_TEST
// WITH_COROUTINES // WITH_COROUTINES
// TREAT_AS_ONE_FILE
import helpers.* import helpers.*
import COROUTINES_PACKAGE.* import COROUTINES_PACKAGE.*
import COROUTINES_PACKAGE.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
// TREAT_AS_ONE_FILE
var res = "FAIL" var res = "FAIL"
@@ -1,5 +1,3 @@
// WITH_RUNTIME
val arr = arrayOf("a", "b", "c", "d") val arr = arrayOf("a", "b", "c", "d")
fun box(): String { fun box(): String {
@@ -19,4 +17,4 @@ fun box(): String {
// 0 next // 0 next
// 0 component1 // 0 component1
// 0 component2 // 0 component2
// 1 ARRAYLENGTH // 1 ARRAYLENGTH
@@ -1,5 +1,3 @@
// WITH_RUNTIME
val arr = arrayOf("a", "b", "c", "d") val arr = arrayOf("a", "b", "c", "d")
fun box(): String { fun box(): String {
@@ -19,4 +17,4 @@ fun box(): String {
// 0 next // 0 next
// 0 component1 // 0 component1
// 0 component2 // 0 component2
// 1 ARRAYLENGTH // 1 ARRAYLENGTH
@@ -1,5 +1,3 @@
// WITH_RUNTIME
val arr = intArrayOf() val arr = intArrayOf()
fun box(): String { fun box(): String {
@@ -16,4 +14,4 @@ fun box(): String {
// 0 next // 0 next
// 0 component1 // 0 component1
// 0 component2 // 0 component2
// 1 ARRAYLENGTH // 1 ARRAYLENGTH
@@ -1,5 +1,3 @@
// WITH_RUNTIME
val arr = intArrayOf(10, 20, 30, 40) val arr = intArrayOf(10, 20, 30, 40)
fun box(): String { fun box(): String {
@@ -17,4 +15,4 @@ fun box(): String {
// 0 next // 0 next
// 0 component1 // 0 component1
// 0 component2 // 0 component2
// 1 ARRAYLENGTH // 1 ARRAYLENGTH
@@ -1,5 +1,3 @@
// WITH_RUNTIME
val arr = arrayOf("a", "b", "c", "d") val arr = arrayOf("a", "b", "c", "d")
fun box(): String { fun box(): String {
@@ -19,4 +17,4 @@ fun box(): String {
// 0 next // 0 next
// 0 component1 // 0 component1
// 0 component2 // 0 component2
// 1 ARRAYLENGTH // 1 ARRAYLENGTH
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test() { fun test() {
var s = "" var s = ""
for (c in "testString") { for (c in "testString") {
@@ -1,5 +1,3 @@
// WITH_RUNTIME
val cs: CharSequence = "abcd" val cs: CharSequence = "abcd"
fun box(): String { fun box(): String {
@@ -20,4 +18,4 @@ fun box(): String {
// 0 component1 // 0 component1
// 0 component2 // 0 component2
// 1 length // 1 length
// 1 charAt // 1 charAt
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun box(): String { fun box(): String {
for ((index, x) in "".withIndex()) { for ((index, x) in "".withIndex()) {
return "Loop over empty String should not be executed" return "Loop over empty String should not be executed"
@@ -14,4 +12,4 @@ fun box(): String {
// 0 component1 // 0 component1
// 0 component2 // 0 component2
// 1 length // 1 length
// 1 charAt // 1 charAt
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun box(): String { fun box(): String {
val s = StringBuilder() val s = StringBuilder()
@@ -18,4 +16,4 @@ fun box(): String {
// 0 component1 // 0 component1
// 0 component2 // 0 component2
// 1 length // 1 length
// 1 charAt // 1 charAt
@@ -1,5 +1,3 @@
// WITH_RUNTIME
val xs = "abcd" val xs = "abcd"
fun box(): String { fun box(): String {
@@ -20,4 +18,4 @@ fun box(): String {
// 0 component1 // 0 component1
// 0 component2 // 0 component2
// 1 length // 1 length
// 0 charAt // 0 charAt
@@ -1,5 +1,3 @@
// WITH_RUNTIME
val xs = "abcd" val xs = "abcd"
fun box(): String { fun box(): String {
@@ -20,4 +18,4 @@ fun box(): String {
// 0 component1 // 0 component1
// 0 component2 // 0 component2
// 1 length // 1 length
// 1 charAt // 1 charAt
@@ -1,5 +1,3 @@
// WITH_RUNTIME
val xs = "abcd" val xs = "abcd"
fun useAny(x: Any) {} fun useAny(x: Any) {}
@@ -23,4 +21,4 @@ fun box(): String {
// 0 component1 // 0 component1
// 0 component2 // 0 component2
// 1 length // 1 length
// 1 charAt // 1 charAt
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test(s: CharSequence): Int { fun test(s: CharSequence): Int {
var result = 0 var result = 0
for (i in s.indices) { for (i in s.indices) {
@@ -16,4 +14,4 @@ fun test(s: CharSequence): Int {
// 0 IF_ICMPGT // 0 IF_ICMPGT
// 0 IF_ICMPEQ // 0 IF_ICMPEQ
// 1 IF_ICMPGE // 1 IF_ICMPGE
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun Collection<Int>.sumIndices(): Int { fun Collection<Int>.sumIndices(): Int {
var sum = 0 var sum = 0
for (i in indices) { for (i in indices) {
@@ -16,4 +14,4 @@ fun Collection<Int>.sumIndices(): Int {
// 0 IF_ICMPGT // 0 IF_ICMPGT
// 0 IF_ICMPEQ // 0 IF_ICMPEQ
// 1 IF_ICMPGE // 1 IF_ICMPGE
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test() { fun test() {
var sum = 0 var sum = 0
for (i in listOf(0, 0, 0, 0).indices) { for (i in listOf(0, 0, 0, 0).indices) {
@@ -15,4 +13,4 @@ fun test() {
// 0 IF_ICMPGT // 0 IF_ICMPGT
// 0 IF_ICMPEQ // 0 IF_ICMPEQ
// 1 IF_ICMPGE // 1 IF_ICMPGE
@@ -1,5 +1,3 @@
// WITH_RUNTIME
import kotlin.test.assertEquals import kotlin.test.assertEquals
fun test(coll: Collection<*>?): Int { fun test(coll: Collection<*>?): Int {
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test() { fun test() {
var sum = 0 var sum = 0
for (i in arrayOf("", "", "", "").indices) { for (i in arrayOf("", "", "", "").indices) {
@@ -15,4 +13,4 @@ fun test() {
// 0 IF_ICMPGT // 0 IF_ICMPGT
// 0 IF_ICMPEQ // 0 IF_ICMPEQ
// 1 IF_ICMPGE // 1 IF_ICMPGE
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test() { fun test() {
var sum = 0 var sum = 0
for (i in intArrayOf(0, 0, 0, 0).indices) { for (i in intArrayOf(0, 0, 0, 0).indices) {
@@ -15,4 +13,4 @@ fun test() {
// 0 IF_ICMPGT // 0 IF_ICMPGT
// 0 IF_ICMPEQ // 0 IF_ICMPEQ
// 1 IF_ICMPGE // 1 IF_ICMPGE
@@ -1,5 +1,3 @@
// WITH_RUNTIME
val xs = listOf<Any>() val xs = listOf<Any>()
fun box(): String { fun box(): String {
@@ -15,4 +13,4 @@ fun box(): String {
// 1 hasNext // 1 hasNext
// 1 next // 1 next
// 0 component1 // 0 component1
// 0 component2 // 0 component2
@@ -1,5 +1,3 @@
// WITH_RUNTIME
val xs = listOf("a", "b", "c", "d") val xs = listOf("a", "b", "c", "d")
fun box(): String { fun box(): String {
@@ -18,4 +16,4 @@ fun box(): String {
// 1 hasNext // 1 hasNext
// 1 next // 1 next
// 0 component1 // 0 component1
// 0 component2 // 0 component2
@@ -1,5 +1,3 @@
// WITH_RUNTIME
val xs = listOf("a", "b", "c", "d") val xs = listOf("a", "b", "c", "d")
fun box(): String { fun box(): String {
@@ -18,4 +16,4 @@ fun box(): String {
// 1 hasNext // 1 hasNext
// 1 next // 1 next
// 0 component1 // 0 component1
// 0 component2 // 0 component2
@@ -1,5 +1,3 @@
// WITH_RUNTIME
val xs = listOf("a", "b", "c", "d") val xs = listOf("a", "b", "c", "d")
fun box(): String { fun box(): String {
@@ -18,4 +16,4 @@ fun box(): String {
// 1 hasNext // 1 hasNext
// 1 next // 1 next
// 0 component1 // 0 component1
// 0 component2 // 0 component2
@@ -1,5 +1,3 @@
// WITH_RUNTIME
val xs = listOf("a", "b", "c", "d") val xs = listOf("a", "b", "c", "d")
fun useAny(x: Any) {} fun useAny(x: Any) {}
@@ -21,4 +19,4 @@ fun box(): String {
// 1 hasNext // 1 hasNext
// 1 next // 1 next
// 0 component1 // 0 component1
// 0 component2 // 0 component2
@@ -1,4 +1,3 @@
// WITH_RUNTIME
import kotlin.test.* import kotlin.test.*
fun intRange() = 1 .. 4 fun intRange() = 1 .. 4
@@ -27,4 +26,4 @@ fun box(): String {
return "OK" return "OK"
} }
// 0 reversed // 0 reversed
@@ -1,4 +1,3 @@
// WITH_RUNTIME
import kotlin.test.* import kotlin.test.*
fun box(): String { fun box(): String {
@@ -12,4 +11,4 @@ fun box(): String {
return "OK" return "OK"
} }
// 0 reversed // 0 reversed
@@ -1,4 +1,3 @@
// WITH_RUNTIME
import kotlin.test.* import kotlin.test.*
fun box(): String { fun box(): String {
@@ -12,4 +11,4 @@ fun box(): String {
return "OK" return "OK"
} }
// 0 reversed // 0 reversed
@@ -1,4 +1,3 @@
// WITH_RUNTIME
import kotlin.test.* import kotlin.test.*
fun box(): String { fun box(): String {
@@ -12,4 +11,4 @@ fun box(): String {
return "OK" return "OK"
} }
// 0 reversed // 0 reversed
@@ -1,4 +1,3 @@
// WITH_RUNTIME
import kotlin.test.* import kotlin.test.*
fun box(): String { fun box(): String {
@@ -23,4 +22,4 @@ fun box(): String {
return "OK" return "OK"
} }
// 0 reversed // 0 reversed
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun box(): String { fun box(): String {
for (i in (4 .. 1).reversed()) { for (i in (4 .. 1).reversed()) {
throw AssertionError("Loop should not be executed") throw AssertionError("Loop should not be executed")
@@ -18,4 +16,4 @@ fun box(): String {
// 0 getEnd // 0 getEnd
// 0 getFirst // 0 getFirst
// 0 getLast // 0 getLast
// 0 getStep // 0 getStep
@@ -1,4 +1,3 @@
// WITH_RUNTIME
import kotlin.test.* import kotlin.test.*
fun intRange() = 1 .. 4 fun intRange() = 1 .. 4
@@ -27,4 +26,4 @@ fun box(): String {
return "OK" return "OK"
} }
// 0 reversed // 0 reversed
@@ -1,4 +1,3 @@
// WITH_RUNTIME
import kotlin.test.* import kotlin.test.*
fun box(): String { fun box(): String {
@@ -32,4 +31,4 @@ fun box(): String {
// 0 IFEQ // 0 IFEQ
// 0 IF_ICMPEQ // 0 IF_ICMPEQ
// 2 IF_ICMPLT // 2 IF_ICMPLT
// 1 LCMP // 1 LCMP
@@ -1,4 +1,3 @@
// WITH_RUNTIME
import kotlin.test.* import kotlin.test.*
fun intRange() = 1 .. 4 fun intRange() = 1 .. 4
@@ -27,4 +26,4 @@ fun box(): String {
return "OK" return "OK"
} }
// 0 reversed // 0 reversed
@@ -1,4 +1,3 @@
// WITH_RUNTIME
import kotlin.test.* import kotlin.test.*
fun box(): String { fun box(): String {
@@ -20,4 +19,4 @@ fun box(): String {
return "OK" return "OK"
} }
// 0 reversed // 0 reversed
@@ -1,5 +1,3 @@
// WITH_RUNTIME
val xs = listOf<Any>().asSequence() val xs = listOf<Any>().asSequence()
fun box(): String { fun box(): String {
@@ -15,4 +13,4 @@ fun box(): String {
// 1 hasNext // 1 hasNext
// 1 next // 1 next
// 0 component1 // 0 component1
// 0 component2 // 0 component2
@@ -1,5 +1,3 @@
// WITH_RUNTIME
val xs = listOf("a", "b", "c", "d").asSequence() val xs = listOf("a", "b", "c", "d").asSequence()
fun box(): String { fun box(): String {
@@ -18,4 +16,4 @@ fun box(): String {
// 1 hasNext // 1 hasNext
// 1 next // 1 next
// 0 component1 // 0 component1
// 0 component2 // 0 component2
@@ -1,5 +1,3 @@
// WITH_RUNTIME
val xs = listOf("a", "b", "c", "d").asSequence() val xs = listOf("a", "b", "c", "d").asSequence()
fun box(): String { fun box(): String {
@@ -18,4 +16,4 @@ fun box(): String {
// 1 hasNext // 1 hasNext
// 1 next // 1 next
// 0 component1 // 0 component1
// 0 component2 // 0 component2
@@ -1,5 +1,3 @@
// WITH_RUNTIME
val xs = listOf("a", "b", "c", "d").asSequence() val xs = listOf("a", "b", "c", "d").asSequence()
fun box(): String { fun box(): String {
@@ -18,4 +16,4 @@ fun box(): String {
// 1 hasNext // 1 hasNext
// 1 next // 1 next
// 0 component1 // 0 component1
// 0 component2 // 0 component2
@@ -1,6 +1,4 @@
// IGNORE_BACKEND: JS, NATIVE
// FULL_JDK // FULL_JDK
// WITH_RUNTIME
val xsl = arrayListOf("a", "b", "c", "d") val xsl = arrayListOf("a", "b", "c", "d")
val xs = xsl.asSequence() val xs = xsl.asSequence()
@@ -29,4 +27,4 @@ fun box(): String {
// 1 hasNext // 1 hasNext
// 1 next // 1 next
// 0 component1 // 0 component1
// 0 component2 // 0 component2
@@ -1,5 +1,3 @@
// WITH_RUNTIME
val xs = listOf("a", "b", "c", "d").asSequence() val xs = listOf("a", "b", "c", "d").asSequence()
fun useAny(x: Any) {} fun useAny(x: Any) {}
@@ -21,4 +19,4 @@ fun box(): String {
// 1 hasNext // 1 hasNext
// 1 next // 1 next
// 0 component1 // 0 component1
// 0 component2 // 0 component2
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test() { fun test() {
var s = "" var s = ""
for (c in "testString") { for (c in "testString") {
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test(): Int { fun test(): Int {
var sum = 0 var sum = 0
for (i in 1 until 6) { for (i in 1 until 6) {
@@ -13,4 +11,4 @@ fun test(): Int {
// 0 getEnd // 0 getEnd
// 0 getFirst // 0 getFirst
// 0 getLast // 0 getLast
// 1 IF // 1 IF
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test(): Int { fun test(): Int {
var sum = 0 var sum = 0
for (i in 4 downTo 1) { for (i in 4 downTo 1) {
@@ -14,4 +12,4 @@ fun test(): Int {
// 0 getFirst // 0 getFirst
// 0 getLast // 0 getLast
// 0 IF_ICMPEQ // 0 IF_ICMPEQ
// 1 IF_ICMPLT // 1 IF_ICMPLT
@@ -1,5 +1,4 @@
// !LANGUAGE: +InlineClasses // !LANGUAGE: +InlineClasses
// IGNORE_BACKEND: JVM_IR
inline class Id(val id: String) inline class Id(val id: String)
@@ -26,4 +25,4 @@ fun test(password: Password) {
// 1 public final static test-tmnojjU\(Ljava/lang/String;\)V // 1 public final static test-tmnojjU\(Ljava/lang/String;\)V
// 1 public final static test-hI9h0ro\(Ljava/lang/String;\)V // 1 public final static test-hI9h0ro\(Ljava/lang/String;\)V
// 1 public final static test-75PUH38\(Ljava/lang/String;\)V // 1 public final static test-75PUH38\(Ljava/lang/String;\)V
// 1 public final static test-3mN7H-Y\(Ljava/lang/String;\)V // 1 public final static test-3mN7H-Y\(Ljava/lang/String;\)V
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun uint(vararg us: UInt): UIntArray = us fun uint(vararg us: UInt): UIntArray = us
// FILE: NoBoxing.kt // FILE: NoBoxing.kt
@@ -23,4 +21,4 @@ fun test2(nullable: UInt?, ns: Array<UInt>) {
// @BoxingKt.class: // @BoxingKt.class:
// 2 INVOKESTATIC kotlin.UInt\.box // 2 INVOKESTATIC kotlin.UInt\.box
// 0 INVOKEVIRTUAL kotlin.UInt.unbox // 0 INVOKEVIRTUAL kotlin.UInt.unbox
@@ -1,5 +1,3 @@
// WITH_RUNTIME
class A { class A {
} }
@@ -1,5 +1,3 @@
// WITH_RUNTIME
class A { class A {
} }
@@ -1,6 +1,5 @@
// !JVM_DEFAULT_MODE: compatibility // !JVM_DEFAULT_MODE: compatibility
// JVM_TARGET: 1.8 // JVM_TARGET: 1.8
// WITH_RUNTIME
// FULL_JDK // FULL_JDK
interface KInterface { interface KInterface {
@@ -1,6 +1,5 @@
// !JVM_DEFAULT_MODE: compatibility // !JVM_DEFAULT_MODE: compatibility
// JVM_TARGET: 1.8 // JVM_TARGET: 1.8
// WITH_RUNTIME
interface KInterface { interface KInterface {
-3
View File
@@ -1,6 +1,3 @@
// WITH_RUNTIME
// TARGET_BACKEND: JVM
// FILE: Dummy.kt // FILE: Dummy.kt
// Empty body to trigger multifile test mode // Empty body to trigger multifile test mode
@@ -1,4 +1,3 @@
// WITH_RUNTIME
// KOTLIN_CONFIGURATION_FLAGS: +JVM.INHERIT_MULTIFILE_PARTS // KOTLIN_CONFIGURATION_FLAGS: +JVM.INHERIT_MULTIFILE_PARTS
// FILE: bar.kt // FILE: bar.kt
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test1() { fun test1() {
val a = null val a = null
@@ -15,4 +13,4 @@ fun test1() {
// 0 IFNULL // 0 IFNULL
// 0 IFNONNULL // 0 IFNONNULL
// 0 X1 // 0 X1
// 1 X2 // 1 X2
@@ -1,5 +1,3 @@
// WITH_RUNTIME
// FILE: test.kt // FILE: test.kt
fun test1() { fun test1() {
@@ -16,4 +14,4 @@ fun test1() {
// 0 X3 // 0 X3
// FILE: inline.kt // FILE: inline.kt
inline fun <T : Any> T?.elvis(rhs: () -> T): T = this ?: rhs() inline fun <T : Any> T?.elvis(rhs: () -> T): T = this ?: rhs()
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test1() { fun test1() {
val a = Unit val a = Unit
@@ -15,4 +13,4 @@ fun test1() {
// 0 IFNULL // 0 IFNULL
// 0 IFNONNULL // 0 IFNONNULL
// 1 X1 // 1 X1
// 0 X2 // 0 X2
@@ -1,5 +1,3 @@
// WITH_RUNTIME
// FILE: test.kt // FILE: test.kt
fun test1(): String { fun test1(): String {
@@ -15,4 +13,4 @@ fun test1(): String {
// FILE: inline.kt // FILE: inline.kt
inline fun <T : Any, R> T?.mapNullable(ifNotNull: (T) -> R, ifNull: () -> R): R = inline fun <T : Any, R> T?.mapNullable(ifNotNull: (T) -> R, ifNull: () -> R): R =
if (this == null) ifNull() else ifNotNull(this) if (this == null) ifNull() else ifNotNull(this)
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test() { fun test() {
val value = System.getProperty("key") val value = System.getProperty("key")
if (value != null) { if (value != null) {
@@ -8,4 +6,4 @@ fun test() {
} }
// 1 IFNULL // 1 IFNULL
// 0 IFNONNULL // 0 IFNONNULL
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun testPrimitiveArray(i: Int, ints: IntArray) = i in ints.indices fun testPrimitiveArray(i: Int, ints: IntArray) = i in ints.indices
fun testObjectArray(i: Int, xs: Array<Any>) = i in xs.indices fun testObjectArray(i: Int, xs: Array<Any>) = i in xs.indices
@@ -13,4 +11,4 @@ fun testLongWithObjectArray(i: Long, xs: Array<Any>) = i in xs.indices
// 2 I2L // 2 I2L
// 4 ARRAYLENGTH // 4 ARRAYLENGTH
// 2 LCONST_0 // 2 LCONST_0
// 6 ICONST_0 // 6 ICONST_0
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun testCharSequence(i: Int, cs: CharSequence) = i in cs.indices fun testCharSequence(i: Int, cs: CharSequence) = i in cs.indices
fun testLongWithCharSequence(i: Long, cs: CharSequence) = i in cs.indices fun testLongWithCharSequence(i: Long, cs: CharSequence) = i in cs.indices
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun testCollection(i: Int, xs: List<Any>) = i in xs.indices fun testCollection(i: Int, xs: List<Any>) = i in xs.indices
fun testLongWithCollection(i: Long, xs: List<Any>) = i in xs.indices fun testLongWithCollection(i: Long, xs: List<Any>) = i in xs.indices
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun inInt(x: Long): Boolean { fun inInt(x: Long): Boolean {
return x in 1..2 return x in 1..2
} }
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun byteInFloat(x: Byte, a: Float, b: Float) = x in a .. b fun byteInFloat(x: Byte, a: Float, b: Float) = x in a .. b
fun byteInDouble(x: Byte, a: Double, b: Double) = x in a .. b fun byteInDouble(x: Byte, a: Double, b: Double) = x in a .. b
fun shortInFloat(x: Short, a: Float, b: Float) = x in a .. b fun shortInFloat(x: Short, a: Float, b: Float) = x in a .. b
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun Byte.inByte(left: Byte, right: Byte) = this in left..right fun Byte.inByte(left: Byte, right: Byte) = this in left..right
fun Short.inInt(left: Int, right: Int) = this in left .. right fun Short.inInt(left: Int, right: Int) = this in left .. right
+1 -3
View File
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun testByte(a: Byte, x: Byte, y: Byte) = a in x until y fun testByte(a: Byte, x: Byte, y: Byte) = a in x until y
fun testShort(a: Short, x: Short, y: Short) = a in x until y fun testShort(a: Short, x: Short, y: Short) = a in x until y
@@ -9,4 +7,4 @@ fun testInt(a: Int, x: Int, y: Int) = a in x until y
fun testLong(a: Long, x: Long, y: Long) = a in x until y fun testLong(a: Long, x: Long, y: Long) = a in x until y
// 0 until // 0 until
// 0 INVOKEVIRTUAL // 0 INVOKEVIRTUAL
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test(a: Int) = a in 1 .. 10 fun test(a: Int) = a in 1 .. 10
fun test(a: Long) = a in 1L .. 10L fun test(a: Long) = a in 1L .. 10L
fun test(a: Float) = a in 1.0f .. 10.0f fun test(a: Float) = a in 1.0f .. 10.0f
@@ -9,4 +7,4 @@ fun test(a: String) = a in "abc" .. "def"
// 0 DUP_X1 // 0 DUP_X1
// 0 DUP2_X1 // 0 DUP2_X1
// 0 DUP_X2 // 0 DUP_X2
// 0 DUP2_X2 // 0 DUP2_X2
@@ -1,4 +1,3 @@
// WITH_RUNTIME
// FILE: JFoo.java // FILE: JFoo.java
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@@ -23,4 +22,4 @@ fun test() {
// 1 INVOKESPECIAL TestKt\$test\$1.<init> // 1 INVOKESPECIAL TestKt\$test\$1.<init>
// 0 IFNONNULL // 0 IFNONNULL
// 0 IFNULL // 0 IFNULL
// 1 ACONST_NULL // 1 ACONST_NULL
@@ -1,4 +1,3 @@
// WITH_RUNTIME
// FILE: JFoo.java // FILE: JFoo.java
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@@ -21,4 +20,4 @@ fun test() {
// 2 NEW // 2 NEW
// 0 IFNONNULL // 0 IFNONNULL
// 1 IFNULL // 1 IFNULL
// 1 ACONST_NULL // 1 ACONST_NULL
+1 -3
View File
@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun findUserId(username: String): Long? = null fun findUserId(username: String): Long? = null
fun main(args: Array<String>) { fun main(args: Array<String>) {
@@ -11,4 +9,4 @@ fun main(args: Array<String>) {
} }
} }
// 0 areEqual // 0 areEqual
@@ -60,8 +60,8 @@ fun parseLanguageVersionSettings(directiveMap: Map<String, String>): CompilerTes
val skipMetadataVersionCheck = AnalysisFlags.skipMetadataVersionCheck to directiveMap.containsKey(SKIP_METADATA_VERSION_CHECK) val skipMetadataVersionCheck = AnalysisFlags.skipMetadataVersionCheck to directiveMap.containsKey(SKIP_METADATA_VERSION_CHECK)
val allowResultReturnType = AnalysisFlags.allowResultReturnType to directiveMap.containsKey(ALLOW_RESULT_RETURN_TYPE) val allowResultReturnType = AnalysisFlags.allowResultReturnType to directiveMap.containsKey(ALLOW_RESULT_RETURN_TYPE)
if (apiVersionString == null && languageFeaturesString == null && experimental == null && if (apiVersionString == null && languageFeaturesString == null && experimental == null && useExperimental == null &&
useExperimental == null && !ignoreDataFlowInAssert.second && !allowResultReturnType.second !ignoreDataFlowInAssert.second && enableJvmDefault == null && !skipMetadataVersionCheck.second && !allowResultReturnType.second
) { ) {
return null return null
} }