Hi Richard.
Thank you for finding a bug.
As for the testing
1. I have a small program that calculates fibonacci numbers. I use it to test
mainly stack operations for different CPU flavors (1, 2 or 3 bytes PC).
2. I manually verified that I can debug with gdb, that includes
a. stepping
b. running
c. stopping
d. breakpoints
e. backtrace shows correct stack
3. I manually verified that I can save and load vm states
4. `make check` passes
If you please point me to a doc that explains how automatic unit tests can be
added to a QEMU target, I will happily add them.