Chromium Code Reviews| Index: runtime/vm/assembler_arm_test.cc |
| =================================================================== |
| --- runtime/vm/assembler_arm_test.cc (revision 19404) |
| +++ runtime/vm/assembler_arm_test.cc (working copy) |
| @@ -5,8 +5,10 @@ |
| #include "vm/globals.h" |
| #if defined(TARGET_ARCH_ARM) |
| +#include "vm/assembler_macros.h" |
| #include "vm/assembler.h" |
| #include "vm/os.h" |
| +#include "vm/simulator.h" |
| #include "vm/unit_test.h" |
| #include "vm/virtual_memory.h" |
| @@ -1361,6 +1363,27 @@ |
| EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); |
| } |
| + |
| +// 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
|
| +#ifdef USING_SIMULATOR |
|
regis
2013/03/04 21:54:52
We prefer the form #if defined(USING_SIMULATOR), w
|
| +ASSEMBLER_TEST_GENERATE(HasDiv, assembler) { |
| + AssemblerMacros::HasDiv(assembler, R0); |
| + __ mov(PC, ShifterOperand(LR)); |
| +} |
| + |
| + |
| +ASSEMBLER_TEST_RUN(HasDiv, test) { |
| + EXPECT(test != NULL); |
| + typedef int (*Tst)(); |
| + if (FLAG_sim_has_int_div) { |
|
regis
2013/03/04 21:54:52
A flag is problematic to maintain when running tes
|
| + EXPECT_LT(0, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); |
| + } else { |
| + EXPECT_EQ(0, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); |
| + } |
| +} |
| +#endif |
|
regis
2013/03/04 21:54:52
We like to repeat the #if as a comment, unless the
|
| + |
| + |
| } // namespace dart |
| #endif // defined TARGET_ARCH_ARM |