OLD | NEW |
1 //===- llvm/unittest/Bitcode/NaClAbbrevErrorTests.cpp ---------------------===// | 1 //===- llvm/unittest/Bitcode/NaClAbbrevErrorTests.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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // Shows what happens when we change the abbreviation index to an | 72 // Shows what happens when we change the abbreviation index to an |
73 // illegal value. | 73 // illegal value. |
74 const uint64_t AbbrevIndex4[] = { | 74 const uint64_t AbbrevIndex4[] = { |
75 ReplaceIndex, NaClBitcodeMunger::Replace, | 75 ReplaceIndex, NaClBitcodeMunger::Replace, |
76 4, naclbitc::TYPE_CODE_VOID, Terminator, | 76 4, naclbitc::TYPE_CODE_VOID, Terminator, |
77 }; | 77 }; |
78 DumpMunger.setRunAsDeathTest(true); | 78 DumpMunger.setRunAsDeathTest(true); |
79 EXPECT_DEATH( | 79 EXPECT_DEATH( |
80 DumpMunger.runTest("Bad abbreviation index 4", | 80 DumpMunger.runTest("Bad abbreviation index 4", |
81 AbbrevIndex4, array_lengthof(AbbrevIndex4)), | 81 AbbrevIndex4, array_lengthof(AbbrevIndex4)), |
82 ".*Error\\(35\\:0\\)\\: Invalid abbreviation \\# 4 defined for record.*"); | 82 ".*Fatal\\(35\\:0\\)\\: Invalid abbreviation \\# 4 defined for record.*"); |
83 | 83 |
84 // Test that bitcode reader reports problem correctly. | 84 // Test that bitcode reader reports problem correctly. |
85 NaClParseBitcodeMunger Munger(BitcodeRecords, | 85 NaClParseBitcodeMunger Munger(BitcodeRecords, |
86 array_lengthof(BitcodeRecords), Terminator); | 86 array_lengthof(BitcodeRecords), Terminator); |
87 EXPECT_DEATH( | 87 EXPECT_DEATH( |
88 Munger.runTest("Bad abbreviation index", | 88 Munger.runTest("Bad abbreviation index", |
89 AbbrevIndex4, array_lengthof(AbbrevIndex4), true), | 89 AbbrevIndex4, array_lengthof(AbbrevIndex4), true), |
90 ".*Error\\(35\\:0\\)\\: Invalid abbreviation \\# 4 defined for record.*"); | 90 ".*Fatal\\(35\\:0\\)\\: Invalid abbreviation \\# 4 defined for record.*"); |
91 } | 91 } |
92 | 92 |
93 } // end of anonymous namespace. | 93 } // end of anonymous namespace. |
OLD | NEW |