OLD | NEW |
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 Loading... |
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 |
OLD | NEW |