Previous code only checks if the register a0 equals zero or not to
determine if the test is passed. But there will be a bug if semu has
not implemented the tested instruction yet. Semu always regards this
kind of instruction as an illegal instruction, and further triggers
an exception. If there is an exception, the riscv-tests will set the
"tohost" variable other than 1, and stuck in an infinite loop. Since
the test is not finished, the value of a0 is meaningless.
This patch fixes the pass condition that semu checks not only a0,
but also the tohost variable, to determine the result of the test.
Previous code only checks if the register a0 equals zero or not to determine if the test is passed. But there will be a bug if semu has not implemented the tested instruction yet. Semu always regards this kind of instruction as an illegal instruction, and further triggers an exception. If there is an exception, the riscv-tests will set the "tohost" variable other than 1, and stuck in an infinite loop. Since the test is not finished, the value of a0 is meaningless.
This patch fixes the pass condition that semu checks not only a0, but also the tohost variable, to determine the result of the test.