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; |