diff options
author | James Henderson <james.henderson@sony.com> | 2020-01-31 10:51:10 +0000 |
---|---|---|
committer | James Henderson <james.henderson@sony.com> | 2020-02-03 12:16:36 +0000 |
commit | 1271cde47456a1201c085d0402a351f722a96f2d (patch) | |
tree | 0262dd71789382f44a17fb24f69c66e270e85292 /llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp | |
parent | 9adbb6c468c1c4010727a1bfb8e3959eea11f5c7 (diff) | |
download | llvm-1271cde47456a1201c085d0402a351f722a96f2d.zip llvm-1271cde47456a1201c085d0402a351f722a96f2d.tar.gz llvm-1271cde47456a1201c085d0402a351f722a96f2d.tar.bz2 |
[DebugInfo][test] Adjust line table unit length to account for contents
Previously, if a debug line Prologue was created via
createBasicPrologue, its TotalLength field did not account for any
contents in the table itself. This change fixes this issue.
Reviewed by: probinson
Differential Revision: https://reviews.llvm.org/D73772
Diffstat (limited to 'llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp')
-rw-r--r-- | llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp b/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp index bd2ae5c..ba3bb54 100644 --- a/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp +++ b/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp @@ -549,9 +549,8 @@ TEST_F(DebugLineBasicFixture, ErrorForUnitLengthTooLarge) { LT.addStandardOpcode(DW_LNS_const_add_pc, {});
LT.addExtendedOpcode(1, DW_LNE_end_sequence, {});
DWARFDebugLine::Prologue Prologue = LT.createBasicPrologue();
- // Set the total length to 1 higher than the actual length. The program body
- // has size 5.
- Prologue.TotalLength += 6;
+ // Set the total length to 1 higher than the actual length.
+ ++Prologue.TotalLength;
LT.setPrologue(Prologue);
generate();
|