summary refs log blame commit diff stats
path: root/tests/magics/t10307.nim
blob: 111b0d221d03bca645dc63da287519cbc5796bfd (plain) (tree)






















                                   
discard """
  cmd: "nim c -d:useGcAssert $file"
  output: '''running someProc(true)
res: yes
yes
running someProc(false)
res:
'''
"""

proc someProc(x:bool):cstring =
  var res:string = ""
  if x:
    res = "yes"
  echo "res: ", res
  GC_ref(res)
  result = res

echo "running someProc(true)"
echo someProc(true)

echo "running someProc(false)"
echo someProc(false)