texitprocs.nim 316 B

1234567891011121314151617181920212223
  1. discard """
  2. matrix: "--mm:refc; --mm:orc"
  3. targets: "c cpp js"
  4. output: '''
  5. ok4
  6. ok3
  7. ok2
  8. ok1
  9. '''
  10. """
  11. import std/exitprocs
  12. proc fun1() {.noconv.} = echo "ok1"
  13. proc fun2() = echo "ok2"
  14. proc fun3() {.noconv.} = echo "ok3"
  15. proc fun4() = echo "ok4"
  16. addExitProc(fun1)
  17. addExitProc(fun2)
  18. addExitProc(fun3)
  19. addExitProc(fun4)