diff options
| author | Vexu <15308111+Vexu@users.noreply.github.com> | 2019-11-13 00:25:44 +0200 |
|---|---|---|
| committer | Vexu <15308111+Vexu@users.noreply.github.com> | 2019-11-13 00:25:44 +0200 |
| commit | 110ef2e52825656fc048cba020f0fc36a1e58d13 (patch) | |
| tree | cae3ae95a6ce44f85650c44b90365f7cc5cb4045 /test | |
| parent | 956ba8b0e7ada08f2f85cd41ee73af6453db0c16 (diff) | |
| download | zig-110ef2e52825656fc048cba020f0fc36a1e58d13.tar.gz zig-110ef2e52825656fc048cba020f0fc36a1e58d13.zip | |
add @atomicStore builtin
Diffstat (limited to 'test')
| -rw-r--r-- | test/stage1/behavior/atomics.zig | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/stage1/behavior/atomics.zig b/test/stage1/behavior/atomics.zig index c6344b17ca..9e41863fd1 100644 --- a/test/stage1/behavior/atomics.zig +++ b/test/stage1/behavior/atomics.zig @@ -123,3 +123,11 @@ test "atomic load and rmw with enum" { expect(@atomicLoad(Value, &x, .SeqCst) != .a); expect(@atomicLoad(Value, &x, .SeqCst) != .b); } + +test "atomic store" { + var x: u32 = 0; + @atomicStore(u32, &x, 1, .SeqCst); + expect(@atomicLoad(u32, &x, .SeqCst) == 1); + @atomicStore(u32, &x, 12345678, .SeqCst); + expect(@atomicLoad(u32, &x, .SeqCst) == 12345678); +}
\ No newline at end of file |
