diff options
author | Alon Zakai <azakai@google.com> | 2020-07-31 12:35:01 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-31 12:35:01 -0700 |
commit | d09c607ff2f2c264546b7d4ea3593ae75a037750 (patch) | |
tree | 28106c525a5a6174c70ecb5527eabc171e9be039 /test | |
parent | 26060b2cfe835e208d29e12d70a1a8eee70b3c14 (diff) | |
download | binaryen-d09c607ff2f2c264546b7d4ea3593ae75a037750.tar.gz binaryen-d09c607ff2f2c264546b7d4ea3593ae75a037750.tar.bz2 binaryen-d09c607ff2f2c264546b7d4ea3593ae75a037750.zip |
New Dealign pass: reduce load/store alignment to 1 (#3010)
Pretty trivial, but will be useful in wasm2js testing, where we
can't assume an incorrectly-aligned load/store will still work,
so we'll need to be pessimistic about alignment there.
Diffstat (limited to 'test')
-rw-r--r-- | test/passes/dealign.txt | 33 | ||||
-rw-r--r-- | test/passes/dealign.wast | 11 |
2 files changed, 44 insertions, 0 deletions
diff --git a/test/passes/dealign.txt b/test/passes/dealign.txt new file mode 100644 index 000000000..379241da9 --- /dev/null +++ b/test/passes/dealign.txt @@ -0,0 +1,33 @@ +(module + (type $none_=>_none (func)) + (memory $0 1 1) + (func $test + (drop + (i32.load align=1 + (i32.const 4) + ) + ) + (drop + (i32.load align=1 + (i32.const 8) + ) + ) + (drop + (i32.load align=1 + (i32.const 12) + ) + ) + (i32.store align=1 + (i32.const 16) + (i32.const 28) + ) + (i32.store align=1 + (i32.const 20) + (i32.const 32) + ) + (i32.store align=1 + (i32.const 24) + (i32.const 36) + ) + ) +) diff --git a/test/passes/dealign.wast b/test/passes/dealign.wast new file mode 100644 index 000000000..c7116daca --- /dev/null +++ b/test/passes/dealign.wast @@ -0,0 +1,11 @@ +(module + (memory $0 1 1) + (func $test + (drop (i32.load (i32.const 4))) + (drop (i32.load align=1 (i32.const 8))) + (drop (i32.load align=2 (i32.const 12))) + (i32.store (i32.const 16) (i32.const 28)) + (i32.store align=1 (i32.const 20) (i32.const 32)) + (i32.store align=2 (i32.const 24) (i32.const 36)) + ) +) |