texitprocs.nim 286 B

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