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

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

Issue 1530093002: Add do-while and conditional and mark non asm nodes as unreachable (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@mywork
Patch Set: Created 4 years, 12 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/wasm/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 f6cfd4edd21a0ff1e2a19140674af9b3d2068b39..960977eab5399d02ff1d2c449ebc915147ea4dce 100644
--- a/test/mjsunit/wasm/asm-wasm.js
+++ b/test/mjsunit/wasm/asm-wasm.js
@@ -638,3 +638,34 @@ function TestForLoopWithoutBody() {
}
assertEquals(45, WASM.asmCompileRun(TestForLoopWithoutBody.toString()));
+
+function TestDoWhile() {
+ "use asm"
+
+ function caller() {
+ var i = 0;
+ var ret = 21;
+ do {
+ ret = (ret + ret)|0;
+ i = (i + 1)|0;
+ } while (i < 2);
+ return ret|0;
+ }
+
+ return {caller:caller};
+}
+
+assertEquals(84, WASM.asmCompileRun(TestDoWhile.toString()));
+
+function TestConditional() {
+ "use asm"
+
+ function caller() {
+ var x = 1;
+ return ((x > 0) ? 41 : 71)|0;
+ }
+
+ return {caller:caller};
+}
+
+assertEquals(41, WASM.asmCompileRun(TestConditional.toString()));
« no previous file with comments | « src/wasm/asm-wasm-builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698