This patch removes the verbose option from tests that do not need it and simplifies the checks. For tests that do have the verbose option, the checks were standardized to be more readable and consistent.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Here is an example for the differing output with file llvm/test/DebugInfo/Generic/varargs.ll
On Linux:
DW_AT_name [DW_FORM_strp]^I( .debug_str[0x00000065] = "a")$
On AIX:
DW_AT_name [DW_FORM_string]^I("a")$
I'd be OK with this patch as-is, but if you're up for some other cleanup some tests might be able to be changed to not use -v, and those that can't could probably be a bit more standardized/made more consistent by dropping the sometimes-present trailing ) (since it's unmatched anyway (being consumed by the regex) I think it reduces readability) and including a space between the tag name and the regex in all these cases/consistently.
llvm/test/DebugInfo/Generic/PR20038.ll | ||
---|---|---|
4 | Some tests may be simplified by removing -v if the test isn't trying to test particular forms/encodings - that way you wouldn't need the {{.*}} either, since the non-verbose form doesn't print the encoding information (you'd need to add () around the string instead, possibly, though). | |
llvm/test/DebugInfo/Generic/containing-type-extension.ll | ||
8 | Could you drop trailing ) from cases like this too? | |
llvm/test/DebugInfo/Generic/namespace.ll | ||
19 | Might be worth standardizing on including a space between DW_AT_name and the {{... part. |
LGTM as long as @dblaikie comments are addressed.
I think it is still worth investigating why llvm-dwarfdump emits tab instead of whitespace on AIX as a follow-up.
I think that got covered somewhere. It's that AIX uses direct rather than indirect strings, so they dump differently when using verbose dumping (verbose is used in some tests where it isn't needed because it was the default, so when the non-verbose behavior was added existing tests often got -v added to make them keep working rather than rewriting them to use the non-verbose output):
Direct string verbose dumping:
DW_AT_name [DW_FORM_string] ("f")
Indirect string verbose dumping:
DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000009f] = "f")
So they both have tabs (between the ] and the () but the indirect also has some spaces, and doesn't have a paren immediately before the ".
I think in cases where we don't care about the form for the string, then DW_AT_name {{.*}}"x" is probably the most legible (ideally any test that can be moved away from using verbose output when they don't need it would be ideal - but that's more work, and a reasonable intermediate change to unblock AIX is to at least standardize the probelmatic/overly constrained string testing on this form-agnostic syntax)
Some tests may be simplified by removing -v if the test isn't trying to test particular forms/encodings - that way you wouldn't need the {{.*}} either, since the non-verbose form doesn't print the encoding information (you'd need to add () around the string instead, possibly, though).