summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--lib/system.nim2
-rw-r--r--tests/system/tatomics1.nim9
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/system.nim b/lib/system.nim
index be41c1893..68385ef63 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -1774,7 +1774,7 @@ when not defined(nimscript):
 when not declared(sysFatal):
   include "system/fatal"
 
-when notJSnotNims:
+when not defined(nimscript):
   {.push stackTrace: off, profiler: off.}
 
   proc atomicInc*(memLoc: var int, x: int = 1): int {.inline,
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