summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2016-12-14 15:48:29 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2016-12-14 15:48:29 +0000
commitafca9306a644a2ddbafd6e815944de9bb4dfafb6 (patch)
tree13d238c6dcfb459258d44abadf37b808497fab3c
parentb73e659be3fb6474ff3a993cd25ecbfa1cc4715c (diff)
parent36073947d2edb04e69ad0b20ec9de8c0712b8fd2 (diff)
Merge "Fix AssemblerMIPS64Test.LongBalc() running out of memory."
-rw-r--r--compiler/utils/mips64/assembler_mips64_test.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/utils/mips64/assembler_mips64_test.cc b/compiler/utils/mips64/assembler_mips64_test.cc
index 31d3e4c33b..f62822d73a 100644
--- a/compiler/utils/mips64/assembler_mips64_test.cc
+++ b/compiler/utils/mips64/assembler_mips64_test.cc
@@ -605,15 +605,18 @@ TEST_F(AssemblerMIPS64Test, Balc) {
}
TEST_F(AssemblerMIPS64Test, LongBalc) {
+ constexpr uint32_t kNopCount1 = (1u << 25) + 1;
+ constexpr uint32_t kNopCount2 = (1u << 25) + 1;
+ constexpr uint32_t kRequiredCapacity = (kNopCount1 + kNopCount2 + 6u) * 4u;
+ ASSERT_LT(__ GetBuffer()->Capacity(), kRequiredCapacity);
+ __ GetBuffer()->ExtendCapacity(kRequiredCapacity);
mips64::Mips64Label label1, label2;
__ Balc(&label1);
- constexpr uint32_t kNopCount1 = (1u << 25) + 1;
for (uint32_t i = 0; i != kNopCount1; ++i) {
__ Nop();
}
__ Bind(&label1);
__ Balc(&label2);
- constexpr uint32_t kNopCount2 = (1u << 25) + 1;
for (uint32_t i = 0; i != kNopCount2; ++i) {
__ Nop();
}