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

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

Issue 1830663002: [wasm] Binary 11: AST changes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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/cctest/wasm/test-run-wasm-module.cc ('k') | test/mjsunit/wasm/asm-wasm-switch.js » ('j') | 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 6a03ce5d6a09923b13413a369fa804ba42f881bd..54d7d7af31b47dd7c9a59adc363a19412c9246eb 100644
--- a/test/mjsunit/wasm/asm-wasm.js
+++ b/test/mjsunit/wasm/asm-wasm.js
@@ -23,6 +23,20 @@ function EmptyTest() {
assertWasm(11, EmptyTest);
+function VoidReturnTest() {
+ "use asm";
+ function caller() {
+ empty();
+ return 19;
+ }
+ function empty() {
+ var x = 0;
+ if (x) return;
+ }
+ return {caller: caller};
+}
+
+assertWasm(19, VoidReturnTest);
function IntTest() {
"use asm";
@@ -193,6 +207,55 @@ function TestReturnInWhileWithoutBraces() {
assertWasm(7, TestReturnInWhileWithoutBraces);
+function TestBreakInIf() {
+ "use asm";
+
+ function caller() {
+ label: {
+ if(1) break label;
+ return 11;
+ }
+ return 12;
+ }
+
+ return {caller: caller};
+}
+
+assertWasm(12, TestBreakInIf);
+
+function TestBreakInIfInDoWhileFalse() {
+ "use asm";
+
+ function caller() {
+ do {
+ if(1) break;
+ return 11;
+ } while(0);
+ return 12;
+ }
+
+ return {caller: caller};
+}
+
+assertWasm(12, TestBreakInIfInDoWhileFalse);
+
+function TestBreakInElse() {
+ "use asm";
+
+ function caller() {
+ do {
+ if(0) ;
+ else break;
+ return 14;
+ } while(0);
+ return 15;
+ }
+
+ return {caller: caller};
+}
+
+assertWasm(15, TestBreakInElse);
+
function TestBreakInWhile() {
"use asm";
@@ -209,6 +272,22 @@ function TestBreakInWhile() {
assertWasm(8, TestBreakInWhile);
+function TestBreakInIfInWhile() {
+ "use asm";
+
+ function caller() {
+ while(1) {
+ if (1) break;
+ else break;
+ }
+ return 8;
+ }
+
+ return {caller: caller};
+}
+
+assertWasm(8, TestBreakInIfInWhile);
+
function TestBreakInNestedWhile() {
"use asm";
« no previous file with comments | « test/cctest/wasm/test-run-wasm-module.cc ('k') | test/mjsunit/wasm/asm-wasm-switch.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698