tmanyregs.nim 334 B

1234567891011121314151617
  1. import macros
  2. # Generate a proc with more then 255 registers. Should not generate an error at
  3. # compile time
  4. static:
  5. macro mkFoo() =
  6. let ss = newStmtList()
  7. for i in 1..256:
  8. ss.add parseStmt "var x" & $i & " = " & $i
  9. ss.add parseStmt "inc x" & $i
  10. quote do:
  11. proc foo() =
  12. `ss`
  13. mkFoo()
  14. foo()