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

Unified Diff: unittest/IceParseInstsTest.cpp

Issue 1173353003: Unittest fixes. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: unittest/IceParseInstsTest.cpp
diff --git a/unittest/IceParseInstsTest.cpp b/unittest/IceParseInstsTest.cpp
index f35e46e0f62831d225d7c981ac028c2a4b8848e0..ef1050b56f2a55257c0b0363f6d738b9544100ff 100644
--- a/unittest/IceParseInstsTest.cpp
+++ b/unittest/IceParseInstsTest.cpp
@@ -57,7 +57,14 @@ TEST(IceParseInstsTest, NonexistentCallArg) {
// Show that we get appropriate error when parsing in Subzero.
IceTest::SubzeroBitcodeMunger Munger(ARRAY_TERM(BitcodeRecords));
EXPECT_FALSE(Munger.runTest());
Karl 2015/06/11 19:58:54 Why not add an (optional) flag to runTest() in (un
John 2015/06/11 20:42:09 There was precedent to doing this (e.g., lines 52-
- EXPECT_EQ("Error(66:4): Invalid function record: <34 0 4 2 100>\n",
+ EXPECT_EQ("\t.type\t__Sz_block_profile_info,@object\n"
Jim Stichnoth 2015/06/11 19:07:14 Can you factor this string into a const char *, or
John 2015/06/11 20:42:09 Not easily. EXPECT_EQ expands to another another m
+ "\t.section\t.rodata,\"a\",@progbits\n"
+ "\t.globl\t__Sz_block_profile_info\n"
+ "\t.align\t8"
+ "\n__Sz_block_profile_info:\n"
+ "\t.zero\t8\n"
+ "\t.size\t__Sz_block_profile_info, 8\n"
+ "Error(66:4): Invalid function record: <34 0 4 2 100>\n",
Munger.getTestResults());
// Show that we generate a fatal error when not allowing error recovery.
@@ -113,7 +120,14 @@ TEST(IceParseInstsTests, AllocaAlignment) {
3, naclbitc::FUNC_CODE_INST_ALLOCA, 1, getEncAlignPower(30), Terminator,
};
EXPECT_FALSE(Munger.runTest(ARRAY(Align30)));
- EXPECT_EQ("Error(62:4): Invalid function record: <19 1 31>\n",
+ EXPECT_EQ("\t.type\t__Sz_block_profile_info,@object\n"
+ "\t.section\t.rodata,\"a\",@progbits\n"
+ "\t.globl\t__Sz_block_profile_info\n"
+ "\t.align\t8"
+ "\n__Sz_block_profile_info:\n"
+ "\t.zero\t8\n"
+ "\t.size\t__Sz_block_profile_info, 8\n"
+ "Error(62:4): Invalid function record: <19 1 31>\n",
Munger.getTestResults());
EXPECT_FALSE(DumpMunger.runTestForAssembly(ARRAY(Align30)));
@@ -168,7 +182,14 @@ TEST(IceParseInstsTests, LoadI32Alignment) {
3, naclbitc::FUNC_CODE_INST_LOAD, 1, getEncAlignZero(), 0, Terminator,
};
EXPECT_FALSE(Munger.runTest(ARRAY(Align0)));
- EXPECT_EQ("Error(58:4): Invalid function record: <20 1 0 0>\n",
+ EXPECT_EQ("\t.type\t__Sz_block_profile_info,@object\n"
+ "\t.section\t.rodata,\"a\",@progbits\n"
+ "\t.globl\t__Sz_block_profile_info\n"
+ "\t.align\t8"
+ "\n__Sz_block_profile_info:\n"
+ "\t.zero\t8\n"
+ "\t.size\t__Sz_block_profile_info, 8\n"
+ "Error(58:4): Invalid function record: <20 1 0 0>\n",
Munger.getTestResults());
EXPECT_FALSE(DumpMunger.runTestForAssembly(ARRAY(Align0)));
EXPECT_EQ(" %v0 = load i32* %p0, align 0;\n"
@@ -181,7 +202,14 @@ TEST(IceParseInstsTests, LoadI32Alignment) {
3, naclbitc::FUNC_CODE_INST_LOAD, 1, getEncAlignPower(2), 0, Terminator,
};
EXPECT_FALSE(Munger.runTest(ARRAY(Align4)));
- EXPECT_EQ("Error(58:4): Invalid function record: <20 1 3 0>\n",
+ EXPECT_EQ("\t.type\t__Sz_block_profile_info,@object\n"
+ "\t.section\t.rodata,\"a\",@progbits\n"
+ "\t.globl\t__Sz_block_profile_info\n"
+ "\t.align\t8"
+ "\n__Sz_block_profile_info:\n"
+ "\t.zero\t8\n"
+ "\t.size\t__Sz_block_profile_info, 8\n"
+ "Error(58:4): Invalid function record: <20 1 3 0>\n",
Munger.getTestResults());
EXPECT_FALSE(DumpMunger.runTestForAssembly(ARRAY(Align4)));
EXPECT_EQ(" %v0 = load i32* %p0, align 4;\n"
@@ -194,7 +222,14 @@ TEST(IceParseInstsTests, LoadI32Alignment) {
3, naclbitc::FUNC_CODE_INST_LOAD, 1, getEncAlignPower(29), 0, Terminator,
};
EXPECT_FALSE(Munger.runTest(ARRAY(Align29)));
- EXPECT_EQ("Error(58:4): Invalid function record: <20 1 30 0>\n",
+ EXPECT_EQ("\t.type\t__Sz_block_profile_info,@object\n"
+ "\t.section\t.rodata,\"a\",@progbits\n"
+ "\t.globl\t__Sz_block_profile_info\n"
+ "\t.align\t8"
+ "\n__Sz_block_profile_info:\n"
+ "\t.zero\t8\n"
+ "\t.size\t__Sz_block_profile_info, 8\n"
+ "Error(58:4): Invalid function record: <20 1 30 0>\n",
Munger.getTestResults());
EXPECT_FALSE(DumpMunger.runTestForAssembly(ARRAY(Align29)));
EXPECT_EQ(" %v0 = load i32* %p0, align 536870912;\n"
@@ -207,7 +242,14 @@ TEST(IceParseInstsTests, LoadI32Alignment) {
3, naclbitc::FUNC_CODE_INST_LOAD, 1, getEncAlignPower(30), 0, Terminator,
};
EXPECT_FALSE(Munger.runTest(ARRAY(Align30)));
- EXPECT_EQ("Error(58:4): Invalid function record: <20 1 31 0>\n",
+ EXPECT_EQ("\t.type\t__Sz_block_profile_info,@object\n"
+ "\t.section\t.rodata,\"a\",@progbits\n"
+ "\t.globl\t__Sz_block_profile_info\n"
+ "\t.align\t8"
+ "\n__Sz_block_profile_info:\n"
+ "\t.zero\t8\n"
+ "\t.size\t__Sz_block_profile_info, 8\n"
+ "Error(58:4): Invalid function record: <20 1 31 0>\n",
Munger.getTestResults());
EXPECT_FALSE(DumpMunger.runTestForAssembly(ARRAY(Align30)));
EXPECT_EQ(" %v0 = load i32* %p0, align 0;\n"
@@ -250,7 +292,14 @@ TEST(IceParseInstsTests, LoadFloatAlignment) {
3, naclbitc::FUNC_CODE_INST_LOAD, 1, getEncAlignZero(), 0, Terminator,
};
EXPECT_FALSE(Munger.runTest(ARRAY(Align0)));
- EXPECT_EQ("Error(58:4): Invalid function record: <20 1 0 0>\n",
+ EXPECT_EQ("\t.type\t__Sz_block_profile_info,@object\n"
+ "\t.section\t.rodata,\"a\",@progbits\n"
+ "\t.globl\t__Sz_block_profile_info\n"
+ "\t.align\t8"
+ "\n__Sz_block_profile_info:\n"
+ "\t.zero\t8\n"
+ "\t.size\t__Sz_block_profile_info, 8\n"
+ "Error(58:4): Invalid function record: <20 1 0 0>\n",
Munger.getTestResults());
EXPECT_FALSE(DumpMunger.runTestForAssembly(ARRAY(Align0)));
EXPECT_EQ(
@@ -273,7 +322,14 @@ TEST(IceParseInstsTests, LoadFloatAlignment) {
3, naclbitc::FUNC_CODE_INST_LOAD, 1, getEncAlignPower(29), 0, Terminator,
};
EXPECT_FALSE(Munger.runTest(ARRAY(Align29)));
- EXPECT_EQ("Error(58:4): Invalid function record: <20 1 30 0>\n",
+ EXPECT_EQ("\t.type\t__Sz_block_profile_info,@object\n"
+ "\t.section\t.rodata,\"a\",@progbits\n"
+ "\t.globl\t__Sz_block_profile_info\n"
+ "\t.align\t8"
+ "\n__Sz_block_profile_info:\n"
+ "\t.zero\t8\n"
+ "\t.size\t__Sz_block_profile_info, 8\n"
+ "Error(58:4): Invalid function record: <20 1 30 0>\n",
Munger.getTestResults());
EXPECT_FALSE(DumpMunger.runTestForAssembly(ARRAY(Align29)));
EXPECT_EQ(
@@ -287,7 +343,14 @@ TEST(IceParseInstsTests, LoadFloatAlignment) {
3, naclbitc::FUNC_CODE_INST_LOAD, 1, getEncAlignPower(30), 0, Terminator,
};
EXPECT_FALSE(Munger.runTest(ARRAY(Align30)));
- EXPECT_EQ("Error(58:4): Invalid function record: <20 1 31 0>\n",
+ EXPECT_EQ("\t.type\t__Sz_block_profile_info,@object\n"
+ "\t.section\t.rodata,\"a\",@progbits\n"
+ "\t.globl\t__Sz_block_profile_info\n"
+ "\t.align\t8"
+ "\n__Sz_block_profile_info:\n"
+ "\t.zero\t8\n"
+ "\t.size\t__Sz_block_profile_info, 8\n"
+ "Error(58:4): Invalid function record: <20 1 31 0>\n",
Munger.getTestResults());
EXPECT_FALSE(DumpMunger.runTestForAssembly(ARRAY(Align30)));
EXPECT_EQ(
@@ -333,7 +396,14 @@ TEST(NaClParseInstsTests, StoreAlignment) {
3, naclbitc::FUNC_CODE_INST_STORE, 2, 1, getEncAlignZero(), Terminator,
};
EXPECT_FALSE(Munger.runTest(ARRAY(Align0)));
- EXPECT_EQ("Error(62:4): Invalid function record: <24 2 1 0>\n",
+ EXPECT_EQ("\t.type\t__Sz_block_profile_info,@object\n"
+ "\t.section\t.rodata,\"a\",@progbits\n"
+ "\t.globl\t__Sz_block_profile_info\n"
+ "\t.align\t8"
+ "\n__Sz_block_profile_info:\n"
+ "\t.zero\t8\n"
+ "\t.size\t__Sz_block_profile_info, 8\n"
+ "Error(62:4): Invalid function record: <24 2 1 0>\n",
Munger.getTestResults());
EXPECT_FALSE(DumpMunger.runTestForAssembly(ARRAY(Align0)));
EXPECT_EQ(
@@ -355,7 +425,14 @@ TEST(NaClParseInstsTests, StoreAlignment) {
3, naclbitc::FUNC_CODE_INST_STORE, 2, 1, getEncAlignPower(3), Terminator,
};
EXPECT_FALSE(Munger.runTest(ARRAY(Align8)));
- EXPECT_EQ("Error(62:4): Invalid function record: <24 2 1 4>\n",
+ EXPECT_EQ("\t.type\t__Sz_block_profile_info,@object\n"
+ "\t.section\t.rodata,\"a\",@progbits\n"
+ "\t.globl\t__Sz_block_profile_info\n"
+ "\t.align\t8"
+ "\n__Sz_block_profile_info:\n"
+ "\t.zero\t8\n"
+ "\t.size\t__Sz_block_profile_info, 8\n"
+ "Error(62:4): Invalid function record: <24 2 1 4>\n",
Munger.getTestResults());
EXPECT_FALSE(DumpMunger.runTestForAssembly(ARRAY(Align8)));
EXPECT_EQ(
@@ -369,7 +446,14 @@ TEST(NaClParseInstsTests, StoreAlignment) {
3, naclbitc::FUNC_CODE_INST_STORE, 2, 1, getEncAlignPower(29), Terminator,
};
EXPECT_FALSE(Munger.runTest(ARRAY(Align29)));
- EXPECT_EQ("Error(62:4): Invalid function record: <24 2 1 30>\n",
+ EXPECT_EQ("\t.type\t__Sz_block_profile_info,@object\n"
+ "\t.section\t.rodata,\"a\",@progbits\n"
+ "\t.globl\t__Sz_block_profile_info\n"
+ "\t.align\t8"
+ "\n__Sz_block_profile_info:\n"
+ "\t.zero\t8\n"
+ "\t.size\t__Sz_block_profile_info, 8\n"
+ "Error(62:4): Invalid function record: <24 2 1 30>\n",
Munger.getTestResults());
EXPECT_FALSE(DumpMunger.runTestForAssembly(ARRAY(Align29)));
EXPECT_EQ(
@@ -383,7 +467,14 @@ TEST(NaClParseInstsTests, StoreAlignment) {
3, naclbitc::FUNC_CODE_INST_STORE, 2, 1, getEncAlignPower(30), Terminator,
};
EXPECT_FALSE(Munger.runTest(ARRAY(Align30)));
- EXPECT_EQ("Error(62:4): Invalid function record: <24 2 1 31>\n",
+ EXPECT_EQ("\t.type\t__Sz_block_profile_info,@object\n"
+ "\t.section\t.rodata,\"a\",@progbits\n"
+ "\t.globl\t__Sz_block_profile_info\n"
+ "\t.align\t8"
+ "\n__Sz_block_profile_info:\n"
+ "\t.zero\t8\n"
+ "\t.size\t__Sz_block_profile_info, 8\n"
+ "Error(62:4): Invalid function record: <24 2 1 31>\n",
Munger.getTestResults());
EXPECT_FALSE(DumpMunger.runTestForAssembly(ARRAY(Align30)));
EXPECT_EQ(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698