Reviewers: Michael Starzinger,

Message:
Committed patchset #1 manually as 23507 (presubmit successful).

Description:
Fix cctest/test-run-properties/TypedArrayLoad.

Note: The test failure was unrelated to the fact that it run on actual
ARM hardware, but it was failing because the test relied on undefined
and implementation defined behaviour of the C++ compiler.

[email protected]
TEST=cctest

Committed: https://code.google.com/p/v8/source/detail?r=23507

Please review this at https://codereview.chromium.org/517943002/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+11, -15 lines):
  M test/cctest/cctest.status
  M test/cctest/compiler/test-run-properties.cc


Index: test/cctest/cctest.status
diff --git a/test/cctest/cctest.status b/test/cctest/cctest.status
index ff26d9704f4cccca311039aefe8296f58c6df07b..f2bb922c4f3c8cfecc3266fdcb349881c7ad266a 100644
--- a/test/cctest/cctest.status
+++ b/test/cctest/cctest.status
@@ -269,9 +269,6 @@
##############################################################################
 ['arch == arm', {

- # TODO(mstarzinger): This fails on ARM hardware, but not in the simulator.
-  'test-run-properties/TypedArrayLoad': [SKIP],
-
   # BUG(355): Test crashes on ARM.
   'test-log/ProfLazyMode': [SKIP],

Index: test/cctest/compiler/test-run-properties.cc
diff --git a/test/cctest/compiler/test-run-properties.cc b/test/cctest/compiler/test-run-properties.cc index 72816da9bcf22fad68606585fd6d7274c40f9568..2ba95764129a6c920284b0eeafce9b77785640df 100644
--- a/test/cctest/compiler/test-run-properties.cc
+++ b/test/cctest/compiler/test-run-properties.cc
@@ -11,16 +11,14 @@ using namespace v8::internal::compiler;

 template <typename U>
 static void TypedArrayLoadHelper(const char* array_type) {
-  const int64_t values[] = {
+  static const uint32_t kValues[] = {
0x00000000, 0x00000001, 0x00000023, 0x00000042, 0x12345678, 0x87654321, 0x0000003f, 0x0000007f, 0x00003fff, 0x00007fff, 0x3fffffff, 0x7fffffff, - 0x000000ff, 0x00000080, 0x0000ffff, 0x00008000, 0xffffffff, 0x80000000,
-  };
-  size_t size = arraysize(values);
+ 0x000000ff, 0x00000080, 0x0000ffff, 0x00008000, 0xffffffff, 0x80000000};
   EmbeddedVector<char, 1024> values_buffer;
StringBuilder values_builder(values_buffer.start(), values_buffer.length());
-  for (unsigned i = 0; i < size; i++) {
-    values_builder.AddFormatted("a[%d] = 0x%08x;", i, values[i]);
+  for (size_t i = 0; i < arraysize(kValues); ++i) {
+    values_builder.AddFormatted("a[%d] = 0x%08x;", i, kValues[i]);
   }

// Note that below source creates two different typed arrays with distinct @@ -40,16 +38,17 @@ static void TypedArrayLoadHelper(const char* array_type) {
       "  return f;"
       "})()";
   EmbeddedVector<char, 1024> source_buffer;
-  SNPrintF(source_buffer, source, array_type, size, values_buffer.start(),
- array_type, size, values_buffer.start(), array_type, array_type);
+  SNPrintF(source_buffer, source, array_type, arraysize(kValues),
+           values_buffer.start(), array_type, arraysize(kValues),
+           values_buffer.start(), array_type, array_type);

   FunctionTester T(
       source_buffer.start(),
CompilationInfo::kContextSpecializing | CompilationInfo::kTypingEnabled);
-  for (unsigned i = 0; i < size; i++) {
-    for (unsigned j = 0; j < size; j++) {
-      double value_a = static_cast<U>(values[i]);
-      double value_b = static_cast<U>(values[j]);
+  for (size_t i = 0; i < arraysize(kValues); ++i) {
+    for (size_t j = 0; j < arraysize(kValues); ++j) {
+      double value_a = static_cast<U>(kValues[i]);
+      double value_b = static_cast<U>(kValues[j]);
       double expected = value_a + value_b;
       T.CheckCall(T.Val(expected), T.Val(i), T.Val(j));
     }


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to