diff options
author | flywind <43030857+xflywind@users.noreply.github.com> | 2020-11-25 21:09:03 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-25 14:09:03 +0100 |
commit | 7848da7abe683f98019f54f9b99ce531c99e7eaf (patch) | |
tree | effa403371a5355bbac60564d00a41f5f3f6fd64 /tests | |
parent | e220f756e795b972b72d4e8b9d729d1d9b73d2e2 (diff) | |
download | Nim-7848da7abe683f98019f54f9b99ce531c99e7eaf.tar.gz |
inc and dec are atomic in JS backend (#16129)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/system/tatomics1.nim | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/system/tatomics1.nim b/tests/system/tatomics1.nim new file mode 100644 index 000000000..88ab705a8 --- /dev/null +++ b/tests/system/tatomics1.nim @@ -0,0 +1,9 @@ +discard """ + target: "c cpp js" +""" + +var x = 10 +atomicInc(x) +doAssert x == 11 +atomicDec(x) +doAssert x == 10 |