12345678910111213141516171819202122232425 |
- 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)
|