summary refs log tree commit diff stats
path: root/tests/vm/tmanyregs.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/vm/tmanyregs.nim')
-rw-r--r--tests/vm/tmanyregs.nim16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/vm/tmanyregs.nim b/tests/vm/tmanyregs.nim
new file mode 100644
index 000000000..711c69285
--- /dev/null
+++ b/tests/vm/tmanyregs.nim
@@ -0,0 +1,16 @@
+import macros
+
+# Generate a proc with more then 255 registers. Should not generate an error at
+# compile time
+
+static:
+  macro mkFoo() =
+    let ss = newStmtList()
+    for i in 1..256:
+      ss.add parseStmt "var x" & $i & " = " & $i
+      ss.add parseStmt "inc x" & $i
+    quote do:
+      proc foo() =
+        `ss`
+  mkFoo()
+  foo()