summary refs log tree commit diff stats
path: root/tests/ccgbugs
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-09-14 12:42:22 +0200
committerAraq <rumpf_a@web.de>2015-09-14 12:42:22 +0200
commita3f791f8929871b9e20f2fd4d69571dd20b3c409 (patch)
tree7fca1c41017d38399d74fda57183d26b00c40807 /tests/ccgbugs
parent612cd25d5dd7f86380367b3a0ac823b4919eea67 (diff)
downloadNim-a3f791f8929871b9e20f2fd4d69571dd20b3c409.tar.gz
added testcase for #1679
Diffstat (limited to 'tests/ccgbugs')
-rw-r--r--tests/ccgbugs/tnocodegen_for_compiletime.nim9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ccgbugs/tnocodegen_for_compiletime.nim b/tests/ccgbugs/tnocodegen_for_compiletime.nim
new file mode 100644
index 000000000..a88ba4b32
--- /dev/null
+++ b/tests/ccgbugs/tnocodegen_for_compiletime.nim
@@ -0,0 +1,9 @@
+# bug #1679
+import macros, tables, hashes
+proc hash(v: NimNode): Hash = 4  # performance is for suckers
+macro test(body: stmt): stmt {.immediate.} =
+  var a = initCountTable[NimNode]()
+  a.inc(body)
+
+test:
+  1 + 1