summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-11-27 09:41:36 +0100
committerAraq <rumpf_a@web.de>2014-11-27 09:41:36 +0100
commitc2b223688d032947dbf9dd28760d9fe89745fe76 (patch)
tree66bd81a85f6ca93605fba3aba040ef8f8ee274e1 /tests
parenteb69b81859864d8a47272c397971609e56a6d399 (diff)
downloadNim-c2b223688d032947dbf9dd28760d9fe89745fe76.tar.gz
fixes #1539
Diffstat (limited to 'tests')
-rw-r--r--tests/ccgbugs/tmissingvolatile.nim20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ccgbugs/tmissingvolatile.nim b/tests/ccgbugs/tmissingvolatile.nim
new file mode 100644
index 000000000..4d25e5c22
--- /dev/null
+++ b/tests/ccgbugs/tmissingvolatile.nim
@@ -0,0 +1,20 @@
+discard """
+  output: "1"
+  cmd: r"nim c --hints:on $options -d:release $file"
+  ccodecheck: "'NI volatile state;'"
+"""
+
+# bug #1539
+
+proc err() =
+  raise newException(Exception, "test")
+
+proc main() =
+  var state: int
+  try:
+    state = 1
+    err()
+  except:
+    echo state
+
+main()