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

Side by Side Diff: unittests/Bitcode/NaClAbbrevErrorTests.cpp

Issue 986453002: Additional clean ups on errors in bitcode parsing. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Fix comment. Created 5 years, 9 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/Reader/NaClBitstreamReader.cpp ('k') | unittests/Bitcode/NaClObjDumpTest.cpp » ('j') | 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/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
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.
OLDNEW
« no previous file with comments | « lib/Bitcode/NaCl/Reader/NaClBitstreamReader.cpp ('k') | unittests/Bitcode/NaClObjDumpTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698