summary refs log tree commit diff stats
path: root/tests/stdlib/tvolatile.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stdlib/tvolatile.nim')
-rw-r--r--tests/stdlib/tvolatile.nim15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/stdlib/tvolatile.nim b/tests/stdlib/tvolatile.nim
new file mode 100644
index 000000000..c097f9723
--- /dev/null
+++ b/tests/stdlib/tvolatile.nim
@@ -0,0 +1,15 @@
+import std/[volatile, assertions]
+
+var st: int
+var foo: ptr int = addr st
+volatileStore(foo, 12)
+doAssert volatileLoad(foo) == 12
+
+# bug #14623
+proc bar =
+  var st: int
+  var foo: ptr int = addr st
+  volatileStore(foo, 12)
+  doAssert volatileLoad(foo) == 12
+
+bar()