Skip to content

Commit 3837b09

Browse files
committed
RISC-V: Test cases for complex CSR checking
This commit tests whether the miselect CSR is unlocked by either 'Smaia' or 'Smcsrind' extension. gas/ChangeLog: * testsuite/gas/riscv/csr-complex.s: New test. * testsuite/gas/riscv/csr-complex-1.d: Likewise. * testsuite/gas/riscv/csr-complex-1.l: Likewise. * testsuite/gas/riscv/csr-complex-2.d: Likewise. * testsuite/gas/riscv/csr-complex-3.d: Likewise.
1 parent b52c01d commit 3837b09

File tree

5 files changed

+38
-0
lines changed

5 files changed

+38
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#as: -march=rv64i_zicsr -mcsr-check
2+
#source: csr-complex.s
3+
#warning_output: csr-complex-1.l
4+
#objdump: -d
5+
6+
.*:[ ]+file format .*
7+
8+
9+
Disassembly of section .text:
10+
11+
0+000 <target>:
12+
[ ]+[0-9a-f]+:[ ]+35002573[ ]+csrr[ ]+a0,miselect
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.*Assembler messages:
2+
.*Warning: invalid CSR `miselect', needs `smaia' or `smcsrind' extension
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#as: -march=rv64i_zicsr_smaia -mcsr-check
2+
#source: csr-complex.s
3+
#objdump: -d
4+
5+
.*:[ ]+file format .*
6+
7+
8+
Disassembly of section .text:
9+
10+
0+000 <target>:
11+
[ ]+[0-9a-f]+:[ ]+35002573[ ]+csrr[ ]+a0,miselect
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#as: -march=rv64i_zicsr_smcsrind -mcsr-check
2+
#source: csr-complex.s
3+
#objdump: -d
4+
5+
.*:[ ]+file format .*
6+
7+
8+
Disassembly of section .text:
9+
10+
0+000 <target>:
11+
[ ]+[0-9a-f]+:[ ]+35002573[ ]+csrr[ ]+a0,miselect
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
target:
2+
csrr a0, miselect

0 commit comments

Comments
 (0)