aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
diff options
context:
space:
mode:
authorJames Henderson <james.henderson@sony.com>2020-01-31 10:51:10 +0000
committerJames Henderson <james.henderson@sony.com>2020-02-03 12:16:36 +0000
commit1271cde47456a1201c085d0402a351f722a96f2d (patch)
tree0262dd71789382f44a17fb24f69c66e270e85292 /llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
parent9adbb6c468c1c4010727a1bfb8e3959eea11f5c7 (diff)
downloadllvm-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.cpp5
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();