summary refs log tree commit diff stats
path: root/tests/vm/tfarjump.nim
blob: f5798b8d2eb277dfe6b2aab71b30ad8555e92c76 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Test a VM relative jump with an offset larger then 32767 instructions.

import macros

static:
  var a = 0
  macro foo(): untyped =
    let s = newStmtList()
    for i in 1..6554:
      s.add nnkCommand.newTree(ident("inc"), ident("a"))
    quote do:
      if true:
        `s`
  foo()