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

Unified Diff: runtime/vm/assembler_x64_test.cc

Issue 832173009: Unit tests for 'testb' instruction on ia32 and x64. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 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
« no previous file with comments | « runtime/vm/assembler_ia32_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_x64_test.cc
===================================================================
--- runtime/vm/assembler_x64_test.cc (revision 42713)
+++ runtime/vm/assembler_x64_test.cc (working copy)
@@ -297,6 +297,30 @@
}
+ASSEMBLER_TEST_GENERATE(Testb, assembler) {
+ Label done;
+ __ movq(RAX, Immediate(1));
+ __ movq(RCX, Immediate(0));
+ __ pushq(Immediate(0xffffff11));
+ __ testb(Address(RSP, 0), Immediate(0x10));
+ // Fail if zero flag set.
+ __ cmoveq(RAX, RCX);
+ __ testb(Address(RSP, 0), Immediate(0x20));
+ // Fail if zero flag not set.
+ __ j(ZERO, &done);
regis 2015/01/09 16:30:39 I guess cmovneq is not implemented :-)
koda 2015/01/09 16:37:07 Exactly :)
+ __ movq(RAX, Immediate(0));
+ __ Bind(&done);
+ __ popq(RCX);
+ __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(Testb, test) {
+ typedef int (*TestbCode)();
+ EXPECT_EQ(1, reinterpret_cast<TestbCode>(test->entry())());
+}
+
+
ASSEMBLER_TEST_GENERATE(Increment, assembler) {
__ movq(RAX, Immediate(0));
__ pushq(RAX);
« no previous file with comments | « runtime/vm/assembler_ia32_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698