diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-11-15 21:36:33 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-12-07 16:50:04 -1000 |
commit | 98e9e604c7e2e4f928abe8f05691df90cddf09e4 (patch) | |
tree | 9497de28012c109ae0e6e958aca8968e8a3d97cf /test/wasm-only.fromasm | |
parent | 49bdfd20094e909fb6f4ea989e2a2cbfe01e8741 (diff) | |
download | binaryen-98e9e604c7e2e4f928abe8f05691df90cddf09e4.tar.gz binaryen-98e9e604c7e2e4f928abe8f05691df90cddf09e4.tar.bz2 binaryen-98e9e604c7e2e4f928abe8f05691df90cddf09e4.zip |
add a RemoveUnusedModuleElements pass, and make LegalizeJSInterface create TempRet0 if needed (otherwise we might remove it before we use it)
Diffstat (limited to 'test/wasm-only.fromasm')
-rw-r--r-- | test/wasm-only.fromasm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/test/wasm-only.fromasm b/test/wasm-only.fromasm index adcc66137..1c5030527 100644 --- a/test/wasm-only.fromasm +++ b/test/wasm-only.fromasm @@ -12,6 +12,7 @@ (import "env" "memoryBase" (global $memoryBase i32)) (import "env" "tableBase" (global $tableBase i32)) (data (get_global $memoryBase) "wasm-only.asm.js") + (global $tempRet0 (mut i32) (i32.const 0)) (export "test64" (func $test64)) (export "illegalParam" (func $legalstub$illegalParam)) (export "illegalResult" (func $legalstub$result)) @@ -397,7 +398,14 @@ (set_local $0 (call $result) ) - (unreachable) + (set_global $tempRet0 + (i32.wrap/i64 + (i64.shr_u + (get_local $0) + (i64.const 32) + ) + ) + ) (i32.wrap/i64 (get_local $0) ) @@ -424,7 +432,7 @@ ) (i64.shl (i64.extend_u/i32 - (unreachable) + (get_global $tempRet0) ) (i64.const 32) ) |