summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2015-12-21 00:40:24 +0100
committerAndreas Rumpf <rumpf_a@web.de>2015-12-21 00:40:24 +0100
commit86bb9d8b4768b638ccbc603c26a4b5a70343ab3e (patch)
tree2211618621fbfaa331a1e7a48ff78ebd77001236 /tests
parent17a78f4f8d9f8d3e4f3cd115111d116f03647966 (diff)
parent60a400eeb03873f26145fb75880d62bea7d01d5c (diff)
downloadNim-86bb9d8b4768b638ccbc603c26a4b5a70343ab3e.tar.gz
Merge pull request #3651 from jangko/vm_'excl'
fixed compile time `excl ` cause SIGSEGV #3639
Diffstat (limited to 'tests')
-rw-r--r--tests/vm/texcl.nim27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/vm/texcl.nim b/tests/vm/texcl.nim
new file mode 100644
index 000000000..4ccfd6bfa
--- /dev/null
+++ b/tests/vm/texcl.nim
@@ -0,0 +1,27 @@
+discard """
+  output: '''false'''
+"""
+
+import macros
+
+type
+  nlOptions = enum
+    nloNone
+    nloDebug
+
+var nlOpts {.compileTime.} = {nloDebug}
+
+proc initOpts(): set[nlOptions] =
+  result.incl nloDebug
+  result.incl nloNone
+  result.excl nloDebug
+  
+const cOpts = initOpts()
+
+macro nlo(): stmt =
+  nlOpts.incl(nloNone)
+  nlOpts.excl(nloDebug)
+  result = newEmptyNode()
+
+nlo()
+echo nloDebug in cOpts
\ No newline at end of file