1 # See LICENSE for license details.
3 #*****************************************************************************
5 #-----------------------------------------------------------------------------
7 # Test misaligned fetch trap.
10 #include "riscv_test.h"
11 #include "test_macros.h"
17 #define sscratch mscratch
18 #define sstatus mstatus
22 #define stvec_handler mtvec_handler
27 # Without RVC, the jalr should trap, and the handler will skip ahead.
28 # With RVC, the jalr should not trap, and "j fail" should get skipped.
42 // This test should pass, since JALR ignores the target LSB
70 # tests 2 and 4 should trap
78 # verify that return address was not written
82 li a1, CAUSE_MISALIGNED_FETCH
86 # verify that epc == &jalr (== t0 - 4)