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

Unified Diff: test/mjsunit/asm/if-reduction.js

Issue 2663243002: [asm] Fix lots of invalid asm.js tests (Closed)
Patch Set: Rebase Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/asm/if-folding.js ('k') | test/mjsunit/asm/if-tonumber.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/asm/if-reduction.js
diff --git a/test/mjsunit/asm/if-reduction.js b/test/mjsunit/asm/if-reduction.js
index b0dcc13842de4708b07e4194e8bce30c1a1b66f2..420d9d38ec11f803818784aef78bc0da78aa9174 100644
--- a/test/mjsunit/asm/if-reduction.js
+++ b/test/mjsunit/asm/if-reduction.js
@@ -6,65 +6,84 @@ function Module() {
"use asm";
function if0() {
- var x = 0 ? 11 : 12;
- return (x == 11) | 0;
+ var x = 0;
+ x = 0 ? 11 : 12;
+ return ((x | 0) == 11) | 0;
}
function if1() {
- var x = 1 ? 13 : 14;
- return (x == 13) | 0;
+ var x = 0;
+ x = 1 ? 13 : 14;
+ return ((x | 0) == 13) | 0;
}
function if2() {
- var x = 0 ? 15 : 16;
- return (x != 15) | 0;
+ var x = 0;
+ x = 0 ? 15 : 16;
+ return ((x | 0) != 15) | 0;
}
function if3() {
- var x = 1 ? 17 : 18;
- return (x != 17) | 0;
+ var x = 0;
+ x = 1 ? 17 : 18;
+ return ((x | 0) != 17) | 0;
}
function if4() {
- var x = 0 ? 19 : 20;
- var y = (x == 19) ? 21 : 22;
- return y;
+ var x = 0;
+ var y = 0;
+ x = 0 ? 19 : 20;
+ y = ((x | 0) == 19) ? 21 : 22;
+ return y | 0;
}
function if5() {
- var x = 1 ? 23 : 24;
- var y = (x == 23) ? 25 : 26;
- return y;
+ var x = 0;
+ var y = 0;
+ x = 1 ? 23 : 24;
+ y = ((x | 0) == 23) ? 25 : 26;
+ return y | 0;
}
function if6() {
- var x = 0 ? 27 : 28;
- var y = (x == 27) ? 29 : 30;
- var z = (y == 29) ? 31 : 32;
- return z;
+ var x = 0;
+ var y = 0;
+ var z = 0;
+ x = 0 ? 27 : 28;
+ y = ((x | 0) == 27) ? 29 : 30;
+ z = ((y | 0) == 29) ? 31 : 32;
+ return z | 0;
}
function if7() {
- var x = 1 ? 33 : 34;
- var y = (x == 33) ? 35 : 36;
- var z = (y == 35) ? 37 : 38;
- var w = (z == 37) ? 39 : 40;
- return w;
+ var x = 0;
+ var y = 0;
+ var z = 0;
+ var w = 0;
+ x = 1 ? 33 : 34;
+ y = ((x | 0) == 33) ? 35 : 36;
+ z = ((y | 0) == 35) ? 37 : 38;
+ w = ((z | 0) == 37) ? 39 : 40;
+ return w | 0;
}
function if8() {
+ var w = 0;
+ var x = 0;
+ var y = 0;
+ var z = 0;
if (0) {
- var x = 0 ? 43 : 44;
- var y = (x == 43) ? 45 : 46;
- var z = (y == 45) ? 47 : 48;
- var w = (z == 47) ? 49 : 50;
+ x = 0 ? 43 : 44;
+ y = ((x | 0) == 43) ? 45 : 46;
+ z = ((y | 0) == 45) ? 47 : 48;
+ w = ((z | 0) == 47) ? 49 : 50;
} else {
- var x = 1 ? 53 : 54;
- var y = (x == 53) ? 55 : 56;
- var z = (y == 55) ? 57 : 58;
- var w = (z == 57) ? 59 : 60;
+ x = 1 ? 53 : 54;
+ y = ((x | 0) == 53) ? 55 : 56;
+ z = ((y | 0) == 55) ? 57 : 58;
+ w = ((z | 0) == 57) ? 59 : 60;
}
- return w;
+ return w | 0;
}
return {if0: if0, if1: if1, if2: if2, if3: if3, if4: if4, if5: if5, if6: if6, if7: if7, if8: if8 };
@@ -82,28 +101,33 @@ assertEquals(39, m.if7());
assertEquals(59, m.if8());
-function Spec(a,b) {
+function Spec0(stdlib, foreign, heap) {
"use asm";
- var xx = a | 0;
- var yy = b | 0;
+ var xx = foreign.a | 0;
+ var yy = foreign.b | 0;
function f() {
+ var x = 0;
+ var y = 0;
+ var z = 0;
+ var w = 0;
if (xx) {
- var x = yy ? 43 : 44;
- var y = (x == 43) ? 45 : 46;
- var z = (y == 45) ? 47 : 48;
- var w = (z == 47) ? 49 : 50;
+ x = yy ? 43 : 44;
+ y = ((x | 0) == 43) ? 45 : 46;
+ z = ((y | 0) == 45) ? 47 : 48;
+ w = ((z | 0) == 47) ? 49 : 50;
} else {
- var x = yy ? 53 : 54;
- var y = (x == 53) ? 55 : 56;
- var z = (y == 55) ? 57 : 58;
- var w = (z == 57) ? 59 : 60;
+ x = yy ? 53 : 54;
+ y = ((x | 0) == 53) ? 55 : 56;
+ z = ((y | 0) == 55) ? 57 : 58;
+ w = ((z | 0) == 57) ? 59 : 60;
}
- return w;
+ return w | 0;
}
return {f: f};
}
+var Spec = (a, b, c) => Spec0(this, {a: a, b: b, c: c});
assertEquals(60, Spec(0,0).f());
assertEquals(59, Spec(0,1).f());
« no previous file with comments | « test/mjsunit/asm/if-folding.js ('k') | test/mjsunit/asm/if-tonumber.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698