mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-31 10:22:15 +00:00
* Increased regBx size from 16 to 24 bits to increase jump range in the VM from 32K to 8M instructions. Fixes #12727 * Increased VM TInst register field sizes to 16 bits to allow up to 65535 VM registers per proc * Added test case for >255 VM registers
17 lines
334 B
Nim
17 lines
334 B
Nim
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()
|