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

View File

@@ -1,9 +1,10 @@
// WITH_RUNTIME
// FILE: list.kt
val intList = listOf(1, 2, 3)
val longList = listOf(1L, 2L, 3L)
// FILE: box.kt
fun box(): String {
val intListMin = intList.minBy { it } ?: -1
if (intListMin != 1) return "Fail intListMin=$intListMin"

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test() {
var x = 0
run {
@@ -13,4 +11,4 @@ fun test() {
// 0 NEW
// 0 GETFIELD
// 0 PUTFIELD
// 0 PUTFIELD

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test() {
var x = 0
run { ++x }
@@ -7,4 +5,4 @@ fun test() {
// 0 NEW
// 0 GETFIELD
// 0 PUTFIELD
// 0 PUTFIELD

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test() {
var x = 0
run {
@@ -12,4 +10,4 @@ fun test() {
// 1 NEW kotlin/jvm/internal/Ref\$IntRef
// 2 GETFIELD kotlin/jvm/internal/Ref\$IntRef\.element
// 2 PUTFIELD kotlin/jvm/internal/Ref\$IntRef\.element
// 2 PUTFIELD kotlin/jvm/internal/Ref\$IntRef\.element

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun runNoInline(f: () -> Unit) = f()
fun test() {
@@ -9,4 +7,4 @@ fun test() {
// 1 NEW kotlin/jvm/internal/Ref\$IntRef
// 2 GETFIELD kotlin/jvm/internal/Ref\$IntRef\.element
// 2 PUTFIELD kotlin/jvm/internal/Ref\$IntRef\.element
// 2 PUTFIELD kotlin/jvm/internal/Ref\$IntRef\.element

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun runNoInline(f: () -> Unit) = f()
fun test() {
@@ -17,4 +15,4 @@ fun test() {
// 1 NEW kotlin/jvm/internal/Ref\$IntRef
// 2 GETFIELD kotlin/jvm/internal/Ref\$IntRef\.element
// 2 PUTFIELD kotlin/jvm/internal/Ref\$IntRef\.element
// 2 PUTFIELD kotlin/jvm/internal/Ref\$IntRef\.element

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun box(): String {
var xl = 0L // Long, size 2
var xi = 0 // Int, size 1
@@ -22,4 +20,4 @@ fun box(): String {
return "OK"
}
// 0 NEW
// 0 NEW

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun box(): String {
run {
run {
@@ -29,4 +27,4 @@ fun box(): String {
// 0 NEW
// 0 GETFIELD
// 0 PUTFIELD
// 0 PUTFIELD

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun add(x: Int, y: Int) = x + y
fun test() {
@@ -11,4 +9,4 @@ fun test() {
// 0 NEW
// 0 GETFIELD
// 0 PUTFIELD
// 0 PUTFIELD

View File

@@ -1,7 +1,5 @@
// WITH_RUNTIME
fun testPrimitiveArray(ints: IntArray) =
10 in ints.indices
// 0 DUP
// 0 POP
// 0 POP

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test(list: List<String>) {
val result = mutableListOf<String>()
use1 { list.forEach { result.add(it) } }

View File

@@ -1,5 +1,4 @@
// !LANGUAGE: -ReleaseCoroutines
// WITH_RUNTIME
// WITH_COROUTINES
// TREAT_AS_ONE_FILE

View File

@@ -1,8 +1,8 @@
// WITH_RUNTIME
// COMMON_COROUTINES_TEST
// WITH_COROUTINES
import helpers.*
// TREAT_AS_ONE_FILE
import helpers.*
import COROUTINES_PACKAGE.*
import COROUTINES_PACKAGE.intrinsics.*

View File

@@ -1,8 +1,8 @@
// WITH_RUNTIME
// COMMON_COROUTINES_TEST
// WITH_COROUTINES
import helpers.*
// TREAT_AS_ONE_FILE
import helpers.*
import COROUTINES_PACKAGE.*
import COROUTINES_PACKAGE.intrinsics.*

View File

@@ -1,8 +1,8 @@
// WITH_RUNTIME
// COMMON_COROUTINES_TEST
// WITH_COROUTINES
import helpers.*
// TREAT_AS_ONE_FILE
import helpers.*
import COROUTINES_PACKAGE.*
import COROUTINES_PACKAGE.intrinsics.*

View File

@@ -1,8 +1,8 @@
// WITH_RUNTIME
// COMMON_COROUTINES_TEST
// WITH_COROUTINES
import helpers.*
// TREAT_AS_ONE_FILE
import helpers.*
import COROUTINES_PACKAGE.*
import COROUTINES_PACKAGE.intrinsics.*

View File

@@ -1,8 +1,8 @@
// WITH_RUNTIME
// COMMON_COROUTINES_TEST
// WITH_COROUTINES
import helpers.*
// TREAT_AS_ONE_FILE
import helpers.*
import COROUTINES_PACKAGE.*
import COROUTINES_PACKAGE.intrinsics.*

View File

@@ -1,8 +1,8 @@
// WITH_RUNTIME
// COMMON_COROUTINES_TEST
// WITH_COROUTINES
import helpers.*
// TREAT_AS_ONE_FILE
import helpers.*
import COROUTINES_PACKAGE.*
import COROUTINES_PACKAGE.intrinsics.*

View File

@@ -1,9 +1,8 @@
// WITH_RUNTIME
// COMMON_COROUTINES_TEST
// WITH_COROUTINES
import helpers.*
// TREAT_AS_ONE_FILE
// TARGET_BACKEND: JVM
import helpers.*
import COROUTINES_PACKAGE.*
import COROUTINES_PACKAGE.intrinsics.*

View File

@@ -1,8 +1,8 @@
// WITH_RUNTIME
// COMMON_COROUTINES_TEST
// WITH_COROUTINES
import helpers.*
// TREAT_AS_ONE_FILE
import helpers.*
import COROUTINES_PACKAGE.*
import COROUTINES_PACKAGE.intrinsics.*

View File

@@ -1,9 +1,8 @@
// WITH_RUNTIME
// COMMON_COROUTINES_TEST
// WITH_COROUTINES
import helpers.*
// TREAT_AS_ONE_FILE
// TARGET_BACKEND: JVM
import helpers.*
import COROUTINES_PACKAGE.*
import COROUTINES_PACKAGE.intrinsics.*

View File

@@ -1,8 +1,8 @@
// WITH_RUNTIME
// COMMON_COROUTINES_TEST
// WITH_COROUTINES
import helpers.*
// TREAT_AS_ONE_FILE
import helpers.*
import COROUTINES_PACKAGE.*
import COROUTINES_PACKAGE.intrinsics.*

View File

@@ -1,11 +1,10 @@
// WITH_RUNTIME
// COMMON_COROUTINES_TEST
// WITH_COROUTINES
// TREAT_AS_ONE_FILE
import helpers.*
import COROUTINES_PACKAGE.*
import COROUTINES_PACKAGE.intrinsics.*
// TREAT_AS_ONE_FILE
var res = "FAIL"

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
val arr = arrayOf("a", "b", "c", "d")
fun box(): String {
@@ -19,4 +17,4 @@ fun box(): String {
// 0 next
// 0 component1
// 0 component2
// 1 ARRAYLENGTH
// 1 ARRAYLENGTH

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
val arr = arrayOf("a", "b", "c", "d")
fun box(): String {
@@ -19,4 +17,4 @@ fun box(): String {
// 0 next
// 0 component1
// 0 component2
// 1 ARRAYLENGTH
// 1 ARRAYLENGTH

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
val arr = intArrayOf()
fun box(): String {
@@ -16,4 +14,4 @@ fun box(): String {
// 0 next
// 0 component1
// 0 component2
// 1 ARRAYLENGTH
// 1 ARRAYLENGTH

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
val arr = intArrayOf(10, 20, 30, 40)
fun box(): String {
@@ -17,4 +15,4 @@ fun box(): String {
// 0 next
// 0 component1
// 0 component2
// 1 ARRAYLENGTH
// 1 ARRAYLENGTH

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
val arr = arrayOf("a", "b", "c", "d")
fun box(): String {
@@ -19,4 +17,4 @@ fun box(): String {
// 0 next
// 0 component1
// 0 component2
// 1 ARRAYLENGTH
// 1 ARRAYLENGTH

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test() {
var s = ""
for (c in "testString") {

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
val cs: CharSequence = "abcd"
fun box(): String {
@@ -20,4 +18,4 @@ fun box(): String {
// 0 component1
// 0 component2
// 1 length
// 1 charAt
// 1 charAt

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun box(): String {
for ((index, x) in "".withIndex()) {
return "Loop over empty String should not be executed"
@@ -14,4 +12,4 @@ fun box(): String {
// 0 component1
// 0 component2
// 1 length
// 1 charAt
// 1 charAt

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun box(): String {
val s = StringBuilder()
@@ -18,4 +16,4 @@ fun box(): String {
// 0 component1
// 0 component2
// 1 length
// 1 charAt
// 1 charAt

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
val xs = "abcd"
fun box(): String {
@@ -20,4 +18,4 @@ fun box(): String {
// 0 component1
// 0 component2
// 1 length
// 0 charAt
// 0 charAt

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
val xs = "abcd"
fun box(): String {
@@ -20,4 +18,4 @@ fun box(): String {
// 0 component1
// 0 component2
// 1 length
// 1 charAt
// 1 charAt

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
val xs = "abcd"
fun useAny(x: Any) {}
@@ -23,4 +21,4 @@ fun box(): String {
// 0 component1
// 0 component2
// 1 length
// 1 charAt
// 1 charAt

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test(s: CharSequence): Int {
var result = 0
for (i in s.indices) {
@@ -16,4 +14,4 @@ fun test(s: CharSequence): Int {
// 0 IF_ICMPGT
// 0 IF_ICMPEQ
// 1 IF_ICMPGE
// 1 IF_ICMPGE

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun Collection<Int>.sumIndices(): Int {
var sum = 0
for (i in indices) {
@@ -16,4 +14,4 @@ fun Collection<Int>.sumIndices(): Int {
// 0 IF_ICMPGT
// 0 IF_ICMPEQ
// 1 IF_ICMPGE
// 1 IF_ICMPGE

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test() {
var sum = 0
for (i in listOf(0, 0, 0, 0).indices) {
@@ -15,4 +13,4 @@ fun test() {
// 0 IF_ICMPGT
// 0 IF_ICMPEQ
// 1 IF_ICMPGE
// 1 IF_ICMPGE

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
import kotlin.test.assertEquals
fun test(coll: Collection<*>?): Int {

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test() {
var sum = 0
for (i in arrayOf("", "", "", "").indices) {
@@ -15,4 +13,4 @@ fun test() {
// 0 IF_ICMPGT
// 0 IF_ICMPEQ
// 1 IF_ICMPGE
// 1 IF_ICMPGE

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test() {
var sum = 0
for (i in intArrayOf(0, 0, 0, 0).indices) {
@@ -15,4 +13,4 @@ fun test() {
// 0 IF_ICMPGT
// 0 IF_ICMPEQ
// 1 IF_ICMPGE
// 1 IF_ICMPGE

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
val xs = listOf<Any>()
fun box(): String {
@@ -15,4 +13,4 @@ fun box(): String {
// 1 hasNext
// 1 next
// 0 component1
// 0 component2
// 0 component2

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
val xs = listOf("a", "b", "c", "d")
fun box(): String {
@@ -18,4 +16,4 @@ fun box(): String {
// 1 hasNext
// 1 next
// 0 component1
// 0 component2
// 0 component2

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
val xs = listOf("a", "b", "c", "d")
fun box(): String {
@@ -18,4 +16,4 @@ fun box(): String {
// 1 hasNext
// 1 next
// 0 component1
// 0 component2
// 0 component2

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
val xs = listOf("a", "b", "c", "d")
fun box(): String {
@@ -18,4 +16,4 @@ fun box(): String {
// 1 hasNext
// 1 next
// 0 component1
// 0 component2
// 0 component2

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
val xs = listOf("a", "b", "c", "d")
fun useAny(x: Any) {}
@@ -21,4 +19,4 @@ fun box(): String {
// 1 hasNext
// 1 next
// 0 component1
// 0 component2
// 0 component2

View File

@@ -1,4 +1,3 @@
// WITH_RUNTIME
import kotlin.test.*
fun intRange() = 1 .. 4
@@ -27,4 +26,4 @@ fun box(): String {
return "OK"
}
// 0 reversed
// 0 reversed

View File

@@ -1,4 +1,3 @@
// WITH_RUNTIME
import kotlin.test.*
fun box(): String {
@@ -12,4 +11,4 @@ fun box(): String {
return "OK"
}
// 0 reversed
// 0 reversed

View File

@@ -1,4 +1,3 @@
// WITH_RUNTIME
import kotlin.test.*
fun box(): String {
@@ -12,4 +11,4 @@ fun box(): String {
return "OK"
}
// 0 reversed
// 0 reversed

View File

@@ -1,4 +1,3 @@
// WITH_RUNTIME
import kotlin.test.*
fun box(): String {
@@ -12,4 +11,4 @@ fun box(): String {
return "OK"
}
// 0 reversed
// 0 reversed

View File

@@ -1,4 +1,3 @@
// WITH_RUNTIME
import kotlin.test.*
fun box(): String {
@@ -23,4 +22,4 @@ fun box(): String {
return "OK"
}
// 0 reversed
// 0 reversed

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun box(): String {
for (i in (4 .. 1).reversed()) {
throw AssertionError("Loop should not be executed")
@@ -18,4 +16,4 @@ fun box(): String {
// 0 getEnd
// 0 getFirst
// 0 getLast
// 0 getStep
// 0 getStep

View File

@@ -1,4 +1,3 @@
// WITH_RUNTIME
import kotlin.test.*
fun intRange() = 1 .. 4
@@ -27,4 +26,4 @@ fun box(): String {
return "OK"
}
// 0 reversed
// 0 reversed

View File

@@ -1,4 +1,3 @@
// WITH_RUNTIME
import kotlin.test.*
fun box(): String {
@@ -32,4 +31,4 @@ fun box(): String {
// 0 IFEQ
// 0 IF_ICMPEQ
// 2 IF_ICMPLT
// 1 LCMP
// 1 LCMP

View File

@@ -1,4 +1,3 @@
// WITH_RUNTIME
import kotlin.test.*
fun intRange() = 1 .. 4
@@ -27,4 +26,4 @@ fun box(): String {
return "OK"
}
// 0 reversed
// 0 reversed

View File

@@ -1,4 +1,3 @@
// WITH_RUNTIME
import kotlin.test.*
fun box(): String {
@@ -20,4 +19,4 @@ fun box(): String {
return "OK"
}
// 0 reversed
// 0 reversed

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
val xs = listOf<Any>().asSequence()
fun box(): String {
@@ -15,4 +13,4 @@ fun box(): String {
// 1 hasNext
// 1 next
// 0 component1
// 0 component2
// 0 component2

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
val xs = listOf("a", "b", "c", "d").asSequence()
fun box(): String {
@@ -18,4 +16,4 @@ fun box(): String {
// 1 hasNext
// 1 next
// 0 component1
// 0 component2
// 0 component2

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
val xs = listOf("a", "b", "c", "d").asSequence()
fun box(): String {
@@ -18,4 +16,4 @@ fun box(): String {
// 1 hasNext
// 1 next
// 0 component1
// 0 component2
// 0 component2

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
val xs = listOf("a", "b", "c", "d").asSequence()
fun box(): String {
@@ -18,4 +16,4 @@ fun box(): String {
// 1 hasNext
// 1 next
// 0 component1
// 0 component2
// 0 component2

View File

@@ -1,6 +1,4 @@
// IGNORE_BACKEND: JS, NATIVE
// FULL_JDK
// WITH_RUNTIME
val xsl = arrayListOf("a", "b", "c", "d")
val xs = xsl.asSequence()
@@ -29,4 +27,4 @@ fun box(): String {
// 1 hasNext
// 1 next
// 0 component1
// 0 component2
// 0 component2

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
val xs = listOf("a", "b", "c", "d").asSequence()
fun useAny(x: Any) {}
@@ -21,4 +19,4 @@ fun box(): String {
// 1 hasNext
// 1 next
// 0 component1
// 0 component2
// 0 component2

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test() {
var s = ""
for (c in "testString") {

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test(): Int {
var sum = 0
for (i in 1 until 6) {
@@ -13,4 +11,4 @@ fun test(): Int {
// 0 getEnd
// 0 getFirst
// 0 getLast
// 1 IF
// 1 IF

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test(): Int {
var sum = 0
for (i in 4 downTo 1) {
@@ -14,4 +12,4 @@ fun test(): Int {
// 0 getFirst
// 0 getLast
// 0 IF_ICMPEQ
// 1 IF_ICMPLT
// 1 IF_ICMPLT

View File

@@ -1,5 +1,4 @@
// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND: JVM_IR
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-hI9h0ro\(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

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun uint(vararg us: UInt): UIntArray = us
// FILE: NoBoxing.kt
@@ -23,4 +21,4 @@ fun test2(nullable: UInt?, ns: Array<UInt>) {
// @BoxingKt.class:
// 2 INVOKESTATIC kotlin.UInt\.box
// 0 INVOKEVIRTUAL kotlin.UInt.unbox
// 0 INVOKEVIRTUAL kotlin.UInt.unbox

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
class A {
}

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
class A {
}

View File

@@ -1,6 +1,5 @@
// !JVM_DEFAULT_MODE: compatibility
// JVM_TARGET: 1.8
// WITH_RUNTIME
// FULL_JDK
interface KInterface {

View File

@@ -1,6 +1,5 @@
// !JVM_DEFAULT_MODE: compatibility
// JVM_TARGET: 1.8
// WITH_RUNTIME
interface KInterface {

View File

@@ -1,6 +1,3 @@
// WITH_RUNTIME
// TARGET_BACKEND: JVM
// FILE: Dummy.kt
// Empty body to trigger multifile test mode

View File

@@ -1,4 +1,3 @@
// WITH_RUNTIME
// KOTLIN_CONFIGURATION_FLAGS: +JVM.INHERIT_MULTIFILE_PARTS
// FILE: bar.kt

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test1() {
val a = null
@@ -15,4 +13,4 @@ fun test1() {
// 0 IFNULL
// 0 IFNONNULL
// 0 X1
// 1 X2
// 1 X2

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
// FILE: test.kt
fun test1() {
@@ -16,4 +14,4 @@ fun test1() {
// 0 X3
// 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()

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test1() {
val a = Unit
@@ -15,4 +13,4 @@ fun test1() {
// 0 IFNULL
// 0 IFNONNULL
// 1 X1
// 0 X2
// 0 X2

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
// FILE: test.kt
fun test1(): String {
@@ -15,4 +13,4 @@ fun test1(): String {
// FILE: inline.kt
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)

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test() {
val value = System.getProperty("key")
if (value != null) {
@@ -8,4 +6,4 @@ fun test() {
}
// 1 IFNULL
// 0 IFNONNULL
// 0 IFNONNULL

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun testPrimitiveArray(i: Int, ints: IntArray) = i in ints.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
// 4 ARRAYLENGTH
// 2 LCONST_0
// 6 ICONST_0
// 6 ICONST_0

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun testCharSequence(i: Int, cs: CharSequence) = i in cs.indices
fun testLongWithCharSequence(i: Long, cs: CharSequence) = i in cs.indices

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun testCollection(i: Int, xs: List<Any>) = i in xs.indices
fun testLongWithCollection(i: Long, xs: List<Any>) = i in xs.indices

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun inInt(x: Long): Boolean {
return x in 1..2
}

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
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 shortInFloat(x: Short, a: Float, b: Float) = x in a .. b

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun Byte.inByte(left: Byte, right: Byte) = this in left..right
fun Short.inInt(left: Int, right: Int) = this in left .. right

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
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
@@ -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
// 0 until
// 0 INVOKEVIRTUAL
// 0 INVOKEVIRTUAL

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun test(a: Int) = a in 1 .. 10
fun test(a: Long) = a in 1L .. 10L
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 DUP2_X1
// 0 DUP_X2
// 0 DUP2_X2
// 0 DUP2_X2

View File

@@ -1,4 +1,3 @@
// WITH_RUNTIME
// FILE: JFoo.java
import org.jetbrains.annotations.Nullable;
@@ -23,4 +22,4 @@ fun test() {
// 1 INVOKESPECIAL TestKt\$test\$1.<init>
// 0 IFNONNULL
// 0 IFNULL
// 1 ACONST_NULL
// 1 ACONST_NULL

View File

@@ -1,4 +1,3 @@
// WITH_RUNTIME
// FILE: JFoo.java
import org.jetbrains.annotations.Nullable;
@@ -21,4 +20,4 @@ fun test() {
// 2 NEW
// 0 IFNONNULL
// 1 IFNULL
// 1 ACONST_NULL
// 1 ACONST_NULL

View File

@@ -1,5 +1,3 @@
// WITH_RUNTIME
fun findUserId(username: String): Long? = null
fun main(args: Array<String>) {
@@ -11,4 +9,4 @@ fun main(args: Array<String>) {
}
}
// 0 areEqual
// 0 areEqual