parent
fdd25ed19c
commit
dfa2f011d7
1 changed files with 23 additions and 0 deletions
23
tests/magics/t10307.nim
Normal file
23
tests/magics/t10307.nim
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue