[PATCH] D74560: Introduce DWARFDataExtractor::getInitialLength

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 26 08:14:35 PST 2020


labath marked 7 inline comments as done.
labath added inline comments.


================
Comment at: llvm/unittests/DebugInfo/DWARF/DWARFDataExtractorTest.cpp:48-52
+  EXPECT_THAT_EXPECTED(
+      GetWithError({0x00, 0x01, 0x02, 0x03}),
+      HasValue(std::make_tuple(0x00010203, dwarf::DWARF32, 4)));
+  EXPECT_EQ(GetWithoutError({0x00, 0x01, 0x02, 0x03}),
+            std::make_tuple(0x00010203, dwarf::DWARF32, 4));
----------------
jhenderson wrote:
> Will this test work if the host endianness is different? It looks to me like 0x00010203 != {0x00, 0x01, 0x02, 0x03} for little endian hosts, since in that case, 0x00010203 is {0x03, 0x02, 0x01, 0x00}.
(I thought I replied to this already, but I don't see the comment anywhere.)

The test hardcodes a big-endian so this will work regardless of the host. I used big endian because the numbers come out more naturally that way, and because they are more likely to flesh out any host endiannes creeping in.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74560/new/

https://reviews.llvm.org/D74560





More information about the llvm-commits mailing list