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

Unified Diff: test/mjsunit/asm/asm-validation.js

Issue 2561193003: [wasm][asm.js] Allow true/false in int binary ops. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/asmjs/asm-wasm-builder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/asm/asm-validation.js
diff --git a/test/mjsunit/asm/asm-validation.js b/test/mjsunit/asm/asm-validation.js
index bf1e1ba80c41d6c471fc62d746d05d3b9c75a9e1..cc0bd8244af96439016a0df34dbd1cb44346cd03 100644
--- a/test/mjsunit/asm/asm-validation.js
+++ b/test/mjsunit/asm/asm-validation.js
@@ -302,7 +302,7 @@ function assertValidAsm(func) {
assertEquals(0xffffffff, m.foo());
})();
-(function TestBadBooleanAnnotation() {
+(function TestBadBooleanParamAnnotation() {
function Module() {
"use asm";
function foo(x) {
@@ -316,6 +316,23 @@ function assertValidAsm(func) {
assertEquals(3, m.foo(3));
})();
+(function TestBadishBooleanExprAnnotation() {
+ function Module() {
+ "use asm";
+ function foo(x) {
+ x = x | 0;
+ x = (x + 1) | false;
+ return x | 0;
+ }
+ return { foo: foo };
+ }
+ var m = Module();
+ // We all false here because the parser optimizes expressons like:
+ // !123 to false.
+ assertTrue(%IsAsmWasmCode(Module));
+ assertEquals(4, m.foo(3));
+})();
+
(function TestBadCase() {
function Module() {
"use asm";
« no previous file with comments | « src/asmjs/asm-wasm-builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698