summary refs log blame commit diff stats
path: root/tests/system/t10307.nim
blob: b5a93c5c682123b48c5c965dcc6469f6ae3f80ad (plain) (tree)
1
2
3
4
5
6
7
8
           
                                             



                                   

     














                               
                    
discard """
  cmd: "nim c --mm:refc -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)