]> git.ipfire.org Git - thirdparty/gcc.git/commit
testsuite: Add support for scanning assembly with comparitor
authorEdwin Lu <ewlu@rivosinc.com>
Mon, 12 Feb 2024 19:38:15 +0000 (11:38 -0800)
committerEdwin Lu <ewlu@rivosinc.com>
Fri, 16 Feb 2024 18:16:42 +0000 (10:16 -0800)
commitbf6f00cbb132f1dcb80684d9cf082156bf7b315d
tree5f7b902c3f39a583e9eb534a6bd1f8bcea96f830
parentc95dc611a6203f0564722975acff4ad866b9c45e
testsuite: Add support for scanning assembly with comparitor

There is currently no support for matching at least x lines of assembly
(only scan-assembler-times). This patch would allow setting upper or lower
bounds.

Use case: using different scheduler descriptions and/or cost models will change
assembler output. Testing common functionality across tunes would require a
separate testcase per tune since each assembly output would be different. If we
know a base number of lines should appear across all tunes (i.e. testing return
values: we expect at minimum n stores into register x), we can lower-bound the
test to search for scan-assembler-bound {RE for storing into register x} >= n.
This avoids artificially inflating the scan-assembler-times expected count due
to the assembler choosing to perform extra stores into register x (using it as
a temporary register).

The testcase would be more robust to cpu/tune changes at the cost of not being
as granular towards specific cpu tuning.

gcc/ChangeLog:

* doc/sourcebuild.texi: add scan-assembler-bound

gcc/testsuite/ChangeLog:

* lib/scanasm.exp: add scan-assembler-bound

Signed-off-by: Edwin Lu <ewlu@rivosinc.com>
gcc/doc/sourcebuild.texi
gcc/testsuite/lib/scanasm.exp