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

Side by Side Diff: test/cctest/wasm/test-run-wasm-module.cc

Issue 1740373002: [wasm] Add a magic word and a version number to the binary. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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 | « src/wasm/wasm-module.h ('k') | test/mjsunit/wasm/calls.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 <stdlib.h> 5 #include <stdlib.h>
6 #include <string.h> 6 #include <string.h>
7 7
8 #include "src/wasm/encoder.h" 8 #include "src/wasm/encoder.h"
9 #include "src/wasm/wasm-js.h" 9 #include "src/wasm/wasm-js.h"
10 #include "src/wasm/wasm-macro-gen.h" 10 #include "src/wasm/wasm-macro-gen.h"
(...skipping 18 matching lines...) Expand all
29 int32_t result = 29 int32_t result =
30 CompileAndRunWasmModule(isolate, module->Begin(), module->End()); 30 CompileAndRunWasmModule(isolate, module->Begin(), module->End());
31 CHECK_EQ(expected_result, result); 31 CHECK_EQ(expected_result, result);
32 } 32 }
33 } // namespace 33 } // namespace
34 34
35 35
36 // A raw test that skips the WasmModuleBuilder. 36 // A raw test that skips the WasmModuleBuilder.
37 TEST(Run_WasmModule_CallAdd_rev) { 37 TEST(Run_WasmModule_CallAdd_rev) {
38 static const byte data[] = { 38 static const byte data[] = {
39 WASM_MODULE_HEADER,
39 // sig#0 ------------------------------------------ 40 // sig#0 ------------------------------------------
40 kDeclSignatures, 2, 0, kLocalI32, // void -> int 41 kDeclSignatures, 2, 0, kLocalI32, // void -> int
41 2, kLocalI32, kLocalI32, kLocalI32, // int,int -> int 42 2, kLocalI32, kLocalI32, kLocalI32, // int,int -> int
42 // func#0 (main) ---------------------------------- 43 // func#0 (main) ----------------------------------
43 kDeclFunctions, 2, kDeclFunctionExport, 0, 0, // sig index 44 kDeclFunctions, 2, kDeclFunctionExport, 0, 0, // sig index
44 6, 0, // body size 45 6, 0, // body size
45 kExprCallFunction, 1, // -- 46 kExprCallFunction, 1, // --
46 kExprI8Const, 77, // -- 47 kExprI8Const, 77, // --
47 kExprI8Const, 22, // -- 48 kExprI8Const, 22, // --
48 // func#1 ----------------------------------------- 49 // func#1 -----------------------------------------
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 byte code2[] = {WASM_STORE_GLOBAL(global1, WASM_I32(56)), 200 byte code2[] = {WASM_STORE_GLOBAL(global1, WASM_I32(56)),
200 WASM_STORE_GLOBAL(global2, WASM_I32(41)), 201 WASM_STORE_GLOBAL(global2, WASM_I32(41)),
201 WASM_RETURN(WASM_CALL_FUNCTION0(f1_index))}; 202 WASM_RETURN(WASM_CALL_FUNCTION0(f1_index))};
202 f->EmitCode(code2, sizeof(code2)); 203 f->EmitCode(code2, sizeof(code2));
203 WasmModuleWriter* writer = builder->Build(&zone); 204 WasmModuleWriter* writer = builder->Build(&zone);
204 TestModule(writer->WriteTo(&zone), 97); 205 TestModule(writer->WriteTo(&zone), 97);
205 } 206 }
206 #endif 207 #endif
207 208
208 #endif // !V8_TARGET_ARCH_ARM64 209 #endif // !V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/wasm/wasm-module.h ('k') | test/mjsunit/wasm/calls.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698