Add missing rv32mi/rv32si tests
[riscv-tests.git] / isa / rv64si / wfi.S
1 # See LICENSE for license details.
2
3 #*****************************************************************************
4 # wfi.S
5 #-----------------------------------------------------------------------------
6 #
7 # Test wait-for-interrupt instruction.
8 #
9
10 #include "riscv_test.h"
11 #include "test_macros.h"
12
13 RVTEST_RV64S
14 RVTEST_CODE_BEGIN
15
16 #ifdef __MACHINE_MODE
17 #define sstatus mstatus
18 #define sip mip
19 #undef MIP_SSIP
20 #define MIP_SSIP MIP_MSIP
21 #undef SSTATUS_SIE
22 #define SSTATUS_SIE MSTATUS_MIE
23 #endif
24
25 # Make sure wfi doesn't stall if an interrupt is pending, even if masked
26 csrc sstatus, SSTATUS_SIE
27 csrs sip, MIP_SSIP
28 wfi
29
30 RVTEST_PASS
31
32 TEST_PASSFAIL
33
34 RVTEST_CODE_END
35
36 .data
37 RVTEST_DATA_BEGIN
38
39 TEST_DATA
40
41 RVTEST_DATA_END