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
64 # Like test 2, but with jal instead of jalr.
79 # Like test 2, but with a taken branch instead of jalr.
94 # Not-taken branches should not trap, even without RVC.
113 # tests 2, 4, 5, and 6 should trap
125 # verify that return address was not written
129 li a1, CAUSE_MISALIGNED_FETCH
133 # verify that epc == &jalr (== t0 - 4)