This is an archive of the discontinued LLVM Phabricator instance.

[unittest][DebugInfo/DWARF] Check that dwarfgen::Generator is created
ClosedPublic

Authored by ikudrin on Dec 21 2021, 6:59 AM.

Details

Summary

If Generator::create() returns an error, tests should fail gracefully and report the cause, for example:

[ RUN      ] DebugLineBasicFixture.ParserSkipsCorrectly
.../llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp:47: Failure
Value of: llvm::detail::TakeExpected(ExpectedGenerator)
Expected: succeeded
  Actual: failed  (no asm backend for target nvptx64-nvidia-cuda)

Diff Detail

Unit TestsFailed

Event Timeline

ikudrin requested review of this revision.Dec 21 2021, 6:59 AM
ikudrin created this revision.
dblaikie accepted this revision.Dec 21 2021, 9:02 AM

Sounds good!

llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
48

Side note, as a separate change perhaps (though don't mind if it's in this one really) this should be:

Gen = std::move(*ExpectedGenerator);
This revision is now accepted and ready to land.Dec 21 2021, 9:02 AM
MaskRay accepted this revision.Dec 21 2021, 9:26 AM

Thanks!

ikudrin added inline comments.Dec 21 2021, 11:31 PM
llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
48

Sure, thanks!

This revision was landed with ongoing or failed builds.Dec 22 2021, 3:54 AM
This revision was automatically updated to reflect the committed changes.