Files
kotlin-fork/compiler/testData/codegen/box/constants/doNotTriggerInit.kt
T
Svyatoslav Kuzmich a3e2d2804c [Wasm] Update testData after adding K2 and new test infra support.
- Actualize muted K2 tests
- Actualize muted K1 tests with module systems because legacy Wasm test
  infra had no respect for "// MODULE: ..." test directives
2023-06-25 10:20:40 +02:00

19 lines
367 B
Kotlin
Vendored

// IGNORE_BACKEND_K1: WASM
// IGNORE_BACKEND_K1: JS_IR, JS_IR_ES6
var initialized = 0
object O {
init {
initialized += 1
}
const val x = 1
val y = 2
}
fun box() : String {
if (O.x != 1) return "FAIL 1"
if (initialized != 0) return "FAIL 2"
if (O.y != 2) return "FAIL 3"
if (initialized != 1) return "FAIL 4"
return "OK"
}