diff options
author | flywind <43030857+xflywind@users.noreply.github.com> | 2020-11-05 18:55:42 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-05 18:55:42 +0800 |
commit | dfa2f011d7e7856074729d3d809d2848b9b897c1 (patch) | |
tree | 4628d9f0b4e95bc673f29f158fb248e072466918 /tests/magics/t10307.nim | |
parent | fdd25ed19c7adccaf94984e02d4222596ec08224 (diff) | |
download | Nim-dfa2f011d7e7856074729d3d809d2848b9b897c1.tar.gz |
close #10307(add testcase for #10307) (#15840)
Diffstat (limited to 'tests/magics/t10307.nim')
-rw-r--r-- | tests/magics/t10307.nim | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/magics/t10307.nim b/tests/magics/t10307.nim new file mode 100644 index 000000000..111b0d221 --- /dev/null +++ b/tests/magics/t10307.nim @@ -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) \ No newline at end of file |