Revision: 23507
Author:   [email protected]
Date:     Fri Aug 29 05:37:55 2014 UTC
Log:      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

Review URL: https://codereview.chromium.org/517943002
https://code.google.com/p/v8/source/detail?r=23507

Modified:
 /branches/bleeding_edge/test/cctest/cctest.status
 /branches/bleeding_edge/test/cctest/compiler/test-run-properties.cc

=======================================
--- /branches/bleeding_edge/test/cctest/cctest.status Thu Aug 28 17:46:33 2014 UTC +++ /branches/bleeding_edge/test/cctest/cctest.status Fri Aug 29 05:37:55 2014 UTC
@@ -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],

=======================================
--- /branches/bleeding_edge/test/cctest/compiler/test-run-properties.cc Thu Aug 28 17:28:57 2014 UTC +++ /branches/bleeding_edge/test/cctest/compiler/test-run-properties.cc Fri Aug 29 05:37:55 2014 UTC
@@ -11,16 +11,14 @@

 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 @@
       "  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