Skip to content

Commit

Permalink
RISC-V: Make T-Head testing pattern more generic
Browse files Browse the repository at this point in the history
On some T-Head vendor extensions, we test against the constant
18446744073709551615 (2**64-1) to detect invalid immediate errors on -1.
However, it heavily depends on the fact that the value used to print
immediate value is a 64-bit unsigned type and this constant is not (and
should not be) important (we just want to know that -1 is not valid).

This commit replaces all such occurrences of 18446744073709551615 with
a more generic regular expression.

gas/ChangeLog:

	* testsuite/gas/riscv/x-thead-ba-fail.l: Replace
	18446744073709551615 with generic regular expression.
	* testsuite/gas/riscv/x-thead-bb-fail.l: Likewise.
	* testsuite/gas/riscv/x-thead-bs-fail.l: Likewise.
	* testsuite/gas/riscv/x-thead-fmemidx-fail.l: Likewise.
	* testsuite/gas/riscv/x-thead-memidx-fail.l: Likewise.
	* testsuite/gas/riscv/x-thead-mempair-fail.l: Likewise.
  • Loading branch information
a4lg committed Aug 15, 2023
1 parent 239af8c commit f9280e3
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion gas/testsuite/gas/riscv/x-thead-ba-fail.l
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.*: Assembler messages:
.*: Error: improper immediate value \(18446744073709551615\)
.*: Error: improper immediate value \(-?\d+\)
.*: Error: improper immediate value \(4\)
4 changes: 2 additions & 2 deletions gas/testsuite/gas/riscv/x-thead-bb-fail.l
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.*: Assembler messages:
.*: Error: improper immediate value \(18446744073709551615\)
.*: Error: improper immediate value \(-?\d+\)
.*: Error: improper immediate value \(64\)
.*: Error: improper immediate value \(18446744073709551615\)
.*: Error: improper immediate value \(-?\d+\)
.*: Error: improper immediate value \(32\)
.*: Error: illegal operands `th.ext a0,64,62'
.*: Error: illegal operands `th.extu a0,-1,0'
2 changes: 1 addition & 1 deletion gas/testsuite/gas/riscv/x-thead-bs-fail.l
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.*: Assembler messages:
.*: Error: improper immediate value \(18446744073709551615\)
.*: Error: improper immediate value \(-?\d+\)
.*: Error: improper immediate value \(64\)
16 changes: 8 additions & 8 deletions gas/testsuite/gas/riscv/x-thead-fmemidx-fail.l
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
.*: Assembler messages:
.*: Error: illegal operands `th.flrd a0,a1,a2,0'
.*: Error: improper immediate value \(18446744073709551615\)
.*: Error: improper immediate value \(-?\d+\)
.*: Error: improper immediate value \(4\)
.*: Error: improper immediate value \(18446744073709551615\)
.*: Error: improper immediate value \(-?\d+\)
.*: Error: improper immediate value \(4\)
.*: Error: improper immediate value \(18446744073709551615\)
.*: Error: improper immediate value \(-?\d+\)
.*: Error: improper immediate value \(4\)
.*: Error: improper immediate value \(18446744073709551615\)
.*: Error: improper immediate value \(-?\d+\)
.*: Error: improper immediate value \(4\)
.*: Error: improper immediate value \(18446744073709551615\)
.*: Error: improper immediate value \(-?\d+\)
.*: Error: improper immediate value \(4\)
.*: Error: improper immediate value \(18446744073709551615\)
.*: Error: improper immediate value \(-?\d+\)
.*: Error: improper immediate value \(4\)
.*: Error: improper immediate value \(18446744073709551615\)
.*: Error: improper immediate value \(-?\d+\)
.*: Error: improper immediate value \(4\)
.*: Error: improper immediate value \(18446744073709551615\)
.*: Error: improper immediate value \(-?\d+\)
.*: Error: improper immediate value \(4\)

6 changes: 3 additions & 3 deletions gas/testsuite/gas/riscv/x-thead-memidx-fail.l
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
.*: Assembler messages:
.*: Error: improper immediate value \(-17\)
.*: Error: improper immediate value \(18446744073709551615\)
.*: Error: improper immediate value \(-?\d+\)
.*: Error: improper immediate value \(16\)
.*: Error: improper immediate value \(4\)

.*: Error: illegal operands `th.ldia a0,\(a0\),0,0'
.*: Error: illegal operands `th.ldib a0,\(a0\),0,0'

.*: Error: improper immediate value \(18446744073709551615\)
.*: Error: improper immediate value \(-?\d+\)
.*: Error: improper immediate value \(4\)

.*: Error: improper immediate value \(18446744073709551615\)
.*: Error: improper immediate value \(-?\d+\)
.*: Error: improper immediate value \(4\)
10 changes: 5 additions & 5 deletions gas/testsuite/gas/riscv/x-thead-mempair-fail.l
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
.*: Error: illegal operands `th.sdd a0,a1,\(a2\),3'
.*: Error: illegal operands `th.swd a0,a1,\(a2\),0'

.*: Error: improper immediate value \(18446744073709551615\)
.*: Error: improper immediate value \(-?\d+\)
.*: Error: improper immediate value \(4\)
.*: Error: unexpected literal \(3\)

.*: Error: improper immediate value \(18446744073709551615\)
.*: Error: improper immediate value \(-?\d+\)
.*: Error: improper immediate value \(4\)
.*: Error: unexpected literal \(4\)

.*: Error: improper immediate value \(18446744073709551615\)
.*: Error: improper immediate value \(-?\d+\)
.*: Error: improper immediate value \(4\)
.*: Error: unexpected literal \(4\)

.*: Error: improper immediate value \(18446744073709551615\)
.*: Error: improper immediate value \(-?\d+\)
.*: Error: improper immediate value \(4\)
.*: Error: unexpected literal \(3\)

.*: Error: improper immediate value \(18446744073709551615\)
.*: Error: improper immediate value \(-?\d+\)
.*: Error: improper immediate value \(4\)
.*: Error: unexpected literal \(4\)

Expand Down

0 comments on commit f9280e3

Please sign in to comment.