summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorjangko <jangko128@gmail.com>2015-12-17 10:14:48 +0700
committerjangko <jangko128@gmail.com>2015-12-17 10:14:48 +0700
commit60a400eeb03873f26145fb75880d62bea7d01d5c (patch)
tree26ab1f23cac9110f70d4299a9692c91119cde3f9 /tests
parenta3c8bb93760e258de406572f6181aa18fc88e7c3 (diff)
downloadNim-60a400eeb03873f26145fb75880d62bea7d01d5c.tar.gz
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