aboutsummaryrefslogtreecommitdiff
path: root/isa
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2022-06-02 11:06:03 -0700
committerTim Newsome <tim@sifive.com>2022-06-06 09:05:26 -0700
commit30e5368a7bb341dcff001ec8a56fcfd0ae8fda2f (patch)
treece5d1e78190af33ca06a2b3bf8190bec4a640d28 /isa
parent7530d52174988076c182a9e6cd43eca7a574925f (diff)
downloadriscv-tests-30e5368a7bb341dcff001ec8a56fcfd0ae8fda2f.zip
riscv-tests-30e5368a7bb341dcff001ec8a56fcfd0ae8fda2f.tar.gz
riscv-tests-30e5368a7bb341dcff001ec8a56fcfd0ae8fda2f.tar.bz2
Set TESTNUM before executing code.
Tests that might cause a trap during their code need TESTNUM (gp) set so the trap handler can correctly identify which test is running, and also report that to the user in case the test fails.
Diffstat (limited to 'isa')
-rw-r--r--isa/macros/scalar/test_macros.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/isa/macros/scalar/test_macros.h b/isa/macros/scalar/test_macros.h
index a8a78a7..ee352e4 100644
--- a/isa/macros/scalar/test_macros.h
+++ b/isa/macros/scalar/test_macros.h
@@ -12,9 +12,9 @@
#define TEST_CASE( testnum, testreg, correctval, code... ) \
test_ ## testnum: \
+ li TESTNUM, testnum; \
code; \
li x7, MASK_XLEN(correctval); \
- li TESTNUM, testnum; \
bne testreg, x7, fail;
# We use a macro hack to simpify code generation for various numbers