This is an archive of the discontinued LLVM Phabricator instance.

[llvm-dwarfdump][test] Rewrite verify_die_ranges.s in YAML. NFC.
ClosedPublic

Authored by Higuoxing on Sep 24 2020, 12:50 AM.

Details

Summary

This patch rewrites test case verify_die_ranges.s in YAML which helps
simplify the test.

Diff Detail

Event Timeline

Higuoxing created this revision.Sep 24 2020, 12:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 24 2020, 12:50 AM
Higuoxing requested review of this revision.Sep 24 2020, 12:50 AM
jhenderson accepted this revision.Sep 24 2020, 1:01 AM
jhenderson added subscribers: ikudrin, dblaikie.

LGTM! Nice work! (Also cc'ed both @ikudrin and @dblaikie who regularly work in the DWARF area).

llvm/test/tools/llvm-dwarfdump/X86/verify_die_ranges.yaml
2

Whilst you're modifying this test, I'd split this up into separate yaml2obj and llvm-dwarfdump commands (i.e. no piping between the two) to make it easier to debug the test in the future.

This revision is now accepted and ready to land.Sep 24 2020, 1:01 AM
Higuoxing updated this revision to Diff 293965.Sep 24 2020, 1:09 AM
Higuoxing marked an inline comment as done.

Split commands.

dblaikie accepted this revision.Sep 24 2020, 11:12 AM

Looks good - I don't feel that strongly about the split or merged commands.

llvm/test/tools/llvm-dwarfdump/X86/verify_die_ranges.yaml
2

FWIW, I tend to find the single command line easier to debug - don't have to worry about whether a test case has written a certain output file or not, etc. I can take the whole command line and know it's standalone/accounts for everything needed. (so if I rebuild llc I don't then have to go and dig up the applicable llc command, etc)

JDevlieghere accepted this revision.Sep 24 2020, 1:30 PM
jhenderson added inline comments.Sep 25 2020, 12:59 AM
llvm/test/tools/llvm-dwarfdump/X86/verify_die_ranges.yaml
2

When I find a failing test using the single-command line, and want to run the middle command, I can't precisely because the input file doesn't exist, meaning I have to modify the test before debugging it. In addition, I already have the full command-line from the lit -v output that I need to rerun the bit I'm interested in.

dblaikie added inline comments.Sep 25 2020, 11:16 AM
llvm/test/tools/llvm-dwarfdump/X86/verify_die_ranges.yaml
2

Yeah, there's some awkwardness either way, for sure.

Often times I want to iterate on changing the product code - so having it all in one command line makes it easy to rerun - when I forget this and copy/paste only the dump+filecheck line from the test, then modify the product code and rerun the test only to see no improvement it can take me a moment to realize what's happened.

Rerunning the whole test might not be ideal either, if it now passes (or fails earlier), running some other test variant that overwrites the desired input file.

Also the failure tends to be more clear to me - I can copy/paste the whole command line and know I've captured everything I need to repeatedly exercise the codepath/test, not relying on some leftover artifact of the test's previous execution.