Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(449)

Unified Diff: unittests/Bitcode/NaClMungeWriteErrorTests.cpp

Issue 1150183010: Add error recovery for abbreviations outside blocks in bitcode. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Add test case. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/Bitcode/NaCl/TestUtils/NaClBitcodeMungeWriter.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: unittests/Bitcode/NaClMungeWriteErrorTests.cpp
diff --git a/unittests/Bitcode/NaClMungeWriteErrorTests.cpp b/unittests/Bitcode/NaClMungeWriteErrorTests.cpp
index f4e7da7615704edb1c7256baae2a027784696eb7..539e9e3e7e10b24c139dcd6a3aaf1cf1ba4c6dda 100644
--- a/unittests/Bitcode/NaClMungeWriteErrorTests.cpp
+++ b/unittests/Bitcode/NaClMungeWriteErrorTests.cpp
@@ -663,4 +663,21 @@ TEST(NaClMungeWriteErrorTests, SpecifiesTooManyOperands) {
ExpectedDumpedBitcode);
}
+// Show what happens if an abbreviation definition is defined outside a block.
+TEST(NaClMungeWriteErrorTests, AbbreviationNotInBlock) {
+ // Add abbreviation before all records.
+ const uint64_t Edit[] = {
+ 0, NaClMungedBitcode::AddBefore,
+ naclbitc::DEFINE_ABBREV, naclbitc::BLK_CODE_DEFINE_ABBREV, 1,
+ 1, 10, // lit(10)
+ Terminator
+ };
+ CheckDumpEdits(
+ ARRAY(Edit),
+ "Error (Block unknown): Abbreviation definition not in block: 2:"
+ " [65533, 1, 1, 10]\n",
+ NoErrorRecoveryMessages,
+ ExpectedDumpedBitcode);
+}
+
} // end of namespace naclmungetest
« no previous file with comments | « lib/Bitcode/NaCl/TestUtils/NaClBitcodeMungeWriter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698