OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "test/cctest/compiler/function-tester.h" | 7 #include "test/cctest/compiler/function-tester.h" |
8 | 8 |
9 using namespace v8::internal; | 9 using namespace v8::internal; |
10 using namespace v8::internal::compiler; | 10 using namespace v8::internal::compiler; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 values_buffer.start(), array_type, array_type); | 43 values_buffer.start(), array_type, array_type); |
44 | 44 |
45 FunctionTester T( | 45 FunctionTester T( |
46 source_buffer.start(), | 46 source_buffer.start(), |
47 CompilationInfo::kContextSpecializing | CompilationInfo::kTypingEnabled); | 47 CompilationInfo::kContextSpecializing | CompilationInfo::kTypingEnabled); |
48 for (size_t i = 0; i < arraysize(kValues); ++i) { | 48 for (size_t i = 0; i < arraysize(kValues); ++i) { |
49 for (size_t j = 0; j < arraysize(kValues); ++j) { | 49 for (size_t j = 0; j < arraysize(kValues); ++j) { |
50 double value_a = static_cast<U>(kValues[i]); | 50 double value_a = static_cast<U>(kValues[i]); |
51 double value_b = static_cast<U>(kValues[j]); | 51 double value_b = static_cast<U>(kValues[j]); |
52 double expected = value_a + value_b; | 52 double expected = value_a + value_b; |
53 T.CheckCall(T.Val(expected), T.Val(i), T.Val(j)); | 53 T.CheckCall(T.Val(expected), T.Val(static_cast<double>(i)), |
| 54 T.Val(static_cast<double>(j))); |
54 } | 55 } |
55 } | 56 } |
56 } | 57 } |
57 | 58 |
58 | 59 |
59 TEST(TypedArrayLoad) { | 60 TEST(TypedArrayLoad) { |
60 FLAG_typed_array_max_size_in_heap = 256; | 61 FLAG_typed_array_max_size_in_heap = 256; |
61 TypedArrayLoadHelper<int8_t>("Int8"); | 62 TypedArrayLoadHelper<int8_t>("Int8"); |
62 TypedArrayLoadHelper<uint8_t>("Uint8"); | 63 TypedArrayLoadHelper<uint8_t>("Uint8"); |
63 TypedArrayLoadHelper<int16_t>("Int16"); | 64 TypedArrayLoadHelper<int16_t>("Int16"); |
64 TypedArrayLoadHelper<uint16_t>("Uint16"); | 65 TypedArrayLoadHelper<uint16_t>("Uint16"); |
65 TypedArrayLoadHelper<int32_t>("Int32"); | 66 TypedArrayLoadHelper<int32_t>("Int32"); |
66 TypedArrayLoadHelper<uint32_t>("Uint32"); | 67 TypedArrayLoadHelper<uint32_t>("Uint32"); |
67 TypedArrayLoadHelper<double>("Float64"); | 68 TypedArrayLoadHelper<double>("Float64"); |
68 // TODO(mstarzinger): Add tests for Float32. | 69 // TODO(mstarzinger): Add tests for Float32. |
69 // TODO(mstarzinger): Add tests for ClampedUint8. | 70 // TODO(mstarzinger): Add tests for ClampedUint8. |
70 } | 71 } |
OLD | NEW |