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

Unified Diff: runtime/vm/object_test.cc

Issue 8758012: Port object tests to x64. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 1 month 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/object_ia32_test.cc ('k') | runtime/vm/object_x64_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object_test.cc
===================================================================
--- runtime/vm/object_test.cc (revision 1958)
+++ runtime/vm/object_test.cc (working copy)
@@ -2065,7 +2065,8 @@
}
-#if defined(TARGET_ARCH_IA32) // only ia32 can run execution tests.
+// only ia32 and x64 can run execution tests.
+#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
// Test for Code and Instruction object creation.
TEST_CASE(Code) {
extern void GenerateIncrement(Assembler* assembler);
@@ -2104,8 +2105,8 @@
// Test for Embedded Smi object in the instructions.
TEST_CASE(EmbedSmiInCode) {
- extern void GenerateEmbedSmiInCode(Assembler* assembler, int value);
- const int kSmiTestValue = 5;
+ extern void GenerateEmbedSmiInCode(Assembler* assembler, intptr_t value);
+ const intptr_t kSmiTestValue = 5;
Assembler _assembler_;
GenerateEmbedSmiInCode(&_assembler_, kSmiTestValue);
Code& code = Code::Handle(
@@ -2118,6 +2119,24 @@
}
+#if defined(ARCH_IS_64_BIT)
+// Test for Embedded Smi object in the instructions.
+TEST_CASE(EmbedSmiIn64BitCode) {
+ extern void GenerateEmbedSmiInCode(Assembler* assembler, intptr_t value);
+ const intptr_t kSmiTestValue = 5L << 32;
+ Assembler _assembler_;
+ GenerateEmbedSmiInCode(&_assembler_, kSmiTestValue);
+ Code& code = Code::Handle(
+ Code::FinalizeCode("Test_EmbedSmiIn64BitCode", &_assembler_));
+ Instructions& instructions = Instructions::Handle(code.instructions());
+ typedef intptr_t (*EmbedSmiCode)();
+ intptr_t retval =
+ reinterpret_cast<EmbedSmiCode>(instructions.EntryPoint())();
+ EXPECT((retval >> kSmiTagShift) == kSmiTestValue);
+}
+#endif
+
+
TEST_CASE(ExceptionHandlers) {
const int kNumEntries = 6;
// Add an exception handler table to the code.
@@ -2218,6 +2237,6 @@
ASSERT(count == 2);
}
-#endif // TARGET_ARCH_IA32.
+#endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64).
} // namespace dart
« no previous file with comments | « runtime/vm/object_ia32_test.cc ('k') | runtime/vm/object_x64_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698