summary refs log tree commit diff stats
path: root/tests/tstrace.nim
blob: 56f20a0ddc4059a5b782012be110e53c6f3921ca (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Test the new stacktraces (great for debugging!)

{.push stack_trace: on.}

proc recTest(i: int) =
  # enter
  if i < 10:
    recTest(i+1)
  else: # should printStackTrace()
    var p: ptr int = nil
    p^ = 12
  # leave

{.pop.}

recTest(0)