split out S-mode tests and M-mode tests
[riscv-tests.git] / isa / rv64si / illegal.S
index b068118f4af5a67fb65bd721a52f33e17d17fd57..43068b4647458cbc10e003784a158a5bd1b03a59 100644 (file)
 RVTEST_RV64S
 RVTEST_CODE_BEGIN
 
-  la t0, stvec
-  csrw stvec, t0
+#ifdef __MACHINE_MODE
+  #define sscratch mscratch
+  #define sstatus mstatus
+  #define scause mcause
+  #define sepc mepc
+  #define stvec_handler mtvec_handler
+#endif
 
   li TESTNUM, 2
   .word 0
@@ -24,7 +29,7 @@ RVTEST_CODE_BEGIN
 
   TEST_PASSFAIL
 
-stvec:
+stvec_handler:
   li t1, CAUSE_ILLEGAL_INSTRUCTION
   csrr t0, scause
   bne t0, t1, fail