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 |