Move IR interpreter's tests from ir/loweredIr directory into box
This commit is contained in:
+2
@@ -1,3 +1,5 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
|
||||
const val trueVal = true
|
||||
const val falseVal = false
|
||||
|
||||
+11
-8
@@ -1,3 +1,6 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_K1: JVM_IR
|
||||
|
||||
const val minusOneVal = (-1).toByte()
|
||||
const val oneVal = 1.toByte()
|
||||
const val twoVal = 2.toByte()
|
||||
@@ -97,14 +100,14 @@ fun box(): String {
|
||||
if (compareTo7 != 0) return "Fail 1.7"
|
||||
if (compareTo8 != 0) return "Fail 1.8"
|
||||
|
||||
if (plus1 != 3) return "Fail 2.1"
|
||||
if (plus2 != 4) return "Fail 2.2"
|
||||
if (plus3 != 5) return "Fail 2.3"
|
||||
if (plus4 != 4) return "Fail 2.4"
|
||||
if (plus5 != 4) return "Fail 2.5"
|
||||
if (plus6 != 4) return "Fail 2.6"
|
||||
if (plus7 != 4) return "Fail 2.7"
|
||||
if (plus8 != 4) return "Fail 2.8"
|
||||
if (plus1 != 3) return "Fail 2.1"
|
||||
if (plus2 != 4) return "Fail 2.2"
|
||||
if (plus3 != 5) return "Fail 2.3"
|
||||
if (plus4 != 4) return "Fail 2.4"
|
||||
if (plus5 != 4) return "Fail 2.5"
|
||||
if (plus6 != 4) return "Fail 2.6"
|
||||
if (plus7 != 4.0f) return "Fail 2.7"
|
||||
if (plus8 != 4.0f) return "Fail 2.8"
|
||||
|
||||
if (minus1 != -1) return "Fail 3.1"
|
||||
if (minus2 != 0) return "Fail 3.2"
|
||||
+2
@@ -1,4 +1,6 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// WITH_STDLIB
|
||||
|
||||
const val oneVal = '1'
|
||||
const val twoVal = '2'
|
||||
const val threeVal = '3'
|
||||
+3
@@ -1,4 +1,7 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_K1: JVM_IR
|
||||
// WITH_STDLIB
|
||||
|
||||
const val trimIndent = "123".trimIndent()
|
||||
const val complexTrimIndent =
|
||||
"""
|
||||
+3
@@ -1,4 +1,7 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_K1: JVM_IR
|
||||
// WITH_STDLIB
|
||||
|
||||
const val trimMargin = "123".trimMargin()
|
||||
|
||||
const val trimMarginDefault = """ABC
|
||||
+11
-8
@@ -1,3 +1,6 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_K1: JVM_IR
|
||||
|
||||
const val minusOneVal = -1.0
|
||||
const val oneVal = 1.0
|
||||
const val twoVal = 2.0
|
||||
@@ -95,14 +98,14 @@ fun box(): String {
|
||||
if (compareTo7 != 0) return "Fail 1.7"
|
||||
if (compareTo8 != 0) return "Fail 1.8"
|
||||
|
||||
if (plus1 != 3) return "Fail 2.1"
|
||||
if (plus2 != 4) return "Fail 2.2"
|
||||
if (plus3 != 5) return "Fail 2.3"
|
||||
if (plus4 != 4) return "Fail 2.4"
|
||||
if (plus5 != 4) return "Fail 2.5"
|
||||
if (plus6 != 4) return "Fail 2.6"
|
||||
if (plus7 != 4) return "Fail 2.7"
|
||||
if (plus8 != 4) return "Fail 2.8"
|
||||
if (plus1 != 3) return "Fail 2.1"
|
||||
if (plus2 != 4) return "Fail 2.2"
|
||||
if (plus3 != 5) return "Fail 2.3"
|
||||
if (plus4 != 4) return "Fail 2.4"
|
||||
if (plus5 != 4) return "Fail 2.5"
|
||||
if (plus6 != 4) return "Fail 2.6"
|
||||
if (plus7 != 4.0f) return "Fail 2.7"
|
||||
if (plus8 != 4.0) return "Fail 2.8"
|
||||
|
||||
if (minus1 != -1) return "Fail 3.1"
|
||||
if (minus2 != 0) return "Fail 3.2"
|
||||
+3
@@ -1,3 +1,6 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_K1: JVM_IR
|
||||
|
||||
enum class EnumClass {
|
||||
OK, VALUE, anotherValue, WITH_UNDERSCORE
|
||||
}
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_K1: JVM_IR
|
||||
// IGNORE_FIR_DIAGNOSTICS
|
||||
// !DIAGNOSTICS: -UNINITIALIZED_ENUM_ENTRY
|
||||
|
||||
+11
-8
@@ -1,3 +1,6 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_K1: JVM_IR
|
||||
|
||||
const val minusOneVal = -1.0f
|
||||
const val oneVal = 1.0f
|
||||
const val twoVal = 2.0f
|
||||
@@ -95,14 +98,14 @@ fun box(): String {
|
||||
if (compareTo7 != 0) return "Fail 1.7"
|
||||
if (compareTo8 != 0) return "Fail 1.8"
|
||||
|
||||
if (plus1 != 3) return "Fail 2.1"
|
||||
if (plus2 != 4) return "Fail 2.2"
|
||||
if (plus3 != 5) return "Fail 2.3"
|
||||
if (plus4 != 4) return "Fail 2.4"
|
||||
if (plus5 != 4) return "Fail 2.5"
|
||||
if (plus6 != 4) return "Fail 2.6"
|
||||
if (plus7 != 4) return "Fail 2.7"
|
||||
if (plus8 != 4) return "Fail 2.8"
|
||||
if (plus1 != 3) return "Fail 2.1"
|
||||
if (plus2 != 4) return "Fail 2.2"
|
||||
if (plus3 != 5) return "Fail 2.3"
|
||||
if (plus4 != 4) return "Fail 2.4"
|
||||
if (plus5 != 4) return "Fail 2.5"
|
||||
if (plus6 != 4) return "Fail 2.6"
|
||||
if (plus7 != 4.0f) return "Fail 2.7"
|
||||
if (plus8 != 4.0) return "Fail 2.8"
|
||||
|
||||
if (minus1 != -1) return "Fail 3.1"
|
||||
if (minus2 != 0) return "Fail 3.2"
|
||||
+3
@@ -1,3 +1,6 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_K1: JVM_IR
|
||||
|
||||
const val flag = true
|
||||
const val value = 10
|
||||
const val condition = if (flag) "True" else "Error"
|
||||
+11
-8
@@ -1,3 +1,6 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_K1: JVM_IR
|
||||
|
||||
const val minusOneVal = -1
|
||||
const val oneVal = 1
|
||||
const val twoVal = 2
|
||||
@@ -97,14 +100,14 @@ fun box(): String {
|
||||
if (compareTo7 != 0) return "Fail 1.7"
|
||||
if (compareTo8 != 0) return "Fail 1.8"
|
||||
|
||||
if (plus1 != 3) return "Fail 2.1"
|
||||
if (plus2 != 4) return "Fail 2.2"
|
||||
if (plus3 != 5) return "Fail 2.3"
|
||||
if (plus4 != 4) return "Fail 2.4"
|
||||
if (plus5 != 4) return "Fail 2.5"
|
||||
if (plus6 != 4) return "Fail 2.6"
|
||||
if (plus7 != 4) return "Fail 2.7"
|
||||
if (plus8 != 4) return "Fail 2.8"
|
||||
if (plus1 != 3) return "Fail 2.1"
|
||||
if (plus2 != 4) return "Fail 2.2"
|
||||
if (plus3 != 5) return "Fail 2.3"
|
||||
if (plus4 != 4) return "Fail 2.4"
|
||||
if (plus5 != 4) return "Fail 2.5"
|
||||
if (plus6 != 4) return "Fail 2.6"
|
||||
if (plus7 != 4.0f) return "Fail 2.7"
|
||||
if (plus8 != 4.0) return "Fail 2.8"
|
||||
|
||||
if (minus1 != -1) return "Fail 3.1"
|
||||
if (minus2 != 0) return "Fail 3.2"
|
||||
+3
@@ -1,3 +1,6 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_K1: JVM_IR
|
||||
|
||||
class A(val OK: Int, val somePropertyWithLongName: String) {
|
||||
fun foo() {}
|
||||
}
|
||||
+3
@@ -1,3 +1,6 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_K1: JVM_IR
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
const val name = E.OK.name
|
||||
+11
-8
@@ -1,3 +1,6 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_K1: JVM_IR
|
||||
|
||||
const val minusOneVal = -1L
|
||||
const val oneVal = 1L
|
||||
const val twoVal = 2L
|
||||
@@ -97,14 +100,14 @@ fun box(): String {
|
||||
if (compareTo7 != 0) return "Fail 1.7"
|
||||
if (compareTo8 != 0) return "Fail 1.8"
|
||||
|
||||
if (plus1 != 3) return "Fail 2.1"
|
||||
if (plus2 != 4) return "Fail 2.2"
|
||||
if (plus3 != 5) return "Fail 2.3"
|
||||
if (plus4 != 4) return "Fail 2.4"
|
||||
if (plus5 != 4) return "Fail 2.5"
|
||||
if (plus6 != 4) return "Fail 2.6"
|
||||
if (plus7 != 4) return "Fail 2.7"
|
||||
if (plus8 != 4) return "Fail 2.8"
|
||||
if (plus1 != 3) return "Fail 2.1"
|
||||
if (plus2 != 4) return "Fail 2.2"
|
||||
if (plus3 != 5) return "Fail 2.3"
|
||||
if (plus4 != 4) return "Fail 2.4"
|
||||
if (plus5 != 4) return "Fail 2.5"
|
||||
if (plus6 != 4) return "Fail 2.6"
|
||||
if (plus7 != 4.0f) return "Fail 2.7"
|
||||
if (plus8 != 4.0) return "Fail 2.8"
|
||||
|
||||
if (minus1 != -1) return "Fail 3.1"
|
||||
if (minus2 != 0) return "Fail 3.2"
|
||||
+11
-8
@@ -1,3 +1,6 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_K1: JVM_IR
|
||||
|
||||
const val minusOneVal = (-1).toShort()
|
||||
const val oneVal = 1.toShort()
|
||||
const val twoVal = 2.toShort()
|
||||
@@ -97,14 +100,14 @@ fun box(): String {
|
||||
if (compareTo7 != 0) return "Fail 1.7"
|
||||
if (compareTo8 != 0) return "Fail 1.8"
|
||||
|
||||
if (plus1 != 3) return "Fail 2.1"
|
||||
if (plus2 != 4) return "Fail 2.2"
|
||||
if (plus3 != 5) return "Fail 2.3"
|
||||
if (plus4 != 4) return "Fail 2.4"
|
||||
if (plus5 != 4) return "Fail 2.5"
|
||||
if (plus6 != 4) return "Fail 2.6"
|
||||
if (plus7 != 4) return "Fail 2.7"
|
||||
if (plus8 != 4) return "Fail 2.8"
|
||||
if (plus1 != 3) return "Fail 2.1"
|
||||
if (plus2 != 4) return "Fail 2.2"
|
||||
if (plus3 != 5) return "Fail 2.3"
|
||||
if (plus4 != 4) return "Fail 2.4"
|
||||
if (plus5 != 4) return "Fail 2.5"
|
||||
if (plus6 != 4) return "Fail 2.6"
|
||||
if (plus7 != 4.0f) return "Fail 2.7"
|
||||
if (plus8 != 4.0) return "Fail 2.8"
|
||||
|
||||
if (minus1 != -1) return "Fail 3.1"
|
||||
if (minus2 != 0) return "Fail 3.2"
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// WITH_STDLIB
|
||||
|
||||
const val code = '1'.code
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
|
||||
const val someStr = "123"
|
||||
const val otherStr = "other"
|
||||
|
||||
+2
@@ -1,4 +1,6 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// WITH_STDLIB
|
||||
|
||||
const val byteVal: UByte = 1u
|
||||
const val shortVal: UShort = 2u
|
||||
const val intVal: UInt = 3u
|
||||
+1
-2
@@ -1,3 +1,4 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// This test is needed to check that IrCompileTimeChecker will not fail trying to find and analyze correct toString method
|
||||
|
||||
object Obj {
|
||||
@@ -6,8 +7,6 @@ object Obj {
|
||||
fun Int.toString(): String = "Not OK"
|
||||
}
|
||||
|
||||
const val a = 1 // this is a dummy const to avoid check in IrInterpreterDumpHandler
|
||||
|
||||
fun box(): String {
|
||||
return "" + "$Obj" // force a call
|
||||
}
|
||||
Reference in New Issue
Block a user