t10307.nim 365 B

1234567891011121314151617181920212223
  1. discard """
  2. cmd: "nim c -d:useGcAssert $file"
  3. output: '''running someProc(true)
  4. res: yes
  5. yes
  6. running someProc(false)
  7. res:
  8. '''
  9. """
  10. proc someProc(x:bool):cstring =
  11. var res:string = ""
  12. if x:
  13. res = "yes"
  14. echo "res: ", res
  15. GC_ref(res)
  16. result = res
  17. echo "running someProc(true)"
  18. echo someProc(true)
  19. echo "running someProc(false)"
  20. echo someProc(false)