From 30e5368a7bb341dcff001ec8a56fcfd0ae8fda2f Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Thu, 2 Jun 2022 11:06:03 -0700 Subject: 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. --- isa/macros/scalar/test_macros.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'isa') 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 -- cgit v1.1