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

Unified Diff: src/trusted/validator_mips/validator_tests.cc

Issue 11876041: [MIPS] Add thread-pointer to data addressing register list. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Update the comment. Created 7 years, 11 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 | « src/trusted/validator_mips/validator.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/trusted/validator_mips/validator_tests.cc
diff --git a/src/trusted/validator_mips/validator_tests.cc b/src/trusted/validator_mips/validator_tests.cc
index 6eed457579c0ab518f9302bdab823c26bf31fc48..f13f4a5ad33cd91418eccaf61a26c8020fe9bca0 100644
--- a/src/trusted/validator_mips/validator_tests.cc
+++ b/src/trusted/validator_mips/validator_tests.cc
@@ -45,8 +45,6 @@ using nacl_mips_val::ProblemSink;
using nacl_mips_val::CodeSegment;
using nacl_mips_dec::kInstrSize;
using nacl_mips_dec::kNop;
-using nacl_mips_dec::kRegisterStack;
-using nacl_mips_dec::kRegListReserved;
namespace {
@@ -144,20 +142,21 @@ class ValidatorTests : public ::testing::Test {
TEST_F(ValidatorTests, RecognizesDataAddressRegisters) {
/*
- * Note that the logic below needs to be kept in sync with the definition
- * of kAbiDataAddrRegisters at the top of this file.
+ * Note that the logic below needs to be kept in sync with the implementation
+ * of RegisterList::DataAddrRegs().
*
* This test is pretty trivial -- we can exercise the data_address_register
* functionality more deeply with pattern tests below.
*/
for (int i = 0; i < 31; i++) {
Register reg(i);
- if (reg.Equals(nacl_mips_dec::kRegisterStack)) {
+ if (reg.Equals(Register::Sp()) || reg.Equals(Register::Tls())) {
EXPECT_TRUE(_validator.IsDataAddressRegister(reg))
- << "Stack pointer must be a data address register.";
+ << "Stack pointer and TLS register must be data address registers.";
} else {
EXPECT_FALSE(_validator.IsDataAddressRegister(reg))
- << "Only the stack pointer must be a data address register.";
+ << "Only the stack pointer and TLS register are data "
+ "address registers.";
}
}
}
@@ -404,8 +403,8 @@ ValidatorTests::ValidatorTests()
: _validator(kBytesPerBundle,
kCodeRegionSize,
kDataRegionSize,
- kRegListReserved,
- RegisterList(kRegisterStack)) {}
+ RegisterList::ReservedRegs(),
+ RegisterList::DataAddrRegs()) {}
bool ValidatorTests::Validate(const mips_inst *pattern,
size_t inst_count,
« no previous file with comments | « src/trusted/validator_mips/validator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698