diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/example/find_div0s.cpp | 4 | ||||
-rw-r--r-- | test/passes/simplify-locals.txt | 9 | ||||
-rw-r--r-- | test/passes/simplify-locals.wast | 9 |
3 files changed, 20 insertions, 2 deletions
diff --git a/test/example/find_div0s.cpp b/test/example/find_div0s.cpp index 22707f9ca..9f1cf911f 100644 --- a/test/example/find_div0s.cpp +++ b/test/example/find_div0s.cpp @@ -2,7 +2,7 @@ // // Tiny example, using Binaryen to walk a WebAssembly module in search // for direct integer divisions by zero. To do so, we inherit from -// WasmWalker, and implement visitBinary, which is called on every +// PostWalker, and implement visitBinary, which is called on every // Binary node in the module's functions. // @@ -39,7 +39,7 @@ int main() { // Search it for divisions by zero: Walk the module, looking for // that operation. - struct DivZeroSeeker : public WasmWalker<DivZeroSeeker> { + struct DivZeroSeeker : public PostWalker<DivZeroSeeker> { void visitBinary(Binary* curr) { // In every Binary, look for integer divisions if (curr->op == BinaryOp::DivS || curr->op == BinaryOp::DivU) { diff --git a/test/passes/simplify-locals.txt b/test/passes/simplify-locals.txt index 95b714eb9..6a3ce721f 100644 --- a/test/passes/simplify-locals.txt +++ b/test/passes/simplify-locals.txt @@ -266,4 +266,13 @@ (get_local $b) ) ) + (func $memories (param $i2 i32) (param $i3 i32) + (set_local $i3 + (i32.const 1) + ) + (i32.store8 + (get_local $i2) + (get_local $i3) + ) + ) ) diff --git a/test/passes/simplify-locals.wast b/test/passes/simplify-locals.wast index 24f8476d2..70d798ea2 100644 --- a/test/passes/simplify-locals.wast +++ b/test/passes/simplify-locals.wast @@ -158,5 +158,14 @@ (get_local $b) ) ) + (func $memories (param $i2 i32) (param $i3 i32) + (set_local $i3 + (i32.const 1) + ) + (i32.store8 + (get_local $i2) + (get_local $i3) + ) + ) ) |