Add LICENSE
[riscv-tests.git] / isa / rv32si / privileged.S
1 # See LICENSE for license details.
2
3 #*****************************************************************************
4 # privileged.S
5 #-----------------------------------------------------------------------------
6 #
7 # Test privileged instruction trap.
8 #
9
10 #include "riscv_test.h"
11 #include "test_macros.h"
12
13 RVTEST_RV32S
14 RVTEST_CODE_BEGIN
15
16 la t0, evec
17 csrw evec, t0
18
19 csrci status, 1
20
21 li TESTNUM, 2
22 sret
23 j fail
24
25 TEST_PASSFAIL
26
27 evec:
28 li t1, CAUSE_PRIVILEGED_INSTRUCTION
29 csrr t0, cause
30 bne t0, t1, fail
31 j pass
32
33 RVTEST_CODE_END
34
35 .data
36 RVTEST_DATA_BEGIN
37
38 TEST_DATA
39
40 RVTEST_DATA_END