Move IR interpreter's tests from ir/loweredIr directory into box
This commit is contained in:
+29
@@ -0,0 +1,29 @@
|
||||
// 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"
|
||||
const val withWhen = when (flag) {
|
||||
true -> "True"
|
||||
else -> "Error"
|
||||
}
|
||||
const val withWhen2 = when {
|
||||
flag == true -> "True"
|
||||
else -> "Error"
|
||||
}
|
||||
const val withWhen3 = when(value) {
|
||||
10 -> "1"
|
||||
100 -> "2"
|
||||
else -> "3"
|
||||
}
|
||||
const val multibranchIf = if (value == 100) 1 else if (value == 1000) 2 else 3
|
||||
|
||||
fun box(): String {
|
||||
if (condition != "True") return "Fail 1"
|
||||
if (withWhen != "True") return "Fail 2"
|
||||
if (withWhen2 != "True") return "Fail 3"
|
||||
if (withWhen3 != "1") return "Fail 4"
|
||||
if (multibranchIf != 3) return "Fail 5"
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user