OLD | NEW |
1 // Copyright 2017 the V8 project authors. All rights reserved. | 1 // Copyright 2017 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 // Flags: --allow-natives-syntax --validate-asm | 5 // Flags: --allow-natives-syntax --validate-asm --fast-validate-asm |
6 | 6 |
7 load("test/mjsunit/wasm/wasm-constants.js"); | 7 load("test/mjsunit/wasm/wasm-constants.js"); |
8 load("test/mjsunit/wasm/wasm-module-builder.js"); | 8 load("test/mjsunit/wasm/wasm-module-builder.js"); |
9 | 9 |
10 let buffer = (() => { | 10 let buffer = (() => { |
11 var builder = new WasmModuleBuilder(); | 11 var builder = new WasmModuleBuilder(); |
12 builder.addFunction("f", kSig_i_v) | 12 builder.addFunction("f", kSig_i_v) |
13 .addBody([kExprI32Const, 42]) | 13 .addBody([kExprI32Const, 42]) |
14 .exportAs("f"); | 14 .exportAs("f"); |
15 return builder.toBuffer(); | 15 return builder.toBuffer(); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 function TestAsmWasmIsUnaffected() { | 109 function TestAsmWasmIsUnaffected() { |
110 "use asm"; | 110 "use asm"; |
111 function caller() { | 111 function caller() { |
112 return 43; | 112 return 43; |
113 } | 113 } |
114 | 114 |
115 return {caller: caller}; | 115 return {caller: caller}; |
116 } | 116 } |
117 | 117 |
118 assertWasm(43, TestAsmWasmIsUnaffected); | 118 assertWasm(43, TestAsmWasmIsUnaffected); |
OLD | NEW |