summary refs log tree commit diff stats
path: root/tests/arc/tmalloc.nim
blob: 1d72646c8514d6f1665244d823d11e8336f343dc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
discard """
  matrix: "--mm:arc -d:useMalloc; --mm:arc"
"""

block: # bug #22058
  template foo(): auto =
    {.noSideEffect.}:
      newSeq[byte](1)

  type V = object
    v: seq[byte]

  proc bar(): V =
    V(v: foo())

  doAssert bar().v == @[byte(0)]