[PATCH v0 3/3] aarch64: testsuite: remove macro expansion messages from expected error output

Matthieu Longo Matthieu.Longo@arm.com
Fri Jun 28 17:40:15 GMT 2024


>Starting here with commenting, as that's where the effects are really visible.
>
>On 27.06.2024 15:50, Matthieu Longo wrote:
>> gas generates an information diagnostic message for every context
>> invoking a macro and generating a warning or error message.
>> This pollutes the expected error output for no benefit in term of test
>> debug or testing coverage.
>
>That very much depends on the specific nature of a testcase. Where a macro was invoked from may be quite relevant, especially if one is invoked more than once. IOW personally I think such a change would need to come with reasoning as to why, for every testcase touched, that information is unnecessary. Which in turn may call for splitting the patch, grouping multiple testcases touched in one go by the specific reasons given.

All the tests that I touched in the 3rd patch can be split in 2 categories:
- gas/testsuite/gas/aarch64/sysreg: in my understanding, macros are used in those tests for convenience, but the info from where the macro was called is not very relevant. As you can see in those tests, most of the patterns in the .d file ignore everything including the line number.
  Examples of patterns in those files:
     .*: *Info: macro .*
     .*:  Info: macro invoked from here
     [^:]*:[0-9]+: *Info: macro .*
  As you can see in those examples above, the patterns clearly indicate that nobody cares about the line number.
  In general, all tests in gas/testsuite/gas/aarch64/sysreg don't need this macro info line.

- gas/testsuite/gas/aarch64: the tests **that I touched** are testing invalid syntax, wrong operands, etc... but the line from where the macros is called is not very relevant in most of the case.
  Examples of patterns in those files:
     [^:]+:27:  Info: macro invoked from here
     [^:]*:262: *Info: macro .*
     [^:]+:23:  Info: macro .*
     .*: *Info: macro .*
   For some of those tests, some people seem to care about the line numbers where the macros is invoked, some others not. It obviously depends on the nature of tests.

To be conservative, I will revert the changes for the files in gas/testsuite/gas/aarch  where the line numbers are specified, and keep all others in one patch as it is sure that nobody care about the macro info line.

>> This patch aims at stopping such diagnostic messages to be generated
>> for the failure tests by providing --no-info flag to gas.
>> It also removed from the expected outputs the information messages
>> related to macro expansions.
>
>You don't touch e.g. advsimd-lut-illegal, perhaps because it was only recently added. That testcase has an interesting property, though: It emits two different kinds of "Info: ..." messages, and I can't help the impression that you'd suppress only one by the changes made so far (first and foremost because config/tc-aarch64.c isn't being touched at all by the series). To me, --no-info would mean suppressing them all. Yet of course this other kind of info output may again be a crucial part of the testcase.

In advsimd-lut-illegal, the info message seems useful for the test. That's why I didn't touch it.
Regarding config/tc-aarch64.c, that's a miss on my side. Thanks for pointing it out. I will add a check on flag_no_infos in output_info().

>
>Jan


More information about the Binutils mailing list