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

Side by Side Diff: test/mjsunit/asm/b5528-comma.js

Issue 2426473007: [V8][asm.js] Fixes a bug in comma-expression validation. (Closed)
Patch Set: expands the tests. Created 4 years, 2 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/asmjs/asm-typer.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
(Empty)
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
3 // found in the LICENSE file.
4
5 function Module(stdlib, env, heap) {
6 "use asm";
7
8 var a = new stdlib.Int32Array(heap);
9 var b = new stdlib.Float32Array(heap);
10 var fround = stdlib.Math.fround;
11 var value = env.value|0;
12
13 function foo() {
14 var x = fround(0.0);
15 x = (a[0]=value|0,fround(b[0]));
16 return fround(x);
17 }
18
19 return { foo: foo };
20 }
21
22 var buffer = new ArrayBuffer(32);
23 assertEquals(0.0, Module(this, {value: 0x00000000}, buffer).foo());
24 assertEquals(-0.0, Module(this, {value: 0x80000000}, buffer).foo());
25 assertEquals(5.0, Module(this, {value: 0x40a00000}, buffer).foo());
26 assertEquals(-5.0, Module(this, {value: 0xc0a00000}, buffer).foo());
27 assertEquals(129.375, Module(this, {value: 0x43016000}, buffer).foo());
28 assertEquals(-129.375, Module(this, {value: 0xc3016000}, buffer).foo());
29 assertEquals(Infinity, Module(this, {value: 0x7f800000}, buffer).foo());
30 assertEquals(-Infinity, Module(this, {value: 0xff800000}, buffer).foo());
31 assertEquals(NaN, Module(this, {value: 0x7fffffff}, buffer).foo());
OLDNEW
« no previous file with comments | « src/asmjs/asm-typer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698