summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/DebugInfo/PDB/BinaryStreamTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Support] Move Stream library from MSF -> Support.Zachary Turner2017-03-021-710/+0
| | | | | | | | | | After several smaller patches to get most of the core improvements finished up, this patch is a straight move and header fixup of the source. Differential Revision: https://reviews.llvm.org/D30266 llvm-svn: 296810
* Re-enable BinaryStreamTest.StreamReaderObject.Zachary Turner2017-03-011-10/+18
| | | | | | | This was failing because I was using memcmp to compare two objects that included padding bytes, which were uninitialized. llvm-svn: 296681
* Disable BinaryStreamTest.StreamReaderObject.Zachary Turner2017-03-011-1/+1
| | | | llvm-svn: 296672
* [PDB] Fix and re-enable BinaryStreamArray test.Zachary Turner2017-03-011-36/+38
| | | | | | | | | | | This was due to the test stream choosing an arbitrary partition index for introducing the discontinuity rather than choosing an index that would be correctly aligned for the type of data. Also added an assertion into FixedStreamArray so that this will be caught on all bots in the future, and not just the UBSan bot. llvm-svn: 296661
* [PDB] Re-add BinaryStreamTest.Zachary Turner2017-03-011-0/+700
| | | | | | | | This re-adds all the binary stream tests. This was reverted due to some misaligned reads. For now the offending test is disabled while I investigate. llvm-svn: 296643
* Remove unittests/DebugInfo/PDB/BinaryStreamTest.cpp (from r296555)Vedant Kumar2017-03-011-700/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It breaks the ToT UBSan bots: /Users/vk/Desktop/llvm/include/llvm/DebugInfo/MSF/BinaryStreamArray.h:246:12: runtime error: reference binding to misaligned address 0x7f925540939a for type 'const int', which requires 4 byte alignment 0x7f925540939a: note: pointer points here 05 00 00 00 01 00 00 00 02 00 00 00 03 00 00 00 00 00 00 00 00 00 00 00 00 00 70 98 50 06 01 00 ^ 0 DebugInfoPDBTests 0x0000000106263cbd llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 45 1 DebugInfoPDBTests 0x00000001062628ff llvm::sys::RunSignalHandlers() + 159 2 DebugInfoPDBTests 0x0000000106264593 SignalHandler(int) + 179 3 libsystem_platform.dylib 0x0000000107bb3fba _sigtramp + 26 4 libsystem_pthread.dylib 0x0000000107bd82c8 _pthread_keys + 9720 5 libsystem_c.dylib 0x0000000107947f83 abort + 127 6 libclang_rt.ubsan_osx_dynamic.dylib 0x0000000106bb5fc2 __sanitizer::Abort() + 66 7 DebugInfoPDBTests 0x000000010613f880 llvm::FixedStreamArrayIterator<int>::operator+=(long) + 0 8 DebugInfoPDBTests 0x000000010613f615 llvm::FixedStreamArrayIterator<int>::operator*() const + 37 9 DebugInfoPDBTests 0x000000010613f3cb std::__1::enable_if<__is_forward_iterator<llvm::FixedStreamArrayIterator<int> >::value, void>::type std::__1::vector<int, std::__1::allocator<int> >::__construct_at_end<llvm::FixedStreamArrayIterator<int> >(llvm::FixedStreamArrayIterator<int>, llvm::FixedStreamArrayIterator<int>, unsigned long) + 251 10 DebugInfoPDBTests 0x000000010613f292 std::__1::vector<int, std::__1::allocator<int> >::vector<llvm::FixedStreamArrayIterator<int> >(llvm::FixedStreamArrayIterator<int>, std::__1::enable_if<(__is_forward_iterator<llvm::FixedStreamArrayIterator<int> >::value) && (is_constructible<int, std::__1::iterator_traits<llvm::FixedStreamArrayIterator<int> >::reference>::value), llvm::FixedStreamArrayIterator<int> >::type) + 226 11 DebugInfoPDBTests 0x000000010613ddb7 std::__1::vector<int, std::__1::allocator<int> >::vector<llvm::FixedStreamArrayIterator<int> >(llvm::FixedStreamArrayIterator<int>, std::__1::enable_if<(__is_forward_iterator<llvm::FixedStreamArrayIterator<int> >::value) && (is_constructible<int, std::__1::iterator_traits<llvm::FixedStreamArrayIterator<int> >::reference>::value), llvm::FixedStreamArrayIterator<int> >::type) + 87 12 DebugInfoPDBTests 0x000000010613d4af (anonymous namespace)::BinaryStreamTest_StreamReaderIntegerArray_Test::TestBody() + 1279 13 DebugInfoPDBTests 0x00000001062780f3 testing::Test::Run() + 179 14 DebugInfoPDBTests 0x0000000106279594 testing::TestInfo::Run() + 308 15 DebugInfoPDBTests 0x000000010627a6a3 testing::TestCase::Run() + 307 16 DebugInfoPDBTests 0x00000001062849d4 testing::internal::UnitTestImpl::RunAllTests() + 756 17 DebugInfoPDBTests 0x0000000106284558 testing::UnitTest::Run() + 152 18 DebugInfoPDBTests 0x0000000106266fa5 main + 117 19 libdyld.dylib 0x00000001078506a5 start + 1 zsh: abort ./unittests/DebugInfo/PDB/DebugInfoPDBTests llvm-svn: 296641
* [PDB] Remove use of std error codes.Zachary Turner2017-03-011-7/+6
| | | | | | | | | | I already created a BinaryStreamError class for this purpose, so update the code to use that on the remaining occurrences of errc values. This should also address the issue which led to r296583. llvm-svn: 296640
* (Rewroking r296581) PDB/BinaryStreamTest.cpp: Appease mingw to avoid ↵NAKAMURA Takumi2017-03-011-3/+4
| | | | | | | | | | | | std::errc::no_buffer_space. Unfortunately, mingw's libstdc++ doesn't provide winsock2 errors. That said, we should avoid raising OS-oriented error code in our code. For now, I suggest to define custom error from std::error_category. See also; https://reviews.llvm.org/D20592 llvm-svn: 296583
* Revert r296581, "PDB/BinaryStreamTest.cpp: Appease mingw to avoid ↵NAKAMURA Takumi2017-03-011-3/+3
| | | | | | | | std::errc::no_buffer_space." Wrong commit -- I have unstaged changes. llvm-svn: 296582
* PDB/BinaryStreamTest.cpp: Appease mingw to avoid std::errc::no_buffer_space.NAKAMURA Takumi2017-03-011-3/+3
| | | | | | | | | | Unfortunately, mingw's libstdc++ doesn't provide winsock2 errors. That said, we should avoid raising OS-oriented error code in our code. For now, I suggest to define custom error from std::error_category. See also; https://reviews.llvm.org/D20592 llvm-svn: 296581
* Move constexpr arrays out of class definition.Zachary Turner2017-03-011-3/+4
| | | | | | GCC Linker doesn't seem to like this. llvm-svn: 296560
* Fix signed / unsigned comparison warning.Zachary Turner2017-03-011-1/+1
| | | | llvm-svn: 296557
* [PDB] Add an additional test for BinaryStreamRef.Zachary Turner2017-03-011-2/+58
| | | | | | | | | | | A bug was uncovered where if you have a StreamRef whose ViewOffset is > 0, then when you call readLongestContiguousChunk it will succeed even when it shouldn't, and it always return you a buffer that was taken as if the ViewOffset was 0. Fixed this bug and added a test for it. llvm-svn: 296556
* [PDB] Add tests for BinaryStream.Zachary Turner2017-03-011-0/+643
| | | | llvm-svn: 296555
* Revert r296215, "[PDB] General improvements to Stream library." and followings.NAKAMURA Takumi2017-02-251-758/+0
| | | | | | | | | | | | | | | | | r296215, "[PDB] General improvements to Stream library." r296217, "Disable BinaryStreamTest.StreamReaderObject temporarily." r296220, "Re-enable BinaryStreamTest.StreamReaderObject." r296244, "[PDB] Disable some tests that are breaking bots." r296249, "Add static_cast to silence -Wc++11-narrowing." std::errc::no_buffer_space should be used for OS-oriented errors for socket transmission. (Seek discussions around llvm/xray.) I could substitute s/no_buffer_space/others/g, but I revert whole them ATM. Could we define and use LLVM errors there? llvm-svn: 296258
* Add static_cast to silence -Wc++11-narrowing.Daniel Jasper2017-02-251-1/+1
| | | | llvm-svn: 296249
* [PDB] Disable some tests that are breaking bots.Zachary Turner2017-02-251-3/+3
| | | | | | | | This has to do with big endian, but I can't fix it until Monday. The code itself is fine, just the tests are wrong. Disabling 3 tests for now. llvm-svn: 296244
* Re-enable BinaryStreamTest.StreamReaderObject.Zachary Turner2017-02-251-33/+27
| | | | | | | I had an invalid pointer / size calculation that was causing a stack smash. Should be fixed now. llvm-svn: 296220
* Disable BinaryStreamTest.StreamReaderObject temporarily.Zachary Turner2017-02-251-33/+33
| | | | | | This is crashing on some bots, so I need some time to investigate. llvm-svn: 296217
* [PDB] General improvements to Stream library.Zachary Turner2017-02-251-0/+764
This adds various new functionality and cleanup surrounding the use of the Stream library. Major changes include: * Renaming of all classes for more consistency / meaningfulness * Addition of some new methods for reading multiple values at once. * Full suite of unit tests for reader / writer functionality. * Full set of doxygen comments for all classes. * Streams now store their own endianness. * Fixed some bugs in a few of the classes that were discovered by the unit tests. llvm-svn: 296215
OpenPOWER on IntegriCloud