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

Unified Diff: test/mjsunit/asm/switch.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/redundancy2.js ('k') | test/mjsunit/asm/uint32-less-than-shift.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/asm/switch.js
diff --git a/test/mjsunit/asm/switch.js b/test/mjsunit/asm/switch.js
index 5cb6329e4331053b7d202fa379830ff466564a72..d02e661eeb7be0a7aac6a64adea3dd827741ee0e 100644
--- a/test/mjsunit/asm/switch.js
+++ b/test/mjsunit/asm/switch.js
@@ -11,11 +11,12 @@ var switch1 = (function(stdlib, foreign, heap) {
"use asm";
function switch1(i) {
i = i|0;
- switch (i) {
+ switch (i | 0) {
case 0: return 1;
case 1: return 2;
default: return i|0;
}
+ return i | 0;
}
return { switch1: switch1 };
})(stdlib, foreign, heap).switch1;
@@ -32,7 +33,7 @@ var switch2 = (function(stdlib, foreign, heap) {
function switch2(i) {
i = i|0;
var j = 0;
- switch (i) {
+ switch (i | 0) {
case 0: j = 1; break;
case 1: j = 2; break;
case 2: j = 3; break;
@@ -56,7 +57,7 @@ var switch3 = (function(stdlib, foreign, heap) {
function switch3(i) {
i = i|0;
var j = 0;
- switch (i) {
+ switch (i | 0) {
case 0:
case 1: j = 1; break;
case 2:
@@ -85,7 +86,7 @@ var switch4 = (function(stdlib, foreign, heap) {
"use asm";
function switch4(i) {
i = i|0;
- switch (i) {
+ switch (i | 0) {
case -1:
case 1:
return 0;
@@ -105,6 +106,7 @@ var switch4 = (function(stdlib, foreign, heap) {
default:
return 4;
}
+ return 0; // needed for validation
}
return { switch4: switch4 };
})(stdlib, foreign, heap).switch4;
« no previous file with comments | « test/mjsunit/asm/redundancy2.js ('k') | test/mjsunit/asm/uint32-less-than-shift.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698