diff options
author | Alon Zakai <alonzakai@gmail.com> | 2017-01-12 14:21:29 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-12 14:21:29 -0800 |
commit | d908ea7ba67c3544bcaa7906ce8e61cb5bf0846d (patch) | |
tree | 5758ffe2a373afd52324f5362b536c6944fa2345 /test/wasm-only.asm.js | |
parent | 9ccea0e0f97538c8c2349144e83c20bbc6c8c413 (diff) | |
parent | d14499fd0696e5acc5f3c06ab2fb551ff654c2be (diff) | |
download | binaryen-d908ea7ba67c3544bcaa7906ce8e61cb5bf0846d.tar.gz binaryen-d908ea7ba67c3544bcaa7906ce8e61cb5bf0846d.tar.bz2 binaryen-d908ea7ba67c3544bcaa7906ce8e61cb5bf0846d.zip |
Merge pull request #880 from WebAssembly/dce-moar
DCE at the end of asm2wasm
Diffstat (limited to 'test/wasm-only.asm.js')
-rw-r--r-- | test/wasm-only.asm.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/wasm-only.asm.js b/test/wasm-only.asm.js index cf0119cd7..3adacf5be 100644 --- a/test/wasm-only.asm.js +++ b/test/wasm-only.asm.js @@ -226,6 +226,28 @@ function asm(global, env, buffer) { } return $waka | 0; } + function unreachable_leftovers($0,$1,$2) { + $0 = $0|0; + $1 = $1|0; + $2 = $2|0; + var label = 0; + L1: do { + if ($1) { + label = 10; + } else { + if ($2) { + break L1; + return; + } + store4($0,-2); + return; + } + } while(0); + if ((label|0) == 10) { + store4($0,-1); + } + return; + } function keepAlive() { loads(); stores(); @@ -238,6 +260,7 @@ function asm(global, env, buffer) { i64(ifValue64(i64(0), i64(0))); ifValue32(0, 0) | 0; switch64(i64(0)) | 0; + unreachable_leftovers(0, 0, 0); } function __emscripten_dceable_type_decls() { // dce-able, but this defines the type of fabsf which has no other use |