diff options
author | Zachary Turner <zturner@google.com> | 2016-06-10 21:47:26 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2016-06-10 21:47:26 +0000 |
commit | 97609bb2fdb1db561b2ca0f32ff4fa413ef4e094 (patch) | |
tree | 313c327b3e8faf8a87fd2a3c8316456007bc4f48 /llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp | |
parent | e1f60b1fb36c5f04b8f3aa60079cbdaf90d1805d (diff) | |
download | bcm5719-llvm-97609bb2fdb1db561b2ca0f32ff4fa413ef4e094.tar.gz bcm5719-llvm-97609bb2fdb1db561b2ca0f32ff4fa413ef4e094.zip |
[pdb] Fix issues with pdb writing.
This fixes an alignment issue by forcing all cached allocations
to be 8 byte aligned, and also fixes an issue arising on big
endian systems by writing ulittle32_t's instead of uint32_t's
in the test.
llvm-svn: 272437
Diffstat (limited to 'llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp')
-rw-r--r-- | llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp b/llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp index fe55b9a3cd9..c9bc9986f45 100644 --- a/llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp +++ b/llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp @@ -308,6 +308,7 @@ TEST(MappedBlockStreamTest, TestWriteThenRead) { MappedBlockStreamImpl S(llvm::make_unique<IndexedStreamData>(0, F), F); enum class MyEnum : uint32_t { Val1 = 2908234, Val2 = 120891234 }; + using support::ulittle32_t; uint16_t u16[] = {31468, 0}; uint32_t u32[] = {890723408, 0}; @@ -315,7 +316,9 @@ TEST(MappedBlockStreamTest, TestWriteThenRead) { StringRef ZStr[] = {"Zero Str", ""}; StringRef FStr[] = {"Fixed Str", ""}; ArrayRef<uint8_t> byteArray[] = {{'1', '2'}, {'0', '0'}}; - ArrayRef<uint32_t> intArray[] = {{890723408, 29082234}, {0, 0}}; + ArrayRef<support::ulittle32_t> intArray[] = { + {ulittle32_t(890723408), ulittle32_t(29082234)}, + {ulittle32_t(0), ulittle32_t(0)}}; StreamReader Reader(S); StreamWriter Writer(S); |