tvmutils.nim 738 B

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