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

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

Issue 1310883003: Install notion of diagnostic handler into PNaCl bitcode readers. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Fix issues in patch set 2. Created 5 years, 3 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 | « unittests/Bitcode/NaClParseInstsTest.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/NaClParseTypesTest.cpp ---------------------===// 1 //===- llvm/unittest/Bitcode/NaClParseTypesTest.cpp ---------------------===//
2 // Tests parser for PNaCl bitcode. 2 // Tests parser for PNaCl bitcode.
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 NaClParseBitcodeMunger Munger(ARRAY_TERM(BitcodeRecords)); 52 NaClParseBitcodeMunger Munger(ARRAY_TERM(BitcodeRecords));
53 EXPECT_TRUE(Munger.runTest(true)); 53 EXPECT_TRUE(Munger.runTest(true));
54 EXPECT_EQ( 54 EXPECT_EQ(
55 "Successful parse!\n", 55 "Successful parse!\n",
56 Munger.getTestResults()); 56 Munger.getTestResults());
57 57
58 // Show what happens when misdefining: @t1 = float" 58 // Show what happens when misdefining: @t1 = float"
59 const uint64_t AddSelfReference[] = { 59 const uint64_t AddSelfReference[] = {
60 ReplaceIndex, NaClMungedBitcode::Replace, 3, 3, 1, Terminator 60 ReplaceIndex, NaClMungedBitcode::Replace, 3, 3, 1, Terminator
61 }; 61 };
62 EXPECT_FALSE(Munger.runTest(ARRAY(AddSelfReference), false)); 62 EXPECT_FALSE(Munger.runTest(ARRAY(AddSelfReference)));
63 EXPECT_EQ( 63 EXPECT_EQ("Invalid TYPE_CODE_FLOAT record\n"
64 "Error: Record doesn't have expected size or structure\n", 64 "Corrupted bitcode\n",
65 Munger.getTestResults()); 65 stripErrorPrefix(Munger.getTestResults()));
66 EXPECT_FALSE(Munger.runTest(ARRAY(AddSelfReference), true));
67 EXPECT_EQ(
68 "Error(40:2): Invalid TYPE_CODE_FLOAT record\n"
69 "Error: Record doesn't have expected size or structure\n",
70 Munger.getTestResults());
71 } 66 }
72 67
73 } // end of namespace naclmungetest 68 } // end of namespace naclmungetest
OLDNEW
« no previous file with comments | « unittests/Bitcode/NaClParseInstsTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698