Files
kotlin-fork/compiler/testData/codegen/box/volatile/volatileByte.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
445 B
Kotlin
Vendored

// WITH_STDLIB
// IGNORE_BACKEND: JS
// IGNORE_BACKEND_K1: WASM, JS_IR, JS_IR_ES6
// !API_VERSION: 1.9
import kotlin.concurrent.*
@OptIn(kotlin.ExperimentalStdlibApi::class)
class ByteWrapper(@Volatile var x: Byte)
val global = ByteWrapper(1)
fun box() : String {
val local = ByteWrapper(2)
if (global.x + local.x != 3) return "FAIL"
global.x = 5
local.x = 6
return if (global.x + local.x != 11) return "FAIL" else "OK"
}