Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 7 | 7 |
| 8 #include "vm/assembler_macros.h" | |
| 8 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
| 9 #include "vm/os.h" | 10 #include "vm/os.h" |
| 11 #include "vm/simulator.h" | |
| 10 #include "vm/unit_test.h" | 12 #include "vm/unit_test.h" |
| 11 #include "vm/virtual_memory.h" | 13 #include "vm/virtual_memory.h" |
| 12 | 14 |
| 13 namespace dart { | 15 namespace dart { |
| 14 | 16 |
| 15 #define __ assembler-> | 17 #define __ assembler-> |
| 16 | 18 |
| 17 | 19 |
| 18 ASSEMBLER_TEST_GENERATE(Simple, assembler) { | 20 ASSEMBLER_TEST_GENERATE(Simple, assembler) { |
| 19 __ mov(R0, ShifterOperand(42)); | 21 __ mov(R0, ShifterOperand(42)); |
| (...skipping 1334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1354 __ mov(PC, ShifterOperand(LR)); | 1356 __ mov(PC, ShifterOperand(LR)); |
| 1355 } | 1357 } |
| 1356 | 1358 |
| 1357 | 1359 |
| 1358 ASSEMBLER_TEST_RUN(VstmsVldms_off, test) { | 1360 ASSEMBLER_TEST_RUN(VstmsVldms_off, test) { |
| 1359 EXPECT(test != NULL); | 1361 EXPECT(test != NULL); |
| 1360 typedef int (*Tst)(); | 1362 typedef int (*Tst)(); |
| 1361 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); | 1363 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); |
| 1362 } | 1364 } |
| 1363 | 1365 |
| 1366 | |
| 1367 // If we are in the simulator, check that HasDiv returns the expected result | |
|
regis
2013/03/04 21:54:52
You can run this test even if we are running on re
srdjan
2013/03/04 22:02:17
ditto
| |
| 1368 #ifdef USING_SIMULATOR | |
|
regis
2013/03/04 21:54:52
We prefer the form #if defined(USING_SIMULATOR), w
| |
| 1369 ASSEMBLER_TEST_GENERATE(HasDiv, assembler) { | |
| 1370 AssemblerMacros::HasDiv(assembler, R0); | |
| 1371 __ mov(PC, ShifterOperand(LR)); | |
| 1372 } | |
| 1373 | |
| 1374 | |
| 1375 ASSEMBLER_TEST_RUN(HasDiv, test) { | |
| 1376 EXPECT(test != NULL); | |
| 1377 typedef int (*Tst)(); | |
| 1378 if (FLAG_sim_has_int_div) { | |
|
regis
2013/03/04 21:54:52
A flag is problematic to maintain when running tes
| |
| 1379 EXPECT_LT(0, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); | |
| 1380 } else { | |
| 1381 EXPECT_EQ(0, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); | |
| 1382 } | |
| 1383 } | |
| 1384 #endif | |
|
regis
2013/03/04 21:54:52
We like to repeat the #if as a comment, unless the
| |
| 1385 | |
| 1386 | |
| 1364 } // namespace dart | 1387 } // namespace dart |
| 1365 | 1388 |
| 1366 #endif // defined TARGET_ARCH_ARM | 1389 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |