summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/reduce/atomics-and-bulk-memory.wast27
-rw-r--r--test/reduce/atomics-and-bulk-memory.wast.txt15
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)
+ )
+ )
+)
+