[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,15 +2,16 @@
// TARGET_BACKEND: NATIVE
// TARGET_BACKEND: JS_IR
// WITH_STDLIB
fun <T> T.id() = this
const val code = '1'.<!EVALUATED("49")!>code<!>
const val floorDiv = 10.<!EVALUATED("5")!>floorDiv(2)<!>
const val mod = 5.<!EVALUATED("2")!>mod(3)<!>
fun box(): String {
if (<!EVALUATED("false")!>code != 49<!>) return "Fail 1"
if (<!EVALUATED("false")!>floorDiv != 5<!>) return "Fail 2"
if (<!EVALUATED("false")!>mod != 2<!>) return "Fail 3"
if (<!EVALUATED("49")!>code<!>.id() != 49) return "Fail 1"
if (<!EVALUATED("5")!>floorDiv<!>.id() != 5) return "Fail 2"
if (<!EVALUATED("2")!>mod<!>.id() != 2) return "Fail 3"
return "OK"
}