tmissingvolatile.nim 308 B

12345678910111213141516171819202122
  1. discard """
  2. output: "1"
  3. cmd: r"nim c --hints:on $options --mm:refc -d:release $file"
  4. ccodecheck: "'NI volatile state;'"
  5. targets: "c"
  6. """
  7. # bug #1539
  8. proc err() =
  9. raise newException(Exception, "test")
  10. proc main() =
  11. var state: int
  12. try:
  13. state = 1
  14. err()
  15. except:
  16. echo state
  17. main()