tvmutils.nim 769 B

1234567891011121314151617181920212223242526272829303132
  1. discard """
  2. matrix: "--mm:refc; --mm:orc"
  3. joinable: false
  4. nimout: '''
  5. 0
  6. 1
  7. 2
  8. tvmutils.nim(28, 13) [opcLdImmInt] if i == 4:
  9. tvmutils.nim(28, 10) [opcEqInt] if i == 4:
  10. tvmutils.nim(28, 10) [opcFJmp] if i == 4:
  11. tvmutils.nim(28, 13) [opcLdImmInt] if i == 4:
  12. tvmutils.nim(28, 10) [opcEqInt] if i == 4:
  13. tvmutils.nim(28, 10) [opcFJmp] if i == 4:
  14. tvmutils.nim(29, 7) [opcLdConst] vmTrace(false)
  15. tvmutils.nim(29, 15) [opcLdImmInt] vmTrace(false)
  16. tvmutils.nim(29, 14) [opcIndCall] vmTrace(false)
  17. 5
  18. 6
  19. '''
  20. """
  21. # line 20 (only showing a subset of nimout to avoid making the test rigid)
  22. import std/vmutils
  23. proc main() =
  24. for i in 0..<7:
  25. echo i
  26. if i == 2:
  27. vmTrace(true)
  28. if i == 4:
  29. vmTrace(false)
  30. static: main()