From 996416ccefc4f079b14495bcb4ac66e7aa705f4f Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 22 Mar 2016 10:13:08 -0700 Subject: only reuse nameless blocks in blockify in asm2wasm - if they are named, they can be broken out of, which is bad for our loop constructs --- test/unit.asm.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'test/unit.asm.js') diff --git a/test/unit.asm.js b/test/unit.asm.js index c600f714d..5bb84bdcd 100644 --- a/test/unit.asm.js +++ b/test/unit.asm.js @@ -55,6 +55,7 @@ function asm() { } function switcher(x) { x = x | 0; + var waka = 0; switch (x | 0) { case 1: return 1; case 2: return 2; @@ -79,6 +80,32 @@ function asm() { break; } } + + L1 : while (1) { + L3 : while (1) switch (x) { + case -1: + { + break L1; + break; + } + case 116: + { + waka = 1; + break; + } + case 110: + { + break L3; + break; + } + default: + { + break L1; + } + } + h(120); + } + return 0; } function blocker() { -- cgit v1.2.3