Add ir interpreter tests

This commit is contained in:
Ivan Kylchik
2021-05-19 16:27:03 +03:00
committed by TeamCityServer
parent cc2d7340dc
commit e28ab45c51
115 changed files with 5104 additions and 0 deletions
@@ -0,0 +1,13 @@
package kotlin
public inline infix fun Byte.and(other: Byte): Byte = (this.toInt() and other.toInt()).toByte()
public inline infix fun Byte.or(other: Byte): Byte = (this.toInt() or other.toInt()).toByte()
public inline infix fun Byte.xor(other: Byte): Byte = (this.toInt() xor other.toInt()).toByte()
public inline fun Byte.inv(): Byte = (this.toInt().inv()).toByte()
public inline infix fun Short.and(other: Short): Short = (this.toInt() and other.toInt()).toShort()
public inline infix fun Short.or(other: Short): Short = (this.toInt() or other.toInt()).toShort()
public inline infix fun Short.xor(other: Short): Short = (this.toInt() xor other.toInt()).toShort()
public inline fun Short.inv(): Short = (this.toInt().inv()).toShort()
@@ -0,0 +1,29 @@
package kotlin
public inline val Char.code: Int get() = this.toInt()
expect fun Double.isNaN(): Boolean
expect fun Float.isNaN(): Boolean
public data class Pair<out A, out B>(public val first: A, public val second: B) : Serializable {
public override fun toString(): String = "($first, $second)"
}
public infix fun <A, B> A.to(that: B): Pair<A, B> = Pair(this, that)
public fun <T> Pair<T, T>.toList(): List<T> = listOf(first, second)
public data class Triple<out A, out B, out C>(
public val first: A, public val second: B, public val third: C
) : Serializable {
public override fun toString(): String = "($first, $second, $third)"
}
public fun <T> Triple<T, T, T>.toList(): List<T> = listOf(first, second, third)
public fun checkIndexOverflow(index: Int): Int {
if (index < 0) {
throw kotlin.ArithmeticException("Index overflow has happened.")
}
return index
}
@@ -0,0 +1,4 @@
package kotlin.experimental
//Will return file and line number there this function was called
inline fun sourceLocation(): String = throw kotlin.UnsupportedOperationException("Implemented as intrinsic")