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

Unified Diff: runtime/vm/assembler_ia32_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 | « no previous file | runtime/vm/assembler_x64_test.cc » ('j') | runtime/vm/assembler_x64_test.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_ia32_test.cc
===================================================================
--- runtime/vm/assembler_ia32_test.cc (revision 42713)
+++ runtime/vm/assembler_ia32_test.cc (working copy)
@@ -198,6 +198,27 @@
}
+ASSEMBLER_TEST_GENERATE(Testb, assembler) {
+ __ movl(EAX, Immediate(1));
+ __ movl(ECX, Immediate(0));
+ __ pushl(Immediate(0xffffff11));
+ __ testb(Address(ESP, 0), Immediate(0x10));
+ // Fail if zero flag set.
+ __ cmove(EAX, ECX);
+ __ testb(Address(ESP, 0), Immediate(0x20));
+ // Fail if zero flag not set.
+ __ cmovne(EAX, ECX);
+ __ popl(ECX);
+ __ ret();
+}
+
+
+ASSEMBLER_TEST_RUN(Testb, test) {
+ typedef int (*TestbCode)();
+ EXPECT_EQ(1, reinterpret_cast<TestbCode>(test->entry())());
+}
+
+
ASSEMBLER_TEST_GENERATE(Increment, assembler) {
__ movl(EAX, Immediate(0));
__ pushl(EAX);
« no previous file with comments | « no previous file | runtime/vm/assembler_x64_test.cc » ('j') | runtime/vm/assembler_x64_test.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698