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

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

Issue 2372823004: [wasm] asm.js: Work around parser converting !0 and !1 to boolean. (Closed)
Patch Set: Created 4 years, 3 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 | « 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/wasm/asm-wasm.js
diff --git a/test/mjsunit/wasm/asm-wasm.js b/test/mjsunit/wasm/asm-wasm.js
index 6aaea614fc07ab98dc914e037ae1f014f399314c..b1e73c1edabd1f0c38f5fffe899d1ebcdf9f9a75 100644
--- a/test/mjsunit/wasm/asm-wasm.js
+++ b/test/mjsunit/wasm/asm-wasm.js
@@ -1596,3 +1596,35 @@ function TestSingleFunctionModule() {
}
assertEquals(7, TestSingleFunctionModule()(3, 4));
+
+
+function TestNotZero() {
+ "use asm";
+ function caller() {
+ if (!0) {
+ return 44;
+ } else {
+ return 55;
+ }
+ return 0;
+ }
+ return {caller: caller};
+}
+
+assertWasm(44, TestNotZero);
+
+
+function TestNotOne() {
+ "use asm";
+ function caller() {
+ if (!1) {
+ return 44;
+ } else {
+ return 55;
+ }
+ return 0;
+ }
+ return {caller: caller};
+}
+
+assertWasm(55, TestNotOne);
« 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