| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef WASM_RUN_UTILS_H | 5 #ifndef WASM_RUN_UTILS_H |
| 6 #define WASM_RUN_UTILS_H | 6 #define WASM_RUN_UTILS_H |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 #include <string.h> | 10 #include <string.h> |
| (...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 784 MachineType p2, MachineType p3) { | 784 MachineType p2, MachineType p3) { |
| 785 if (p0 == MachineType::None()) return 0; | 785 if (p0 == MachineType::None()) return 0; |
| 786 if (p1 == MachineType::None()) return 1; | 786 if (p1 == MachineType::None()) return 1; |
| 787 if (p2 == MachineType::None()) return 2; | 787 if (p2 == MachineType::None()) return 2; |
| 788 if (p3 == MachineType::None()) return 3; | 788 if (p3 == MachineType::None()) return 3; |
| 789 return 4; | 789 return 4; |
| 790 } | 790 } |
| 791 }; | 791 }; |
| 792 | 792 |
| 793 // A macro to define tests that run in different engine configurations. | 793 // A macro to define tests that run in different engine configurations. |
| 794 // Currently only supports compiled tests, but a future | |
| 795 // RunWasmInterpreted_##name version will allow each test to also run in the | |
| 796 // interpreter. | |
| 797 #define WASM_EXEC_TEST(name) \ | 794 #define WASM_EXEC_TEST(name) \ |
| 798 void RunWasm_##name(WasmExecutionMode execution_mode); \ | 795 void RunWasm_##name(WasmExecutionMode execution_mode); \ |
| 799 TEST(RunWasmCompiled_##name) { RunWasm_##name(kExecuteCompiled); } \ | 796 TEST(RunWasmCompiled_##name) { RunWasm_##name(kExecuteCompiled); } \ |
| 800 TEST(RunWasmInterpreted_##name) { RunWasm_##name(kExecuteInterpreted); } \ | 797 TEST(RunWasmInterpreted_##name) { RunWasm_##name(kExecuteInterpreted); } \ |
| 801 void RunWasm_##name(WasmExecutionMode execution_mode) | 798 void RunWasm_##name(WasmExecutionMode execution_mode) |
| 802 | 799 |
| 800 #define WASM_EXEC_COMPILED_TEST(name) \ |
| 801 void RunWasm_##name(WasmExecutionMode execution_mode); \ |
| 802 TEST(RunWasmCompiled_##name) { RunWasm_##name(kExecuteCompiled); } \ |
| 803 void RunWasm_##name(WasmExecutionMode execution_mode) |
| 804 |
| 803 } // namespace | 805 } // namespace |
| 804 | 806 |
| 805 #endif | 807 #endif |
| OLD | NEW |