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

Side by Side Diff: test/mjsunit/asm/asm-validation.js

Issue 2549463002: [wasm] Cleanup %IsAsmWasmCode testing predicate. (Closed)
Patch Set: Rebased. Created 4 years 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/runtime/runtime-test.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 // Flags: --validate-asm --allow-natives-syntax 5 // Flags: --validate-asm --allow-natives-syntax
6 6
7 // Note that this test file contains tests that explicitly check modules are
8 // valid asm.js and then break them with invalid instantiation arguments. If
9 // this script is run more than once (e.g. --stress-opt) then modules remain
10 // broken in the second run and assertions would fail. We prevent re-runs.
11 // Flags: --nostress-opt
12
7 function assertValidAsm(func) { 13 function assertValidAsm(func) {
8 assertTrue(%IsAsmWasmCode(func)); 14 assertTrue(%IsAsmWasmCode(func));
9 } 15 }
10 16
11 (function TestConst() { 17 (function TestConst() {
12 function Module(s) { 18 function Module(s) {
13 "use asm"; 19 "use asm";
14 var fround = s.Math.fround; 20 var fround = s.Math.fround;
15 // Global constants. These are treated just like numeric literals. 21 // Global constants. These are treated just like numeric literals.
16 const fConst = fround(-3.0); 22 const fConst = fround(-3.0);
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 return 43; 328 return 43;
323 } 329 }
324 return 0; 330 return 0;
325 } 331 }
326 return { foo: foo }; 332 return { foo: foo };
327 } 333 }
328 var m = Module(); 334 var m = Module();
329 assertTrue(%IsNotAsmWasmCode(Module)); 335 assertTrue(%IsNotAsmWasmCode(Module));
330 assertEquals(43, m.foo(3)); 336 assertEquals(43, m.foo(3));
331 })(); 337 })();
OLDNEW
« no previous file with comments | « src/runtime/runtime-test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698