diff options
Diffstat (limited to 'llvm/unittests/Bitcode')
-rw-r--r-- | llvm/unittests/Bitcode/BitstreamReaderTest.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/unittests/Bitcode/BitstreamReaderTest.cpp b/llvm/unittests/Bitcode/BitstreamReaderTest.cpp index b5bd4a6fb5a..986023ee3e9 100644 --- a/llvm/unittests/Bitcode/BitstreamReaderTest.cpp +++ b/llvm/unittests/Bitcode/BitstreamReaderTest.cpp @@ -158,4 +158,13 @@ TEST(BitstreamReaderTest, readRecordWithBlobWhileStreaming) { } } +TEST(BitstreamReaderTest, shortRead) { + uint8_t Bytes[] = {8, 7, 6, 5, 4, 3, 2, 1}; + for (unsigned I = 1; I != 8; ++I) { + BitstreamReader Reader(ArrayRef<uint8_t>(Bytes, I)); + SimpleBitstreamCursor Cursor(Reader); + EXPECT_EQ(8ull, Cursor.Read(8)); + } +} + } // end anonymous namespace |