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

Unified Diff: test/mjsunit/wasm/asm-wasm-switch.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/mjsunit/wasm/asm-wasm.js ('k') | test/mjsunit/wasm/calls.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/wasm/asm-wasm-switch.js
diff --git a/test/mjsunit/wasm/asm-wasm-switch.js b/test/mjsunit/wasm/asm-wasm-switch.js
index b0c01b7d884aaa2d84e57539ff123cca1836be1b..bbdb1a20f37fe1eb684dce88dc98e526577f82c4 100644
--- a/test/mjsunit/wasm/asm-wasm-switch.js
+++ b/test/mjsunit/wasm/asm-wasm-switch.js
@@ -4,6 +4,32 @@
// Flags: --expose-wasm
+(function TestSwitch0() {
+ function asmModule() {
+ "use asm"
+
+ function caller() {
+ var ret = 0;
+ var x = 7;
+ switch (x) {
+ case 1: {
+ return 0;
+ }
+ case 7: {
+ ret = 5;
+ break;
+ }
+ default: return 0;
+ }
+ return ret|0;
+ }
+
+ return {caller:caller};
+ }
+ var wasm = Wasm.instantiateModuleFromAsm(asmModule.toString());
+ assertEquals(5, wasm.caller());
+})();
+
(function TestSwitch() {
function asmModule() {
"use asm"
« no previous file with comments | « test/mjsunit/wasm/asm-wasm.js ('k') | test/mjsunit/wasm/calls.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698