KT-36932 Add required functions for IR interpreter tests
diff --git a/compiler/testData/ir/interpreter/helpers/Standard.kt b/compiler/testData/ir/interpreter/helpers/Standard.kt
index 2912dac..b6848f0 100644
--- a/compiler/testData/ir/interpreter/helpers/Standard.kt
+++ b/compiler/testData/ir/interpreter/helpers/Standard.kt
@@ -41,3 +41,5 @@
action(index)
}
}
+
+public inline fun error(message: Any): Nothing = throw IllegalStateException(message.toString())
diff --git a/compiler/testData/ir/interpreter/helpers/floorDivMod.kt b/compiler/testData/ir/interpreter/helpers/floorDivMod.kt
new file mode 100644
index 0000000..2da8f3e
--- /dev/null
+++ b/compiler/testData/ir/interpreter/helpers/floorDivMod.kt
@@ -0,0 +1,11 @@
+package kotlin
+
+public inline fun Int.mod(other: Int): Int {
+ val r = this % other
+ return r + (other and (((r xor other) and (r or -r)) shr 31))
+}
+
+public inline fun Long.mod(other: Long): Long {
+ val r = this % other
+ return r + (other and (((r xor other) and (r or -r)) shr 63))
+}