Skip to content

Commit

Permalink
close nim-lang#10307(add testcase for nim-lang#10307) (nim-lang#15840)
Browse files Browse the repository at this point in the history
  • Loading branch information
ringabout authored and PMunch committed Jan 6, 2021
1 parent 809b9da commit 0278fb1
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/magics/t10307.nim
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 0278fb1

Please sign in to comment.