summary refs log tree commit diff stats
path: root/tests/misc/tstrace.nim
blob: 23590d9585f4e51d774b9086ecddf4cadde62064 (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)