OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_UNIT_TEST_H_ | 5 #ifndef VM_UNIT_TEST_H_ |
6 #define VM_UNIT_TEST_H_ | 6 #define VM_UNIT_TEST_H_ |
7 | 7 |
8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
9 | 9 |
10 #include "platform/globals.h" | 10 #include "platform/globals.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 #define EXECUTE_TEST_CODE_FLOAT(name, entry) reinterpret_cast<name>(entry)() | 145 #define EXECUTE_TEST_CODE_FLOAT(name, entry) reinterpret_cast<name>(entry)() |
146 #define EXECUTE_TEST_CODE_DOUBLE(name, entry) reinterpret_cast<name>(entry)() | 146 #define EXECUTE_TEST_CODE_DOUBLE(name, entry) reinterpret_cast<name>(entry)() |
147 #define EXECUTE_TEST_CODE_INT32_F(name, entry, float_arg) \ | 147 #define EXECUTE_TEST_CODE_INT32_F(name, entry, float_arg) \ |
148 reinterpret_cast<name>(entry)(float_arg) | 148 reinterpret_cast<name>(entry)(float_arg) |
149 #define EXECUTE_TEST_CODE_INT32_D(name, entry, double_arg) \ | 149 #define EXECUTE_TEST_CODE_INT32_D(name, entry, double_arg) \ |
150 reinterpret_cast<name>(entry)(double_arg) | 150 reinterpret_cast<name>(entry)(double_arg) |
151 #else | 151 #else |
152 // Not running on ARM or MIPS hardware, call simulator to execute code. | 152 // Not running on ARM or MIPS hardware, call simulator to execute code. |
153 #if defined(ARCH_IS_64_BIT) | 153 #if defined(ARCH_IS_64_BIT) |
154 // TODO(zra): Supply more macros for 64-bit as tests are added for ARM64. | 154 // TODO(zra): Supply more macros for 64-bit as tests are added for ARM64. |
155 #define EXECUTE_TEST_CODE_INT32(name, entry) \ | 155 #define EXECUTE_TEST_CODE_INT64(name, entry) \ |
156 static_cast<int32_t>(Simulator::Current()->Call( \ | 156 static_cast<int64_t>(Simulator::Current()->Call( \ |
157 bit_cast<int64_t, uword>(entry), 0, 0, 0, 0)) | 157 bit_cast<int64_t, uword>(entry), 0, 0, 0, 0)) |
158 #else | 158 #else |
159 #define EXECUTE_TEST_CODE_INT32(name, entry) \ | 159 #define EXECUTE_TEST_CODE_INT32(name, entry) \ |
160 static_cast<int32_t>(Simulator::Current()->Call( \ | 160 static_cast<int32_t>(Simulator::Current()->Call( \ |
161 bit_cast<int32_t, uword>(entry), 0, 0, 0, 0)) | 161 bit_cast<int32_t, uword>(entry), 0, 0, 0, 0)) |
162 #endif | 162 #endif |
163 #define EXECUTE_TEST_CODE_INT64_LL(name, entry, long_arg0, long_arg1) \ | 163 #define EXECUTE_TEST_CODE_INT64_LL(name, entry, long_arg0, long_arg1) \ |
164 static_cast<int64_t>(Simulator::Current()->Call( \ | 164 static_cast<int64_t>(Simulator::Current()->Call( \ |
165 bit_cast<int32_t, uword>(entry), \ | 165 bit_cast<int32_t, uword>(entry), \ |
166 Utils::Low32Bits(long_arg0), \ | 166 Utils::Low32Bits(long_arg0), \ |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 } \ | 395 } \ |
396 } else { \ | 396 } else { \ |
397 dart::Expect(__FILE__, __LINE__).Fail("expected True, but was '%s'\n", \ | 397 dart::Expect(__FILE__, __LINE__).Fail("expected True, but was '%s'\n", \ |
398 #handle); \ | 398 #handle); \ |
399 } \ | 399 } \ |
400 } while (0) | 400 } while (0) |
401 | 401 |
402 } // namespace dart | 402 } // namespace dart |
403 | 403 |
404 #endif // VM_UNIT_TEST_H_ | 404 #endif // VM_UNIT_TEST_H_ |
OLD | NEW |