diff options
author | James Henderson <james.henderson@sony.com> | 2020-05-26 11:53:24 +0100 |
---|---|---|
committer | James Henderson <james.henderson@sony.com> | 2020-06-09 14:24:53 +0100 |
commit | dbd26fe0b6ac8b33067817ef770d82afbe268c05 (patch) | |
tree | c29f0d48953b2abd4c580d1f72fc7b85cd2e3407 /llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp | |
parent | a375463ad0630cab3a5b62d534ad64f822a20406 (diff) | |
download | llvm-dbd26fe0b6ac8b33067817ef770d82afbe268c05.zip llvm-dbd26fe0b6ac8b33067817ef770d82afbe268c05.tar.gz llvm-dbd26fe0b6ac8b33067817ef770d82afbe268c05.tar.bz2 |
[DebugInfo] Print non-verbose output at some point as verbose output
Verbose and non-verbose parsing of .debug_line produced their output at
different points in the program. The most obvious impact of this was
that error messages were produced at different times, but it also
potentially reduced what clients could do by customising the stream or
warning/error handlers.
This change makes the two variants consistent by printing non-verbose
output inline, the same as verbose output.
Testing of the error messages has been modified to check the messages
always appear in the same location to illustrate the behaviour.
Reviewed by: JDevlieghere, dblaikie, MaskRay, labath
Differential Revision: https://reviews.llvm.org/D80989
Diffstat (limited to 'llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp')
-rw-r--r-- | llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp b/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp index 3dad185..c73b04d 100644 --- a/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp +++ b/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp @@ -1271,7 +1271,8 @@ TEST_F(DebugLineBasicFixture, ParserPrintsStandardOpcodesWhenRequested) { DWARFDebugLine::SectionParser Parser(LineData, *Context, CUs, TUs); std::string Output; raw_string_ostream OS(Output); - Parser.parseNext(RecordRecoverable, RecordUnrecoverable, &OS); + Parser.parseNext(RecordRecoverable, RecordUnrecoverable, &OS, + /*Verbose=*/true); OS.flush(); EXPECT_FALSE(Recoverable); @@ -1323,13 +1324,16 @@ struct TruncatedExtendedOpcodeFixture DWARFDebugLine::SectionParser Parser(LineData, *Context, CUs, TUs); std::string Output; raw_string_ostream OS(Output); - Parser.parseNext(RecordRecoverable, RecordUnrecoverable, &OS); + Parser.parseNext(RecordRecoverable, RecordUnrecoverable, &OS, + /*Verbose=*/true); OS.flush(); StringRef LinePrefix = "0x0000002e: 00 "; StringRef OutputRef(Output); StringRef OutputToCheck = OutputRef.split(LinePrefix).second; - EXPECT_EQ((ExpectedOutput + "\n").str(), OutputToCheck); + // Each extended opcode ends with a new line and then the table ends with an + // additional blank line. + EXPECT_EQ((ExpectedOutput + "\n\n").str(), OutputToCheck); EXPECT_THAT_ERROR(std::move(Recoverable), FailedWithMessage(ExpectedErr.str())); } |