Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: test/cctest/wasm/wasm-run-utils.h

Issue 2042773002: [wasm] Move 64-bit call tests into test-run-wasm-64.cc so they also run on 32-bit platforms. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/cctest/wasm/test-run-wasm-64.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 15 matching lines...) Expand all
26 #include "src/wasm/wasm-macro-gen.h" 26 #include "src/wasm/wasm-macro-gen.h"
27 #include "src/wasm/wasm-module.h" 27 #include "src/wasm/wasm-module.h"
28 #include "src/wasm/wasm-opcodes.h" 28 #include "src/wasm/wasm-opcodes.h"
29 29
30 #include "src/zone.h" 30 #include "src/zone.h"
31 31
32 #include "test/cctest/cctest.h" 32 #include "test/cctest/cctest.h"
33 #include "test/cctest/compiler/call-tester.h" 33 #include "test/cctest/compiler/call-tester.h"
34 #include "test/cctest/compiler/graph-builder-tester.h" 34 #include "test/cctest/compiler/graph-builder-tester.h"
35 35
36 // TODO(titzer): pull WASM_64 up to a common header.
37 #if !V8_TARGET_ARCH_32_BIT || V8_TARGET_ARCH_X64
38 #define WASM_64 1
39 #else
40 #define WASM_64 0
41 #endif
42
43 static const uint32_t kMaxFunctions = 10; 36 static const uint32_t kMaxFunctions = 10;
44 37
45 enum WasmExecutionMode { kExecuteInterpreted, kExecuteCompiled }; 38 enum WasmExecutionMode { kExecuteInterpreted, kExecuteCompiled };
46 39
47 // TODO(titzer): check traps more robustly in tests. 40 // TODO(titzer): check traps more robustly in tests.
48 // Currently, in tests, we just return 0xdeadbeef from the function in which 41 // Currently, in tests, we just return 0xdeadbeef from the function in which
49 // the trap occurs if the runtime context is not available to throw a JavaScript 42 // the trap occurs if the runtime context is not available to throw a JavaScript
50 // exception. 43 // exception.
51 #define CHECK_TRAP32(x) \ 44 #define CHECK_TRAP32(x) \
52 CHECK_EQ(0xdeadbeef, (bit_cast<uint32_t>(x)) & 0xFFFFFFFF) 45 CHECK_EQ(0xdeadbeef, (bit_cast<uint32_t>(x)) & 0xFFFFFFFF)
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 // interpreter. 755 // interpreter.
763 #define WASM_EXEC_TEST(name) \ 756 #define WASM_EXEC_TEST(name) \
764 void RunWasm_##name(WasmExecutionMode execution_mode); \ 757 void RunWasm_##name(WasmExecutionMode execution_mode); \
765 TEST(RunWasmCompiled_##name) { RunWasm_##name(kExecuteCompiled); } \ 758 TEST(RunWasmCompiled_##name) { RunWasm_##name(kExecuteCompiled); } \
766 TEST(RunWasmInterpreted_##name) { RunWasm_##name(kExecuteInterpreted); } \ 759 TEST(RunWasmInterpreted_##name) { RunWasm_##name(kExecuteInterpreted); } \
767 void RunWasm_##name(WasmExecutionMode execution_mode) 760 void RunWasm_##name(WasmExecutionMode execution_mode)
768 761
769 } // namespace 762 } // namespace
770 763
771 #endif 764 #endif
OLDNEW
« no previous file with comments | « test/cctest/wasm/test-run-wasm-64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698