summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/compile/tmacro1.nim10
-rw-r--r--tests/reject/trecmacro.nim14
2 files changed, 14 insertions, 10 deletions
diff --git a/tests/compile/tmacro1.nim b/tests/compile/tmacro1.nim
index 52c86e7e9..b4fce9776 100755
--- a/tests/compile/tmacro1.nim
+++ b/tests/compile/tmacro1.nim
@@ -18,13 +18,3 @@ macro test*(a: stmt): stmt =
 
 test:
   "hi"
-
-macro dump(n: stmt): stmt =
-  dump(n)
-  if kind(n) == nnkNone:
-    nil
-  else:
-    hint($kind(n))
-    for i in countUp(0, len(n)-1):
-      nil
-
diff --git a/tests/reject/trecmacro.nim b/tests/reject/trecmacro.nim
new file mode 100644
index 000000000..28b6db530
--- /dev/null
+++ b/tests/reject/trecmacro.nim
@@ -0,0 +1,14 @@
+discard """
+  file: "trecmacro.nim"
+  line: 8
+  errormsg: "recursive dependency: 'dump'"
+"""
+
+macro dump(n: stmt): stmt =
+  dump(n)
+  if kind(n) == nnkNone:
+    nil
+  else:
+    hint($kind(n))
+    for i in countUp(0, len(n)-1):
+      nil