diff options
author | Alon Zakai (kripken) <alonzakai@gmail.com> | 2017-07-10 18:48:02 -0700 |
---|---|---|
committer | Alon Zakai (kripken) <alonzakai@gmail.com> | 2017-07-11 11:07:45 -0700 |
commit | 4be7ec00157250ca83b61a2e1885645c67c6369c (patch) | |
tree | c0e6b98b252aad7307e1a915cbad7c5641625cab /test | |
parent | 45f8fedce6d432bfe24573ae4edb092202ef7bb9 (diff) | |
download | binaryen-4be7ec00157250ca83b61a2e1885645c67c6369c.tar.gz binaryen-4be7ec00157250ca83b61a2e1885645c67c6369c.tar.bz2 binaryen-4be7ec00157250ca83b61a2e1885645c67c6369c.zip |
handle unary and binary nodes that have implicit traps in vacuum
Diffstat (limited to 'test')
-rw-r--r-- | test/passes/vacuum.txt | 13 | ||||
-rw-r--r-- | test/passes/vacuum.wast | 13 | ||||
-rw-r--r-- | test/passes/vacuum_ignore-implicit-traps.txt | 4 | ||||
-rw-r--r-- | test/passes/vacuum_ignore-implicit-traps.wast | 13 |
4 files changed, 43 insertions, 0 deletions
diff --git a/test/passes/vacuum.txt b/test/passes/vacuum.txt index f17607734..e07357296 100644 --- a/test/passes/vacuum.txt +++ b/test/passes/vacuum.txt @@ -260,4 +260,17 @@ (i64.const 0) ) ) + (func $unary-binary-may-trap (type $0) + (drop + (i64.div_s + (i64.const -1) + (i64.const 729618461987467893) + ) + ) + (drop + (i64.trunc_u/f32 + (f32.const 70847791997969805621592064) + ) + ) + ) ) diff --git a/test/passes/vacuum.wast b/test/passes/vacuum.wast index 65e528621..77ffabd60 100644 --- a/test/passes/vacuum.wast +++ b/test/passes/vacuum.wast @@ -580,4 +580,17 @@ (i64.const 0) ) ) + (func $unary-binary-may-trap + (drop + (i64.div_s + (i64.const 70847791997969805621592064) + (i64.const 729618461987467893) + ) + ) + (drop + (i64.trunc_u/f32 + (f32.const 70847791997969805621592064) + ) + ) + ) ) diff --git a/test/passes/vacuum_ignore-implicit-traps.txt b/test/passes/vacuum_ignore-implicit-traps.txt index 040a3dc1a..e5ff28583 100644 --- a/test/passes/vacuum_ignore-implicit-traps.txt +++ b/test/passes/vacuum_ignore-implicit-traps.txt @@ -1,5 +1,6 @@ (module (type $0 (func (result i32))) + (type $1 (func)) (memory $0 0) (func $load-would-normally-have-side-effects (type $0) (result i32) (i64.ge_s @@ -7,4 +8,7 @@ (i64.const 0) ) ) + (func $unary-binary-may-trap (type $1) + (nop) + ) ) diff --git a/test/passes/vacuum_ignore-implicit-traps.wast b/test/passes/vacuum_ignore-implicit-traps.wast index 08b41a141..21e87e10c 100644 --- a/test/passes/vacuum_ignore-implicit-traps.wast +++ b/test/passes/vacuum_ignore-implicit-traps.wast @@ -15,5 +15,18 @@ (i64.const 0) ) ) + (func $unary-binary-may-trap + (drop + (i64.div_s + (i64.const 70847791997969805621592064) + (i64.const 729618461987467893) + ) + ) + (drop + (i64.trunc_u/f32 + (f32.const 70847791997969805621592064) + ) + ) + ) ) |