This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Add unit test for compact expression printer
ClosedPublic

Authored by ostannard on Feb 27 2020, 6:31 AM.

Details

Summary

Add a unit test for the compact DWARF expression printer which will be used by the llvm-objdump --debug-vars option.

Diff Detail

Event Timeline

ostannard created this revision.Feb 27 2020, 6:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 27 2020, 6:31 AM
Herald added a subscriber: mgorny. · View Herald Transcript
probinson accepted this revision.Feb 27 2020, 1:02 PM
probinson added a subscriber: probinson.

Fix the typos and LGTM.

llvm/unittests/DebugInfo/DWARF/CMakeLists.txt
24

This list should be kept in alphabetical order.

llvm/unittests/DebugInfo/DWARF/DWARFExpressionCompactPrinterTest.cpp
2

Please update with the correct source file name.

This revision is now accepted and ready to land.Feb 27 2020, 1:02 PM
jhenderson added inline comments.Feb 28 2020, 1:45 AM
llvm/unittests/DebugInfo/DWARF/DWARFExpressionCompactPrinterTest.cpp
28

As this is a brand new file, and is completely local in scope (i.e. doesn't get used by anything else), perhaps we should apply the planned new variable naming rules of lower camel-case for variable names (e.g. mri, tripleName etc)? What do you think?

I'm okay with it either way.

42–43

Are you sure this won't run the test here? I think this will just stop the constructor early, but the test will still be run.

I think you need this return inside the TEST_F blocks.

ostannard marked 4 inline comments as done.Feb 28 2020, 2:51 AM
ostannard added inline comments.
llvm/unittests/DebugInfo/DWARF/DWARFExpressionCompactPrinterTest.cpp
28

I'd prefer to keep the style consistent with the nearby files until we switch over to the new rule.

ostannard updated this revision to Diff 247199.Feb 28 2020, 2:51 AM
This revision was automatically updated to reflect the committed changes.