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

Side by Side 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, 6 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 unified diff | Download patch
« no previous file with comments | « lib/Bitcode/NaCl/TestUtils/NaClBitcodeMungeWriter.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- llvm/unittest/Bitcode/NaClMungeWriteErrorTests.cpp -----------------===// 1 //===- llvm/unittest/Bitcode/NaClMungeWriteErrorTests.cpp -----------------===//
2 // Tests parser for PNaCl bitcode instructions. 2 // Tests parser for PNaCl bitcode instructions.
3 // 3 //
4 // The LLVM Compiler Infrastructure 4 // The LLVM Compiler Infrastructure
5 // 5 //
6 // This file is distributed under the University of Illinois Open Source 6 // This file is distributed under the University of Illinois Open Source
7 // License. See LICENSE.TXT for details. 7 // License. See LICENSE.TXT for details.
8 // 8 //
9 //===----------------------------------------------------------------------===// 9 //===----------------------------------------------------------------------===//
10 10
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 Terminator 656 Terminator
657 }; 657 };
658 CheckDumpEdits( 658 CheckDumpEdits(
659 ARRAY(Edit), 659 ARRAY(Edit),
660 "Error (Block 17): Malformed abbreviation found: 2: [65533, 3, 1, 10," 660 "Error (Block 17): Malformed abbreviation found: 2: [65533, 3, 1, 10,"
661 " 1, 15]\n", 661 " 1, 15]\n",
662 NoErrorRecoveryMessages, 662 NoErrorRecoveryMessages,
663 ExpectedDumpedBitcode); 663 ExpectedDumpedBitcode);
664 } 664 }
665 665
666 // Show what happens if an abbreviation definition is defined outside a block.
667 TEST(NaClMungeWriteErrorTests, AbbreviationNotInBlock) {
668 // Add abbreviation before all records.
669 const uint64_t Edit[] = {
670 0, NaClMungedBitcode::AddBefore,
671 naclbitc::DEFINE_ABBREV, naclbitc::BLK_CODE_DEFINE_ABBREV, 1,
672 1, 10, // lit(10)
673 Terminator
674 };
675 CheckDumpEdits(
676 ARRAY(Edit),
677 "Error (Block unknown): Abbreviation definition not in block: 2:"
678 " [65533, 1, 1, 10]\n",
679 NoErrorRecoveryMessages,
680 ExpectedDumpedBitcode);
681 }
682
666 } // end of namespace naclmungetest 683 } // end of namespace naclmungetest
OLDNEW
« 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