diff options
author | Alon Zakai <alonzakai@gmail.com> | 2017-10-04 16:45:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-04 16:45:40 -0700 |
commit | fcbe7bff9e21e63f8c74a71f167aaf225cca0b79 (patch) | |
tree | 8fed59f427c93d4a57c54661f2e492e6b074d342 /test/unit.fromasm.clamp.no-opts | |
parent | 9f9e9ae0fc94825c7db4edc8a2e6aa1190f39fc7 (diff) | |
download | binaryen-fcbe7bff9e21e63f8c74a71f167aaf225cca0b79.tar.gz binaryen-fcbe7bff9e21e63f8c74a71f167aaf225cca0b79.tar.bz2 binaryen-fcbe7bff9e21e63f8c74a71f167aaf225cca0b79.zip |
optimize helper funcs (like i32-div) if created in asm2wasm, so they are consistently handled regardless of whether we optimize in parallel or not (#1208)
Diffstat (limited to 'test/unit.fromasm.clamp.no-opts')
-rw-r--r-- | test/unit.fromasm.clamp.no-opts | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/unit.fromasm.clamp.no-opts b/test/unit.fromasm.clamp.no-opts index b1b22cf66..6342644e8 100644 --- a/test/unit.fromasm.clamp.no-opts +++ b/test/unit.fromasm.clamp.no-opts @@ -41,6 +41,7 @@ (export "frem" (func $frem)) (export "frem_float" (func $legalstub$frem_float)) (export "big_uint_div_u" (func $big_uint_div_u)) + (export "trapping_sint_div_s" (func $trapping_sint_div_s)) (export "fr" (func $legalstub$fr)) (export "negZero" (func $negZero)) (export "neg" (func $neg)) @@ -477,6 +478,43 @@ (get_local $x) ) ) + (func $i32s-div (param $0 i32) (param $1 i32) (result i32) + (if (result i32) + (i32.eqz + (get_local $1) + ) + (i32.const 0) + (if (result i32) + (i32.and + (i32.eq + (get_local $0) + (i32.const -2147483648) + ) + (i32.eq + (get_local $1) + (i32.const -1) + ) + ) + (i32.const 0) + (i32.div_s + (get_local $0) + (get_local $1) + ) + ) + ) + ) + (func $trapping_sint_div_s (result i32) + (local $x i32) + (set_local $x + (call $i32s-div + (i32.const -2147483648) + (i32.const -1) + ) + ) + (return + (get_local $x) + ) + ) (func $fr (param $x f32) (local $y f32) (local $z f64) |