diff options
author | Edwin Lu <ewlu@rivosinc.com> | 2024-02-12 11:38:15 -0800 |
---|---|---|
committer | Edwin Lu <ewlu@rivosinc.com> | 2024-02-16 10:16:42 -0800 |
commit | bf6f00cbb132f1dcb80684d9cf082156bf7b315d (patch) | |
tree | 5f7b902c3f39a583e9eb534a6bd1f8bcea96f830 /gcc/doc | |
parent | c95dc611a6203f0564722975acff4ad866b9c45e (diff) | |
download | gcc-bf6f00cbb132f1dcb80684d9cf082156bf7b315d.zip gcc-bf6f00cbb132f1dcb80684d9cf082156bf7b315d.tar.gz gcc-bf6f00cbb132f1dcb80684d9cf082156bf7b315d.tar.bz2 |
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>
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/sourcebuild.texi | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index c431956..7b747bfa 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -3403,6 +3403,10 @@ excluding LTO sections. Passes if @var{regex} is matched exactly @var{num} times in the test's assembler output, excluding LTO sections. +@item scan-assembler-bound @var{regex} @var{cmp} @var{num} [@{ target/xfail @var{selector} @}] +Passes if @var{regex} is matched @var{cmp} @var{num} times in the test's +assembler output, excluding LTO sections. @var{cmp} is a comparitor. + @item scan-assembler-dem @var{regex} [@{ target/xfail @var{selector} @}] Passes if @var{regex} matches text in the test's demangled assembler output, excluding LTO sections. |