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

Unified Diff: runtime/vm/assembler_arm_test.cc

Issue 12378080: Adds mrc instruction to arm simulator, assembler, disassembler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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
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

Powered by Google App Engine
This is Rietveld 408576698