summaryrefslogtreecommitdiff
path: root/compiler/optimizing/scheduler_test.cc
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2018-01-12 14:42:18 -0800
committerMathieu Chartier <mathieuc@google.com>2018-01-13 00:29:43 +0000
commitfa3db3d377bfaceb51c9a97864b17ce02538b7e0 (patch)
treee499305451300d3a7a9a2c4e86d5392846f889e2 /compiler/optimizing/scheduler_test.cc
parentb12293f196dffe3df29a17a054565bac1b578a4f (diff)
Change compiler tests to have aligned code item
Previously, the code item was not necessarily 32 bit aligned. This caused bus errors on armv7. Also create a real dexfile object instead of casting 0 initialized memory to a dex file pointer. We just got lucky before that the cdex boolean was false. Test: test-art-target-gtest Bug: 63756964 Bug: 71605148 Change-Id: Ic7199f2b97bbd421de1d702efa5c6531ff45c022
Diffstat (limited to 'compiler/optimizing/scheduler_test.cc')
-rw-r--r--compiler/optimizing/scheduler_test.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/optimizing/scheduler_test.cc b/compiler/optimizing/scheduler_test.cc
index 104ebc79c2..fb15fc8975 100644
--- a/compiler/optimizing/scheduler_test.cc
+++ b/compiler/optimizing/scheduler_test.cc
@@ -182,7 +182,9 @@ class SchedulerTest : public OptimizingUnitTest {
scheduler->Schedule(graph_);
}
- void CompileWithRandomSchedulerAndRun(const uint16_t* data, bool has_result, int expected) {
+ void CompileWithRandomSchedulerAndRun(const std::vector<uint16_t>& data,
+ bool has_result,
+ int expected) {
for (CodegenTargetConfig target_config : GetTargetConfigs()) {
HGraph* graph = CreateCFG(data);
@@ -393,7 +395,7 @@ TEST_F(SchedulerTest, RandomScheduling) {
// }
// return result;
//
- const uint16_t data[] = SIX_REGISTERS_CODE_ITEM(
+ const std::vector<uint16_t> data = SIX_REGISTERS_CODE_ITEM(
Instruction::CONST_4 | 0 << 12 | 2 << 8, // const/4 v2, #int 0
Instruction::CONST_HIGH16 | 0 << 8, 0x4120, // const/high16 v0, #float 10.0 // #41200000
Instruction::CONST_4 | 1 << 12 | 1 << 8, // const/4 v1, #int 1