summary refs log tree commit diff stats
path: root/tests/vm/tmanyregs.nim
blob: 711c69285d122850e5dad5ce555c71300146f219 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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()