summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/DebugInfo/DWARF/DWARFFormValueTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/DebugInfo/DWARF/DWARFFormValueTest.cpp')
-rw-r--r--llvm/unittests/DebugInfo/DWARF/DWARFFormValueTest.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/unittests/DebugInfo/DWARF/DWARFFormValueTest.cpp b/llvm/unittests/DebugInfo/DWARF/DWARFFormValueTest.cpp
index 14550b9082b..8d9edb3e9aa 100644
--- a/llvm/unittests/DebugInfo/DWARF/DWARFFormValueTest.cpp
+++ b/llvm/unittests/DebugInfo/DWARF/DWARFFormValueTest.cpp
@@ -160,6 +160,17 @@ 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.
+ struct uint128_t {
+ uint8_t Bytes[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