[K/N] Tests for volatile
^KT-54944
This commit is contained in:
committed by
Space Team
parent
a11f6fd9cb
commit
fc95b88eef
@@ -0,0 +1,26 @@
|
||||
// TARGET_BACKEND: NATIVE
|
||||
// test is disabled now because of https://youtrack.jetbrains.com/issue/KT-55426
|
||||
// IGNORE_BACKEND: NATIVE
|
||||
|
||||
// MODULE: lib
|
||||
// FILE: lib.kt
|
||||
@file:OptIn(kotlin.ExperimentalStdlibApi::class)
|
||||
|
||||
import kotlin.native.concurrent.*
|
||||
import kotlin.concurrent.*
|
||||
|
||||
class Box(@Volatile var value: String)
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: main.kt
|
||||
|
||||
@file:Suppress("INVISIBLE_MEMBER")
|
||||
|
||||
import kotlin.native.concurrent.*
|
||||
import kotlin.concurrent.*
|
||||
|
||||
fun box() : String {
|
||||
val o = "O"
|
||||
val x = Box(o)
|
||||
return x.compareAndSwapField(Box::value, o, "K") + x.value
|
||||
}
|
||||
Reference in New Issue
Block a user