summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/DebugInfo/DWARF/DWARFFormValueTest.cpp
diff options
context:
space:
mode:
authorPaul Robinson <paul.robinson@sony.com>2017-12-15 19:52:34 +0000
committerPaul Robinson <paul.robinson@sony.com>2017-12-15 19:52:34 +0000
commit72546fe87b0d3c8c9d8035a16cf913ca84554559 (patch)
tree8f3a562e64bc743b992ea5e967f32823879224a4 /llvm/unittests/DebugInfo/DWARF/DWARFFormValueTest.cpp
parent22e5551ed730fa6bf5262b56ee0153d70cef5084 (diff)
downloadbcm5719-llvm-72546fe87b0d3c8c9d8035a16cf913ca84554559.tar.gz
bcm5719-llvm-72546fe87b0d3c8c9d8035a16cf913ca84554559.zip
[DWARFv5] Dump an MD5 checksum in the line-table header.
Adds missing support for DW_FORM_data16. Differential Revision: https://reviews.llvm.org/D41090 llvm-svn: 320852
Diffstat (limited to 'llvm/unittests/DebugInfo/DWARF/DWARFFormValueTest.cpp')
-rw-r--r--llvm/unittests/DebugInfo/DWARF/DWARFFormValueTest.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/unittests/DebugInfo/DWARF/DWARFFormValueTest.cpp b/llvm/unittests/DebugInfo/DWARF/DWARFFormValueTest.cpp
index 14550b9082b..8fc6b786ba4 100644
--- a/llvm/unittests/DebugInfo/DWARF/DWARFFormValueTest.cpp
+++ b/llvm/unittests/DebugInfo/DWARF/DWARFFormValueTest.cpp
@@ -160,6 +160,15 @@ TEST(DWARFFormValue, SignedConstantForms) {
EXPECT_EQ(LEBMax.getAsSignedConstant().getValue(), LLONG_MAX);
EXPECT_EQ(LEB1.getAsSignedConstant().getValue(), -42);
EXPECT_EQ(LEB2.getAsSignedConstant().getValue(), 42);
+
+ // Data16 is a little tricky.
+ using uint128_t = std::array<uint8_t, 16>;
+ uint128_t Item16({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15});
+ auto Data16 = createDataXFormValue<uint128_t>(DW_FORM_data16, Item16);
+ SmallString<32> Str;
+ raw_svector_ostream Res(Str);
+ Data16.dump(Res, DIDumpOptions());
+ EXPECT_EQ(memcmp(Str.data(), "000102030405060708090a0b0c0d0e0f", 32), 0);
}
} // end anonymous namespace
OpenPOWER on IntegriCloud