diff options
author | Alon Zakai <azakai@google.com> | 2021-01-15 21:48:29 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-15 13:48:29 -0800 |
commit | 2488b523216600b4de2fe1e33ad695b337f8b9f8 (patch) | |
tree | 2b421722cf4178e5979738e177cf53fbdf1c3db4 /test/reduce | |
parent | c57dd1ff777b04650e4603a043644a2519019665 (diff) | |
download | binaryen-2488b523216600b4de2fe1e33ad695b337f8b9f8.tar.gz binaryen-2488b523216600b4de2fe1e33ad695b337f8b9f8.tar.bz2 binaryen-2488b523216600b4de2fe1e33ad695b337f8b9f8.zip |
wasm-reduce: Fix setting of feature flags after loading (#3493)
We mistakenly did not set the flags to all, which meant that if the
features section was not present, we'd not have the proper features
set, leading to errors on writing.
Diffstat (limited to 'test/reduce')
-rw-r--r-- | test/reduce/atomics-and-bulk-memory.wast | 27 | ||||
-rw-r--r-- | test/reduce/atomics-and-bulk-memory.wast.txt | 15 |
2 files changed, 42 insertions, 0 deletions
diff --git a/test/reduce/atomics-and-bulk-memory.wast b/test/reduce/atomics-and-bulk-memory.wast new file mode 100644 index 000000000..a5b31d4be --- /dev/null +++ b/test/reduce/atomics-and-bulk-memory.wast @@ -0,0 +1,27 @@ +(module + (memory 1 1) + ;; this can be removed destructively + (data passive "some-data") + (func "foo" (result i32) + ;; this can be removed destructively + (memory.init 0 + (i32.const 3) + (i32.const 3) + (i32.const 3)) + (i32.atomic.store8 + (i32.const 0) + ;; an add that can be optimized + (i32.add + (i32.const 97) + (i32.const 2) + ) + ) + ;; add some nops and blocks for reduction to remove + (nop) + (block (result i32) + (i32.atomic.load8_u + (i32.const 0) + ) + ) + ) +) diff --git a/test/reduce/atomics-and-bulk-memory.wast.txt b/test/reduce/atomics-and-bulk-memory.wast.txt new file mode 100644 index 000000000..ace3f57d9 --- /dev/null +++ b/test/reduce/atomics-and-bulk-memory.wast.txt @@ -0,0 +1,15 @@ +(module + (type $none_=>_i32 (func (result i32))) + (memory $0 1 1) + (export "foo" (func $0)) + (func $0 (result i32) + (i32.atomic.store8 + (i32.const 0) + (i32.const 99) + ) + (i32.atomic.load8_u + (i32.const 0) + ) + ) +) + |