diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-05-17 14:07:38 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-05-17 14:07:38 -0700 |
commit | 6a3ee4ac640e35140be836d6c7485a0d67f0ac47 (patch) | |
tree | 8fedc86ea2c4219281e360005e184eb46d80a92c /tools/test-js-optimizer-regs-output.js | |
parent | 26def19538b82b173d02907ddd5a2a7b94a5bb27 (diff) |
do not registerize with switches present
Diffstat (limited to 'tools/test-js-optimizer-regs-output.js')
-rw-r--r-- | tools/test-js-optimizer-regs-output.js | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/tools/test-js-optimizer-regs-output.js b/tools/test-js-optimizer-regs-output.js index 16d675b8..a5e97f46 100644 --- a/tools/test-js-optimizer-regs-output.js +++ b/tools/test-js-optimizer-regs-output.js @@ -197,4 +197,32 @@ function ex() { }))(); } } -// EMSCRIPTEN_GENERATED_FUNCTIONS: ["test", "primes", "atomic", "fcntl_open", "ex"] +function switchey(x) { + var r1, r2, r3, r4, r5, r6, r7, r8; + r1 = 5; + while (1) { + switch (x = f(x, r1)) { + case 1: + g(r1); + r2 = x + 1; + x--; + break; + case 2: + g(r1 * 2); + r3 = x + 22; + r4 = r3 + 5; + x -= 20; + break; + default: + r5 = x + 22; + r6 = r3 + 5; + ch(r5, r6 * r3); + throw 99; + } + } + r7 = x + 1; + p(r1, r7); + r8 = x + 2; + pp(r8); +} +// EMSCRIPTEN_GENERATED_FUNCTIONS: ["test", "primes", "atomic", "fcntl_open", "ex", "switchey"] |