[IR] Add id method in interpreter's tests to avoid optimizations

This commit is contained in:
Ivan Kylchik
2023-04-11 17:23:11 +02:00
committed by Space Team
parent 621f5a0fb7
commit 3f60c83921
20 changed files with 552 additions and 532 deletions
@@ -2,6 +2,7 @@
// TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_K1: JVM_IR
// WITH_STDLIB
fun <T> T.id() = this
const val trimIndent = "123".<!EVALUATED("123")!>trimIndent()<!>
const val complexTrimIndent =
@@ -12,7 +13,7 @@ const val complexTrimIndent =
""".<!EVALUATED("ABC\n123\n456")!>trimIndent()<!>
fun box(): String {
if (<!EVALUATED("false")!>trimIndent != "123"<!>) return "Fail 1"
if (<!EVALUATED("false")!>complexTrimIndent != "ABC\n123\n456"<!>) return "Fail 2"
if (<!EVALUATED("123")!>trimIndent<!>.id() != "123") return "Fail 1"
if (<!EVALUATED("ABC\n123\n456")!>complexTrimIndent<!>.id() != "ABC\n123\n456") return "Fail 2"
return "OK"
}