summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2024-01-03 14:59:38 -0800
committerGitHub <noreply@github.com>2024-01-03 14:59:38 -0800
commit0ed42cf976ce9a3dfbe9cbb0885122e8fb6a377b (patch)
treeb7969243a22e1878f37a8d02336ac81fd5fb7e33 /test
parent1878403ec9c4382ab51ca72257f4d97a23a1fc0d (diff)
downloadbinaryen-0ed42cf976ce9a3dfbe9cbb0885122e8fb6a377b.tar.gz
binaryen-0ed42cf976ce9a3dfbe9cbb0885122e8fb6a377b.tar.bz2
binaryen-0ed42cf976ce9a3dfbe9cbb0885122e8fb6a377b.zip
Use the standard shared memory text format (#6200)
Update the legacy text parser and all tests to use the standard text format for shared memories, e.g. `(memory $m 1 1 shared)` rather than `(memory $m (shared 1 1))`. Also remove support for non-standard in-line "data" or "segment" declarations. This change makes the tests more compatible with the new text parser, which only supports the standard format.
Diffstat (limited to 'test')
-rw-r--r--test/binaryen.js/atomics.js2
-rw-r--r--test/binaryen.js/atomics.js.txt2
-rw-r--r--test/binaryen.js/kitchen-sink.js.txt4
-rw-r--r--test/example/c-api-kitchen-sink.txt2
-rw-r--r--test/example/module-splitting.cpp6
-rw-r--r--test/example/module-splitting.txt18
-rw-r--r--test/lit/basic/atomics.wast8
-rw-r--r--test/lit/basic/atomics64.wast8
-rw-r--r--test/lit/basic/memory-shared.wast8
-rw-r--r--test/lit/basic/multi-memories-atomics64.wast24
-rw-r--r--test/lit/basic/nonspec-bulk-memory.wast137
-rw-r--r--test/lit/basic/unreachable-instr-type.wast8
-rw-r--r--test/lit/ctor-eval/array_new_data.wast4
-rw-r--r--test/lit/ctor-eval/v128.wast4
-rw-r--r--test/lit/passes/code-folding_enable-threads.wast5
-rw-r--r--test/lit/passes/flatten_dfo_O3_enable-threads.wast5
-rw-r--r--test/lit/passes/flatten_simplify-locals-nonesting_souperify-single-use_enable-threads.wast4
-rw-r--r--test/lit/passes/flatten_simplify-locals-nonesting_souperify_enable-threads.wast4
-rw-r--r--test/lit/passes/inlining-optimizing_enable-threads.wast4
-rw-r--r--test/lit/passes/memory-packing_all-features.wast8
-rw-r--r--test/lit/passes/merge-similar-functions_types.wast4
-rw-r--r--test/lit/passes/optimize-instructions-atomics.wast4
-rw-r--r--test/lit/passes/remove-unused-module-elements_all-features.wast22
-rw-r--r--test/lit/validation/shared-memory.wast4
-rw-r--r--test/lit/wasm-split/instrument-in-secondary-memory-custom-names.wast2
-rw-r--r--test/lit/wasm-split/instrument-in-secondary-memory.wast2
-rw-r--r--test/lit/wasm-split/profile-guided.wast2
-rw-r--r--test/lit/wat-kitchen-sink.wast6
-rw-r--r--test/lld/em_asm_pthread.wasm.out2
-rw-r--r--test/passes/fuzz-exec_all-features.txt8
-rw-r--r--test/passes/fuzz-exec_all-features.wast8
-rw-r--r--test/passes/pick-load-signs_all-features.txt2
-rw-r--r--test/passes/pick-load-signs_all-features.wast2
-rw-r--r--test/passes/precompute_all-features.txt2
-rw-r--r--test/passes/precompute_all-features.wast4
-rw-r--r--test/passes/remove-memory.txt2
-rw-r--r--test/passes/remove-memory.wast7
-rw-r--r--test/passes/remove-unused-names_merge-blocks_all-features.txt2
-rw-r--r--test/passes/remove-unused-names_merge-blocks_all-features.wast2
-rw-r--r--test/passes/remove-unused-nonfunction-module-elements_all-features.txt10
-rw-r--r--test/passes/remove-unused-nonfunction-module-elements_all-features.wast10
-rw-r--r--test/passes/safe-heap_enable-threads_enable-simd.txt4
-rw-r--r--test/passes/safe-heap_enable-threads_enable-simd.wast4
-rw-r--r--test/passes/safe-heap_enable-threads_enable-simd64.txt4
-rw-r--r--test/passes/safe-heap_enable-threads_enable-simd64.wast4
-rw-r--r--test/passes/safe-heap_low-memory-unused_enable-threads_enable-simd.txt4
-rw-r--r--test/passes/safe-heap_low-memory-unused_enable-threads_enable-simd.wast4
-rw-r--r--test/passes/simplify-locals_all-features.txt4
-rw-r--r--test/passes/simplify-locals_all-features.wast4
-rw-r--r--test/passes/simplify-locals_all-features_disable-exception-handling.txt2
-rw-r--r--test/passes/simplify-locals_all-features_disable-exception-handling.wast2
-rw-r--r--test/passes/ssa_fuzz-exec_enable-threads.txt2
-rw-r--r--test/passes/ssa_fuzz-exec_enable-threads.wast3
-rw-r--r--test/print/memory-import-shared.minified.txt2
-rw-r--r--test/print/memory-import-shared.txt2
-rw-r--r--test/print/memory-import-shared.wast2
-rw-r--r--test/print/memory-shared.minified.txt2
-rw-r--r--test/print/memory-shared.txt2
-rw-r--r--test/print/memory-shared.wast2
-rw-r--r--test/spec/atomics.wast2
-rw-r--r--test/wasm2js/atomic_fence.wast2
-rw-r--r--test/wasm2js/atomics_32.wast2
62 files changed, 144 insertions, 287 deletions
diff --git a/test/binaryen.js/atomics.js b/test/binaryen.js/atomics.js
index ce68656e0..471e4c529 100644
--- a/test/binaryen.js/atomics.js
+++ b/test/binaryen.js/atomics.js
@@ -1,6 +1,6 @@
var wast = `
(module
- (memory $0 (shared 1 1))
+ (memory $0 1 1 shared)
)
`;
diff --git a/test/binaryen.js/atomics.js.txt b/test/binaryen.js/atomics.js.txt
index 40d2be26a..aec17b82a 100644
--- a/test/binaryen.js/atomics.js.txt
+++ b/test/binaryen.js/atomics.js.txt
@@ -1,6 +1,6 @@
(module
(type $0 (func))
- (memory $0 (shared 1 1))
+ (memory $0 1 1 shared)
(func $main
(i32.atomic.store
(i32.const 0)
diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt
index 8c6138413..bbef03377 100644
--- a/test/binaryen.js/kitchen-sink.js.txt
+++ b/test/binaryen.js/kitchen-sink.js.txt
@@ -139,7 +139,7 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
(import "module" "base" (func $an-imported (type $2) (param i32 f64) (result f32)))
(import "module" "base" (tag $a-tag-imp (param i32)))
(global $a-global i32 (i32.const 1))
- (memory $0 (shared 1 256))
+ (memory $0 1 256 shared)
(data $0 (i32.const 10) "hello, world")
(data $1 "I am passive")
(table $t0 1 funcref)
@@ -2243,7 +2243,7 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
(import "module" "base" (func $an-imported (type $2) (param i32 f64) (result f32)))
(import "module" "base" (tag $a-tag-imp (param i32)))
(global $a-global i32 (i32.const 1))
- (memory $0 (shared 1 256))
+ (memory $0 1 256 shared)
(data $0 (i32.const 10) "hello, world")
(data $1 "I am passive")
(table $t0 1 funcref)
diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt
index 8955921b8..06ec3a1b7 100644
--- a/test/example/c-api-kitchen-sink.txt
+++ b/test/example/c-api-kitchen-sink.txt
@@ -88,7 +88,7 @@ BinaryenFeatureAll: 131071
))
(global $i32Struct-global (mut (ref null $1)) (struct.new_default $1))
(global $string-global (mut stringref) (string.const ""))
- (memory $0 (shared 1 256))
+ (memory $0 1 256 shared)
(data $0 (i32.const 10) "hello, world")
(data $1 "I am passive")
(table $tab 0 100 funcref)
diff --git a/test/example/module-splitting.cpp b/test/example/module-splitting.cpp
index 95d6de44c..cb3df4e78 100644
--- a/test/example/module-splitting.cpp
+++ b/test/example/module-splitting.cpp
@@ -73,7 +73,7 @@ int main() {
// Global stuff
do_test({}, R"(
(module
- (memory $mem (shared 3 42))
+ (memory $mem 3 42 shared)
(table $tab 3 42 funcref)
(global $glob (mut i32) (i32.const 7))
(tag $e (param i32))
@@ -82,7 +82,7 @@ int main() {
// Imported global stuff
do_test({}, R"(
(module
- (import "env" "mem" (memory $mem (shared 3 42)))
+ (import "env" "mem" (memory $mem 3 42 shared))
(import "env" "tab" (table $tab 3 42 funcref))
(import "env" "glob" (global $glob (mut i32)))
(import "env" "e" (tag $e (param i32)))
@@ -91,7 +91,7 @@ int main() {
// Exported global stuff
do_test({}, R"(
(module
- (memory $mem (shared 3 42))
+ (memory $mem 3 42 shared)
(table $tab 3 42 funcref)
(global $glob (mut i32) (i32.const 7))
(tag $e (param i32))
diff --git a/test/example/module-splitting.txt b/test/example/module-splitting.txt
index 69146cbf9..b083e8967 100644
--- a/test/example/module-splitting.txt
+++ b/test/example/module-splitting.txt
@@ -14,7 +14,7 @@ Before:
(module
(type $0 (func (param i32)))
(global $glob (mut i32) (i32.const 7))
- (memory $mem (shared 3 42))
+ (memory $mem 3 42 shared)
(table $tab 3 42 funcref)
(tag $e (param i32))
)
@@ -23,7 +23,7 @@ After:
(module
(type $0 (func (param i32)))
(global $glob (mut i32) (i32.const 7))
- (memory $mem (shared 3 42))
+ (memory $mem 3 42 shared)
(table $tab 3 42 funcref)
(tag $e (param i32))
(export "%memory" (memory $mem))
@@ -34,7 +34,7 @@ After:
Secondary:
(module
(type $0 (func (param i32)))
- (import "primary" "%memory" (memory $mem (shared 3 42)))
+ (import "primary" "%memory" (memory $mem 3 42 shared))
(import "primary" "%table" (table $tab 3 42 funcref))
(import "primary" "%global" (global $glob (mut i32)))
(import "primary" "%tag" (tag $e (param i32)))
@@ -44,7 +44,7 @@ Secondary:
Before:
(module
(type $0 (func (param i32)))
- (import "env" "mem" (memory $mem (shared 3 42)))
+ (import "env" "mem" (memory $mem 3 42 shared))
(import "env" "tab" (table $tab 3 42 funcref))
(import "env" "glob" (global $glob (mut i32)))
(import "env" "e" (tag $e (param i32)))
@@ -53,7 +53,7 @@ Keeping: <none>
After:
(module
(type $0 (func (param i32)))
- (import "env" "mem" (memory $mem (shared 3 42)))
+ (import "env" "mem" (memory $mem 3 42 shared))
(import "env" "tab" (table $tab 3 42 funcref))
(import "env" "glob" (global $glob (mut i32)))
(import "env" "e" (tag $e (param i32)))
@@ -65,7 +65,7 @@ After:
Secondary:
(module
(type $0 (func (param i32)))
- (import "primary" "%memory" (memory $mem (shared 3 42)))
+ (import "primary" "%memory" (memory $mem 3 42 shared))
(import "primary" "%table" (table $tab 3 42 funcref))
(import "primary" "%global" (global $glob (mut i32)))
(import "primary" "%tag" (tag $e (param i32)))
@@ -76,7 +76,7 @@ Before:
(module
(type $0 (func (param i32)))
(global $glob (mut i32) (i32.const 7))
- (memory $mem (shared 3 42))
+ (memory $mem 3 42 shared)
(table $tab 3 42 funcref)
(tag $e (param i32))
(export "mem" (memory $mem))
@@ -89,7 +89,7 @@ After:
(module
(type $0 (func (param i32)))
(global $glob (mut i32) (i32.const 7))
- (memory $mem (shared 3 42))
+ (memory $mem 3 42 shared)
(table $tab 3 42 funcref)
(tag $e (param i32))
(export "mem" (memory $mem))
@@ -100,7 +100,7 @@ After:
Secondary:
(module
(type $0 (func (param i32)))
- (import "primary" "mem" (memory $mem (shared 3 42)))
+ (import "primary" "mem" (memory $mem 3 42 shared))
(import "primary" "tab" (table $tab 3 42 funcref))
(import "primary" "glob" (global $glob (mut i32)))
(import "primary" "e" (tag $e (param i32)))
diff --git a/test/lit/basic/atomics.wast b/test/lit/basic/atomics.wast
index ef98afe4e..e73d6b611 100644
--- a/test/lit/basic/atomics.wast
+++ b/test/lit/basic/atomics.wast
@@ -14,10 +14,10 @@
;; CHECK-BIN: (type $0 (func))
;; CHECK-BIN-NODEBUG: (type $0 (func))
(type $0 (func))
- ;; CHECK-TEXT: (memory $0 (shared 23 256))
- ;; CHECK-BIN: (memory $0 (shared 23 256))
- ;; CHECK-BIN-NODEBUG: (memory $0 (shared 23 256))
- (memory $0 (shared 23 256))
+ ;; CHECK-TEXT: (memory $0 23 256 shared)
+ ;; CHECK-BIN: (memory $0 23 256 shared)
+ ;; CHECK-BIN-NODEBUG: (memory $0 23 256 shared)
+ (memory $0 23 256 shared)
;; CHECK-TEXT: (func $atomic-loadstore (type $0)
;; CHECK-TEXT-NEXT: (local $0 i32)
diff --git a/test/lit/basic/atomics64.wast b/test/lit/basic/atomics64.wast
index b30b1ce6e..255ecc033 100644
--- a/test/lit/basic/atomics64.wast
+++ b/test/lit/basic/atomics64.wast
@@ -14,10 +14,10 @@
;; CHECK-BIN: (type $0 (func))
;; CHECK-BIN-NODEBUG: (type $0 (func))
(type $0 (func))
- ;; CHECK-TEXT: (memory $0 (shared i64 23 256))
- ;; CHECK-BIN: (memory $0 (shared i64 23 256))
- ;; CHECK-BIN-NODEBUG: (memory $0 (shared i64 23 256))
- (memory $0 (shared i64 23 256))
+ ;; CHECK-TEXT: (memory $0 i64 23 256 shared)
+ ;; CHECK-BIN: (memory $0 i64 23 256 shared)
+ ;; CHECK-BIN-NODEBUG: (memory $0 i64 23 256 shared)
+ (memory $0 i64 23 256 shared)
;; CHECK-TEXT: (func $atomic-loadstore (type $0)
;; CHECK-TEXT-NEXT: (local $0 i64)
diff --git a/test/lit/basic/memory-shared.wast b/test/lit/basic/memory-shared.wast
index bc2f8bacc..fe15c20e7 100644
--- a/test/lit/basic/memory-shared.wast
+++ b/test/lit/basic/memory-shared.wast
@@ -10,8 +10,8 @@
;; RUN: cat %t.bin.nodebug.wast | filecheck %s --check-prefix=CHECK-BIN-NODEBUG
(module
- ;; CHECK-TEXT: (memory $0 (shared 23 256))
- ;; CHECK-BIN: (memory $0 (shared 23 256))
- ;; CHECK-BIN-NODEBUG: (memory $0 (shared 23 256))
- (memory $0 (shared 23 256))
+ ;; CHECK-TEXT: (memory $0 23 256 shared)
+ ;; CHECK-BIN: (memory $0 23 256 shared)
+ ;; CHECK-BIN-NODEBUG: (memory $0 23 256 shared)
+ (memory $0 23 256 shared)
)
diff --git a/test/lit/basic/multi-memories-atomics64.wast b/test/lit/basic/multi-memories-atomics64.wast
index 79afddb3b..0795d10ad 100644
--- a/test/lit/basic/multi-memories-atomics64.wast
+++ b/test/lit/basic/multi-memories-atomics64.wast
@@ -14,15 +14,15 @@
;; CHECK-BIN: (type $0 (func))
;; CHECK-BIN-NODEBUG: (type $0 (func))
(type $0 (func))
- ;; CHECK-TEXT: (memory $appMemory (shared i64 23 256))
- ;; CHECK-BIN: (memory $appMemory (shared i64 23 256))
- (memory $appMemory (shared i64 23 256))
- ;; CHECK-TEXT: (memory $dataMemory (shared i64 23 256))
- ;; CHECK-BIN: (memory $dataMemory (shared i64 23 256))
- (memory $dataMemory (shared i64 23 256))
- ;; CHECK-TEXT: (memory $instrumentMemory (shared i64 23 256))
- ;; CHECK-BIN: (memory $instrumentMemory (shared i64 23 256))
- (memory $instrumentMemory (shared i64 23 256))
+ ;; CHECK-TEXT: (memory $appMemory i64 23 256 shared)
+ ;; CHECK-BIN: (memory $appMemory i64 23 256 shared)
+ (memory $appMemory i64 23 256 shared)
+ ;; CHECK-TEXT: (memory $dataMemory i64 23 256 shared)
+ ;; CHECK-BIN: (memory $dataMemory i64 23 256 shared)
+ (memory $dataMemory i64 23 256 shared)
+ ;; CHECK-TEXT: (memory $instrumentMemory i64 23 256 shared)
+ ;; CHECK-BIN: (memory $instrumentMemory i64 23 256 shared)
+ (memory $instrumentMemory i64 23 256 shared)
;; CHECK-TEXT: (func $atomic-loadstore (type $0)
;; CHECK-TEXT-NEXT: (local $0 i64)
@@ -1064,11 +1064,11 @@
(atomic.fence)
)
)
-;; CHECK-BIN-NODEBUG: (memory $0 (shared i64 23 256))
+;; CHECK-BIN-NODEBUG: (memory $0 i64 23 256 shared)
-;; CHECK-BIN-NODEBUG: (memory $1 (shared i64 23 256))
+;; CHECK-BIN-NODEBUG: (memory $1 i64 23 256 shared)
-;; CHECK-BIN-NODEBUG: (memory $2 (shared i64 23 256))
+;; CHECK-BIN-NODEBUG: (memory $2 i64 23 256 shared)
;; CHECK-BIN-NODEBUG: (func $0 (type $0)
;; CHECK-BIN-NODEBUG-NEXT: (local $0 i64)
diff --git a/test/lit/basic/nonspec-bulk-memory.wast b/test/lit/basic/nonspec-bulk-memory.wast
deleted file mode 100644
index 980598f5d..000000000
--- a/test/lit/basic/nonspec-bulk-memory.wast
+++ /dev/null
@@ -1,137 +0,0 @@
-;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
-
-;; RUN: wasm-opt %s -all -o %t.text.wast -g -S
-;; RUN: wasm-as %s -all -g -o %t.wasm
-;; RUN: wasm-dis %t.wasm -all -o %t.bin.wast
-;; RUN: wasm-as %s -all -o %t.nodebug.wasm
-;; RUN: wasm-dis %t.nodebug.wasm -all -o %t.bin.nodebug.wast
-;; RUN: cat %t.text.wast | filecheck %s --check-prefix=CHECK-TEXT
-;; RUN: cat %t.bin.wast | filecheck %s --check-prefix=CHECK-BIN
-;; RUN: cat %t.bin.nodebug.wast | filecheck %s --check-prefix=CHECK-BIN-NODEBUG
-
-(module
- (memory 1024 1024
- (segment 0 "hello, world")
- )
-
- ;; CHECK-TEXT: (type $0 (func))
-
- ;; CHECK-TEXT: (memory $0 1024 1024)
-
- ;; CHECK-TEXT: (data $0 (i32.const 0) "hello, world")
-
- ;; CHECK-TEXT: (func $memory.init (type $0)
- ;; CHECK-TEXT-NEXT: (memory.init $0
- ;; CHECK-TEXT-NEXT: (i32.const 512)
- ;; CHECK-TEXT-NEXT: (i32.const 0)
- ;; CHECK-TEXT-NEXT: (i32.const 12)
- ;; CHECK-TEXT-NEXT: )
- ;; CHECK-TEXT-NEXT: )
- ;; CHECK-BIN: (type $0 (func))
-
- ;; CHECK-BIN: (memory $0 1024 1024)
-
- ;; CHECK-BIN: (data $0 (i32.const 0) "hello, world")
-
- ;; CHECK-BIN: (func $memory.init (type $0)
- ;; CHECK-BIN-NEXT: (memory.init $0
- ;; CHECK-BIN-NEXT: (i32.const 512)
- ;; CHECK-BIN-NEXT: (i32.const 0)
- ;; CHECK-BIN-NEXT: (i32.const 12)
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: )
- (func $memory.init
- (memory.init 0
- (i32.const 512)
- (i32.const 0)
- (i32.const 12)
- )
- )
-
- ;; CHECK-TEXT: (func $data.drop (type $0)
- ;; CHECK-TEXT-NEXT: (data.drop $0)
- ;; CHECK-TEXT-NEXT: )
- ;; CHECK-BIN: (func $data.drop (type $0)
- ;; CHECK-BIN-NEXT: (data.drop $0)
- ;; CHECK-BIN-NEXT: )
- (func $data.drop
- (data.drop 0)
- )
-
- ;; CHECK-TEXT: (func $memory.copy (type $0)
- ;; CHECK-TEXT-NEXT: (memory.copy
- ;; CHECK-TEXT-NEXT: (i32.const 512)
- ;; CHECK-TEXT-NEXT: (i32.const 0)
- ;; CHECK-TEXT-NEXT: (i32.const 12)
- ;; CHECK-TEXT-NEXT: )
- ;; CHECK-TEXT-NEXT: )
- ;; CHECK-BIN: (func $memory.copy (type $0)
- ;; CHECK-BIN-NEXT: (memory.copy
- ;; CHECK-BIN-NEXT: (i32.const 512)
- ;; CHECK-BIN-NEXT: (i32.const 0)
- ;; CHECK-BIN-NEXT: (i32.const 12)
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: )
- (func $memory.copy
- (memory.copy
- (i32.const 512)
- (i32.const 0)
- (i32.const 12)
- )
- )
-
- ;; CHECK-TEXT: (func $memory.fill (type $0)
- ;; CHECK-TEXT-NEXT: (memory.fill
- ;; CHECK-TEXT-NEXT: (i32.const 0)
- ;; CHECK-TEXT-NEXT: (i32.const 42)
- ;; CHECK-TEXT-NEXT: (i32.const 1024)
- ;; CHECK-TEXT-NEXT: )
- ;; CHECK-TEXT-NEXT: )
- ;; CHECK-BIN: (func $memory.fill (type $0)
- ;; CHECK-BIN-NEXT: (memory.fill
- ;; CHECK-BIN-NEXT: (i32.const 0)
- ;; CHECK-BIN-NEXT: (i32.const 42)
- ;; CHECK-BIN-NEXT: (i32.const 1024)
- ;; CHECK-BIN-NEXT: )
- ;; CHECK-BIN-NEXT: )
- (func $memory.fill
- (memory.fill
- (i32.const 0)
- (i32.const 42)
- (i32.const 1024)
- )
- )
-)
-;; CHECK-BIN-NODEBUG: (type $0 (func))
-
-;; CHECK-BIN-NODEBUG: (memory $0 1024 1024)
-
-;; CHECK-BIN-NODEBUG: (data $0 (i32.const 0) "hello, world")
-
-;; CHECK-BIN-NODEBUG: (func $0 (type $0)
-;; CHECK-BIN-NODEBUG-NEXT: (memory.init $0
-;; CHECK-BIN-NODEBUG-NEXT: (i32.const 512)
-;; CHECK-BIN-NODEBUG-NEXT: (i32.const 0)
-;; CHECK-BIN-NODEBUG-NEXT: (i32.const 12)
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: )
-
-;; CHECK-BIN-NODEBUG: (func $1 (type $0)
-;; CHECK-BIN-NODEBUG-NEXT: (data.drop $0)
-;; CHECK-BIN-NODEBUG-NEXT: )
-
-;; CHECK-BIN-NODEBUG: (func $2 (type $0)
-;; CHECK-BIN-NODEBUG-NEXT: (memory.copy
-;; CHECK-BIN-NODEBUG-NEXT: (i32.const 512)
-;; CHECK-BIN-NODEBUG-NEXT: (i32.const 0)
-;; CHECK-BIN-NODEBUG-NEXT: (i32.const 12)
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: )
-
-;; CHECK-BIN-NODEBUG: (func $3 (type $0)
-;; CHECK-BIN-NODEBUG-NEXT: (memory.fill
-;; CHECK-BIN-NODEBUG-NEXT: (i32.const 0)
-;; CHECK-BIN-NODEBUG-NEXT: (i32.const 42)
-;; CHECK-BIN-NODEBUG-NEXT: (i32.const 1024)
-;; CHECK-BIN-NODEBUG-NEXT: )
-;; CHECK-BIN-NODEBUG-NEXT: )
diff --git a/test/lit/basic/unreachable-instr-type.wast b/test/lit/basic/unreachable-instr-type.wast
index ff6df8bac..494678a32 100644
--- a/test/lit/basic/unreachable-instr-type.wast
+++ b/test/lit/basic/unreachable-instr-type.wast
@@ -10,11 +10,11 @@
;; RUN: cat %t.bin.nodebug.wast | filecheck %s --check-prefix=CHECK-BIN-NODEBUG
(module
- (memory (shared 1 1))
+ (memory 1 1 shared)
;; CHECK-TEXT: (type $0 (func))
- ;; CHECK-TEXT: (memory $0 (shared 1 1))
+ ;; CHECK-TEXT: (memory $0 1 1 shared)
;; CHECK-TEXT: (func $test (type $0)
;; CHECK-TEXT-NEXT: (i32.load
@@ -41,7 +41,7 @@
;; CHECK-TEXT-NEXT: )
;; CHECK-BIN: (type $0 (func))
- ;; CHECK-BIN: (memory $0 (shared 1 1))
+ ;; CHECK-BIN: (memory $0 1 1 shared)
;; CHECK-BIN: (func $test (type $0)
;; CHECK-BIN-NEXT: (unreachable)
@@ -74,7 +74,7 @@
)
;; CHECK-BIN-NODEBUG: (type $0 (func))
-;; CHECK-BIN-NODEBUG: (memory $0 (shared 1 1))
+;; CHECK-BIN-NODEBUG: (memory $0 1 1 shared)
;; CHECK-BIN-NODEBUG: (func $0 (type $0)
;; CHECK-BIN-NODEBUG-NEXT: (unreachable)
diff --git a/test/lit/ctor-eval/array_new_data.wast b/test/lit/ctor-eval/array_new_data.wast
index a185c171f..90551862d 100644
--- a/test/lit/ctor-eval/array_new_data.wast
+++ b/test/lit/ctor-eval/array_new_data.wast
@@ -7,8 +7,8 @@
;; CHECK: (type $[i8] (array i8))
(type $[i8] (array i8))
- ;; CHECK: (memory $0 (shared 16 17))
- (memory $0 (shared 16 17))
+ ;; CHECK: (memory $0 16 17 shared)
+ (memory $0 16 17 shared)
;; CHECK: (data $0 (i32.const 40) "")
(data $0 (i32.const 40) "")
;; CHECK: (data $1 (i32.const 0) "")
diff --git a/test/lit/ctor-eval/v128.wast b/test/lit/ctor-eval/v128.wast
index 009ef57f2..71a380623 100644
--- a/test/lit/ctor-eval/v128.wast
+++ b/test/lit/ctor-eval/v128.wast
@@ -6,8 +6,8 @@
;; CHECK: (type $1 (func (result v128)))
- ;; CHECK: (memory $0 (shared 16 17))
- (memory $0 (shared 16 17))
+ ;; CHECK: (memory $0 16 17 shared)
+ (memory $0 16 17 shared)
(export "v128" (func $v128))
;; CHECK: (data $0 (i32.const 23) "\e0\ff\c0N\8e\00\00\fe\01\00\12\81\85\fd\ff\90")
diff --git a/test/lit/passes/code-folding_enable-threads.wast b/test/lit/passes/code-folding_enable-threads.wast
index 15b83f71b..487fbd3ac 100644
--- a/test/lit/passes/code-folding_enable-threads.wast
+++ b/test/lit/passes/code-folding_enable-threads.wast
@@ -262,8 +262,8 @@
(module
;; CHECK: (type $0 (func (result i32)))
- ;; CHECK: (memory $0 (shared 1 1))
- (memory $0 (shared 1 1))
+ ;; CHECK: (memory $0 1 1 shared)
+ (memory $0 1 1 shared)
;; CHECK: (export "func_2224" (func $0))
(export "func_2224" (func $0))
;; CHECK: (func $0 (result i32)
@@ -420,4 +420,3 @@
)
)
)
-
diff --git a/test/lit/passes/flatten_dfo_O3_enable-threads.wast b/test/lit/passes/flatten_dfo_O3_enable-threads.wast
index 55bf54dc9..ccb029060 100644
--- a/test/lit/passes/flatten_dfo_O3_enable-threads.wast
+++ b/test/lit/passes/flatten_dfo_O3_enable-threads.wast
@@ -14,8 +14,8 @@
;; CHECK: (type $4 (func (result i32)))
- ;; CHECK: (memory $0 (shared 1 1))
- (memory $0 (shared 1 1))
+ ;; CHECK: (memory $0 1 1 shared)
+ (memory $0 1 1 shared)
;; CHECK: (export "one" (func $one))
;; CHECK: (export "two" (func $two))
@@ -264,4 +264,3 @@
)
)
)
-
diff --git a/test/lit/passes/flatten_simplify-locals-nonesting_souperify-single-use_enable-threads.wast b/test/lit/passes/flatten_simplify-locals-nonesting_souperify-single-use_enable-threads.wast
index 0bcc36de2..ea693d502 100644
--- a/test/lit/passes/flatten_simplify-locals-nonesting_souperify-single-use_enable-threads.wast
+++ b/test/lit/passes/flatten_simplify-locals-nonesting_souperify-single-use_enable-threads.wast
@@ -30,8 +30,8 @@
;; CHECK: (type $12 (func (param i32 i32 i32 i32 i32) (result i32)))
- ;; CHECK: (memory $0 (shared 1 1))
- (memory $0 (shared 1 1))
+ ;; CHECK: (memory $0 1 1 shared)
+ (memory $0 1 1 shared)
;; Figure 1a from the Souper paper https://arxiv.org/pdf/1711.04422.pdf
;; CHECK: (export "replaced-print-internal" (func $replaced-print-internal))
diff --git a/test/lit/passes/flatten_simplify-locals-nonesting_souperify_enable-threads.wast b/test/lit/passes/flatten_simplify-locals-nonesting_souperify_enable-threads.wast
index 61430d653..e8d423058 100644
--- a/test/lit/passes/flatten_simplify-locals-nonesting_souperify_enable-threads.wast
+++ b/test/lit/passes/flatten_simplify-locals-nonesting_souperify_enable-threads.wast
@@ -30,8 +30,8 @@
;; CHECK: (type $12 (func (param i32 i32 i32 i32 i32) (result i32)))
- ;; CHECK: (memory $0 (shared 1 1))
- (memory $0 (shared 1 1))
+ ;; CHECK: (memory $0 1 1 shared)
+ (memory $0 1 1 shared)
;; Figure 1a from the Souper paper https://arxiv.org/pdf/1711.04422.pdf
;; CHECK: (export "replaced-print-internal" (func $replaced-print-internal))
diff --git a/test/lit/passes/inlining-optimizing_enable-threads.wast b/test/lit/passes/inlining-optimizing_enable-threads.wast
index 60385b11a..631fc1fa5 100644
--- a/test/lit/passes/inlining-optimizing_enable-threads.wast
+++ b/test/lit/passes/inlining-optimizing_enable-threads.wast
@@ -153,8 +153,8 @@
(module
;; CHECK: (type $0 (func (result i64)))
- ;; CHECK: (memory $0 (shared 1 1))
- (memory $0 (shared 1 1))
+ ;; CHECK: (memory $0 1 1 shared)
+ (memory $0 1 1 shared)
(func $0 (result i32)
(i32.atomic.store16
(i32.const 0)
diff --git a/test/lit/passes/memory-packing_all-features.wast b/test/lit/passes/memory-packing_all-features.wast
index dfcf5ce53..1f0886d66 100644
--- a/test/lit/passes/memory-packing_all-features.wast
+++ b/test/lit/passes/memory-packing_all-features.wast
@@ -2279,8 +2279,8 @@
;; the wrong segments in the presence of unreferenced segments.
;; CHECK: (type $0 (func))
- ;; CHECK: (memory $0 (shared 1 1))
- (memory $0 (shared 1 1))
+ ;; CHECK: (memory $0 1 1 shared)
+ (memory $0 1 1 shared)
(data (i32.const 0) "")
(data "foo")
;; CHECK: (data $1 "foo")
@@ -2394,8 +2394,8 @@
(type $array (array (mut i32)))
;; CHECK: (type $1 (func (param (ref $array) i32 i32 i32)))
- ;; CHECK: (memory $0 (shared 16 17))
- (memory $0 (shared 16 17))
+ ;; CHECK: (memory $0 16 17 shared)
+ (memory $0 16 17 shared)
;; CHECK: (data $0 "")
(data $0 "")
;; CHECK: (func $0 (type $1) (param $0 (ref $array)) (param $1 i32) (param $2 i32) (param $3 i32)
diff --git a/test/lit/passes/merge-similar-functions_types.wast b/test/lit/passes/merge-similar-functions_types.wast
index 717777ab7..980f10cd9 100644
--- a/test/lit/passes/merge-similar-functions_types.wast
+++ b/test/lit/passes/merge-similar-functions_types.wast
@@ -120,8 +120,8 @@
;; CHECK: (global $global$0 (mut i32) (i32.const 10))
(global $global$0 (mut i32) (i32.const 10))
- ;; CHECK: (memory $0 (shared 16 17))
- (memory $0 (shared 16 17))
+ ;; CHECK: (memory $0 16 17 shared)
+ (memory $0 16 17 shared)
;; CHECK: (elem declare func $2 $3)
diff --git a/test/lit/passes/optimize-instructions-atomics.wast b/test/lit/passes/optimize-instructions-atomics.wast
index 29037186d..e59c6a4e7 100644
--- a/test/lit/passes/optimize-instructions-atomics.wast
+++ b/test/lit/passes/optimize-instructions-atomics.wast
@@ -2,8 +2,8 @@
;; RUN: wasm-opt %s --optimize-instructions --enable-threads -S -o - | filecheck %s
(module
- ;; CHECK: (import "env" "memory" (memory $0 (shared 256 256)))
- (import "env" "memory" (memory $0 (shared 256 256)))
+ ;; CHECK: (import "env" "memory" (memory $0 256 256 shared))
+ (import "env" "memory" (memory $0 256 256 shared))
;; CHECK: (func $x
;; CHECK-NEXT: (drop
diff --git a/test/lit/passes/remove-unused-module-elements_all-features.wast b/test/lit/passes/remove-unused-module-elements_all-features.wast
index 15a843064..f287df88f 100644
--- a/test/lit/passes/remove-unused-module-elements_all-features.wast
+++ b/test/lit/passes/remove-unused-module-elements_all-features.wast
@@ -260,8 +260,8 @@
(module ;; more use checks
;; CHECK: (type $0 (func))
- ;; CHECK: (memory $0 (shared 23 256))
- (memory $0 (shared 23 256))
+ ;; CHECK: (memory $0 23 256 shared)
+ (memory $0 23 256 shared)
(export "user" $user)
;; CHECK: (export "user" (func $user))
@@ -278,8 +278,8 @@
(module ;; more use checks
;; CHECK: (type $0 (func (result i32)))
- ;; CHECK: (memory $0 (shared 23 256))
- (memory $0 (shared 23 256))
+ ;; CHECK: (memory $0 23 256 shared)
+ (memory $0 23 256 shared)
(export "user" $user)
;; CHECK: (export "user" (func $user))
@@ -296,8 +296,8 @@
(module ;; more use checks
;; CHECK: (type $0 (func (result i32)))
- ;; CHECK: (memory $0 (shared 23 256))
- (memory $0 (shared 23 256))
+ ;; CHECK: (memory $0 23 256 shared)
+ (memory $0 23 256 shared)
(export "user" $user)
;; CHECK: (export "user" (func $user))
@@ -315,8 +315,8 @@
(module ;; more use checks
;; CHECK: (type $0 (func))
- ;; CHECK: (memory $0 (shared 23 256))
- (memory $0 (shared 23 256))
+ ;; CHECK: (memory $0 23 256 shared)
+ (memory $0 23 256 shared)
(export "user" $user)
;; CHECK: (export "user" (func $user))
@@ -346,8 +346,8 @@
(module ;; more use checks
;; CHECK: (type $0 (func (result i32)))
- ;; CHECK: (memory $0 (shared 23 256))
- (memory $0 (shared 23 256))
+ ;; CHECK: (memory $0 23 256 shared)
+ (memory $0 23 256 shared)
(export "user" $user)
;; CHECK: (export "user" (func $user))
@@ -362,7 +362,7 @@
)
)
(module ;; atomic.fence and data.drop do not use a memory, so should not keep the memory alive.
- (memory $0 (shared 1 1))
+ (memory $0 1 1 shared)
(data "")
(export "fake-user" $user)
;; CHECK: (type $0 (func))
diff --git a/test/lit/validation/shared-memory.wast b/test/lit/validation/shared-memory.wast
index 03128756c..346195949 100644
--- a/test/lit/validation/shared-memory.wast
+++ b/test/lit/validation/shared-memory.wast
@@ -4,8 +4,8 @@
;; RUN: wasm-opt %s --enable-threads -o - -S | filecheck %s --check-prefix ATOMICS
;; NO-ATOMICS: shared memory requires threads [--enable-threads]
-;; ATOMICS: (memory $0 (shared 10 20))
+;; ATOMICS: (memory $0 10 20 shared)
(module
- (memory (shared 10 20))
+ (memory 10 20 shared)
)
diff --git a/test/lit/wasm-split/instrument-in-secondary-memory-custom-names.wast b/test/lit/wasm-split/instrument-in-secondary-memory-custom-names.wast
index 9035a0b8b..a211e5d8a 100644
--- a/test/lit/wasm-split/instrument-in-secondary-memory-custom-names.wast
+++ b/test/lit/wasm-split/instrument-in-secondary-memory-custom-names.wast
@@ -17,7 +17,7 @@
)
;; Check that a memory import has been added for secondary memory
-;; CHECK: (import "custom_env" "custom_name" (memory $custom_name (shared 1 1)))
+;; CHECK: (import "custom_env" "custom_name" (memory $custom_name 1 1 shared))
;; And the profiling function exported
;; CHECK: (export "__write_profile" (func $__write_profile))
diff --git a/test/lit/wasm-split/instrument-in-secondary-memory.wast b/test/lit/wasm-split/instrument-in-secondary-memory.wast
index d68e4c1d6..26ac0ad18 100644
--- a/test/lit/wasm-split/instrument-in-secondary-memory.wast
+++ b/test/lit/wasm-split/instrument-in-secondary-memory.wast
@@ -17,7 +17,7 @@
)
;; Check that a memory import has been added for secondary memory
-;; CHECK: (import "env" "profile-data" (memory $profile-data (shared 1 1)))
+;; CHECK: (import "env" "profile-data" (memory $profile-data 1 1 shared))
;; And the profiling function exported
;; CHECK: (export "__write_profile" (func $__write_profile))
diff --git a/test/lit/wasm-split/profile-guided.wast b/test/lit/wasm-split/profile-guided.wast
index 8270204a2..6828c19fc 100644
--- a/test/lit/wasm-split/profile-guided.wast
+++ b/test/lit/wasm-split/profile-guided.wast
@@ -69,7 +69,7 @@
;; NONE: Splitting out functions: bar, bar_callee, deep_foo_callee, foo, foo_callee, shared_callee, uncalled
(module
- (memory $mem (shared 1 1))
+ (memory $mem 1 1 shared)
(export "memory" (memory $mem))
(export "foo" (func $foo))
(export "bar" (func $bar))
diff --git a/test/lit/wat-kitchen-sink.wast b/test/lit/wat-kitchen-sink.wast
index 479a8412d..05aedd519 100644
--- a/test/lit/wat-kitchen-sink.wast
+++ b/test/lit/wat-kitchen-sink.wast
@@ -216,7 +216,7 @@
;; CHECK: (import "" "mem" (memory $mimport$0 0))
- ;; CHECK: (import "mod" "imported-m" (memory $m-imported (shared 1 2)))
+ ;; CHECK: (import "mod" "imported-m" (memory $m-imported 1 2 shared))
(import "mod" "imported-m" (memory $m-imported 1 2 shared))
;; imported tables
@@ -271,10 +271,10 @@
(global $i32 i32 i32.const 42)
;; memories
- ;; CHECK: (memory $mem (shared 1 1))
+ ;; CHECK: (memory $mem 1 1 shared)
(memory $mem 1 1 shared)
(memory 0 1 shared)
- ;; CHECK: (memory $1 (shared 0 1))
+ ;; CHECK: (memory $1 0 1 shared)
;; CHECK: (memory $mem-i32 0 1)
(memory $mem-i32 i32 0 1)
diff --git a/test/lld/em_asm_pthread.wasm.out b/test/lld/em_asm_pthread.wasm.out
index 676178bd3..40f61e3a7 100644
--- a/test/lld/em_asm_pthread.wasm.out
+++ b/test/lld/em_asm_pthread.wasm.out
@@ -38,7 +38,7 @@
(type $36 (func (param i32 f64) (result i32)))
(type $37 (func (param i32 i32 i32 i32) (result f64)))
(type $38 (func (param i32 i32 i64 i32) (result i64)))
- (import "env" "memory" (memory $mimport$0 (shared 256 256)))
+ (import "env" "memory" (memory $mimport$0 256 256 shared))
(import "env" "emscripten_asm_const_int" (func $fimport$0 (param i32 i32 i32) (result i32)))
(import "env" "world" (func $fimport$1))
(import "env" "__cxa_thread_atexit" (func $fimport$2 (param i32 i32 i32) (result i32)))
diff --git a/test/passes/fuzz-exec_all-features.txt b/test/passes/fuzz-exec_all-features.txt
index 6a0ee8585..22ea5f06a 100644
--- a/test/passes/fuzz-exec_all-features.txt
+++ b/test/passes/fuzz-exec_all-features.txt
@@ -75,7 +75,7 @@
(type $2 (func (param i32 i32)))
(type $3 (func))
(import "fuzzing-support" "log-i32" (func $fimport$0 (type $1) (param i32)))
- (memory $0 (shared 1 1))
+ (memory $0 1 1 shared)
(export "unaligned_load" (func $unaligned_load))
(export "unaligned_load_offset" (func $unaligned_load_offset))
(export "aligned_for_size" (func $aligned_for_size))
@@ -148,7 +148,7 @@
[fuzz-exec] note result: unsigned_2_bytes => 65535
(module
(type $0 (func (result i32)))
- (memory $0 (shared 1 1))
+ (memory $0 1 1 shared)
(data $0 (i32.const 0) "\ff\ff")
(export "unsigned_2_bytes" (func $unsigned_2_bytes))
(func $unsigned_2_bytes (type $0) (result i32)
@@ -167,7 +167,7 @@
(type $0 (func (param i32)))
(type $1 (func))
(import "fuzzing-support" "log-i32" (func $fimport$0 (type $0) (param i32)))
- (memory $0 (shared 1 1))
+ (memory $0 1 1 shared)
(export "rmw-reads-modifies-and-writes" (func $rmw-reads-modifies-and-writes))
(func $rmw-reads-modifies-and-writes (type $1)
(drop
@@ -192,7 +192,7 @@
(type $0 (func (param i32)))
(type $1 (func))
(import "fuzzing-support" "log-i32" (func $fimport$0 (type $0) (param i32)))
- (memory $0 (shared 1 1))
+ (memory $0 1 1 shared)
(export "rmw-reads-modifies-and-writes-asymmetrical" (func $rmw-reads-modifies-and-writes-asymmetrical))
(func $rmw-reads-modifies-and-writes-asymmetrical (type $1)
(drop
diff --git a/test/passes/fuzz-exec_all-features.wast b/test/passes/fuzz-exec_all-features.wast
index 2c9d95d16..bab6afb79 100644
--- a/test/passes/fuzz-exec_all-features.wast
+++ b/test/passes/fuzz-exec_all-features.wast
@@ -32,7 +32,7 @@
)
(module
(import "fuzzing-support" "log-i32" (func $fimport$0 (param i32)))
- (memory $0 (shared 1 1))
+ (memory $0 1 1 shared)
(func $unaligned_load (export "unaligned_load") (result i32)
(i32.atomic.load
(i32.const 1) ;; unaligned ptr
@@ -78,7 +78,7 @@
)
)
(module
- (memory $0 (shared 1 1))
+ (memory $0 1 1 shared)
(data (i32.const 0) "\ff\ff")
(func $unsigned_2_bytes (export "unsigned_2_bytes") (result i32)
(i32.atomic.rmw16.xor_u ;; should be unsigned
@@ -89,7 +89,7 @@
)
(module
(import "fuzzing-support" "log-i32" (func $fimport$0 (param i32)))
- (memory $0 (shared 1 1))
+ (memory $0 1 1 shared)
(func $rmw-reads-modifies-and-writes (export "rmw-reads-modifies-and-writes")
(drop
(i64.atomic.rmw16.and_u offset=4
@@ -106,7 +106,7 @@
)
(module
(import "fuzzing-support" "log-i32" (func $fimport$0 (param i32)))
- (memory $0 (shared 1 1))
+ (memory $0 1 1 shared)
(func $rmw-reads-modifies-and-writes-asymmetrical (export "rmw-reads-modifies-and-writes-asymmetrical")
(drop
(i32.atomic.rmw8.sub_u
diff --git a/test/passes/pick-load-signs_all-features.txt b/test/passes/pick-load-signs_all-features.txt
index 9b73de23e..4bb3c1c98 100644
--- a/test/passes/pick-load-signs_all-features.txt
+++ b/test/passes/pick-load-signs_all-features.txt
@@ -1,6 +1,6 @@
(module
(type $0 (func (result i32)))
- (memory $0 (shared 16 16))
+ (memory $0 16 16)
(func $atomics-are-always-unsigned (type $0) (result i32)
(local $0 i32)
(drop
diff --git a/test/passes/pick-load-signs_all-features.wast b/test/passes/pick-load-signs_all-features.wast
index 20a77eae4..4b7e11f10 100644
--- a/test/passes/pick-load-signs_all-features.wast
+++ b/test/passes/pick-load-signs_all-features.wast
@@ -1,5 +1,5 @@
(module
- (memory $0 (shared 16 16))
+ (memory $0 16 16)
(func $atomics-are-always-unsigned (result i32)
(local $0 i32)
(drop
diff --git a/test/passes/precompute_all-features.txt b/test/passes/precompute_all-features.txt
index e5cdbb209..affa32531 100644
--- a/test/passes/precompute_all-features.txt
+++ b/test/passes/precompute_all-features.txt
@@ -8,7 +8,7 @@
(type $6 (func (result externref)))
(global $global i32 (i32.const 1))
(global $global-mut (mut i32) (i32.const 2))
- (memory $0 512 512)
+ (memory $0 6 65536)
(data $0 (i32.const 0) "hello!")
(elem declare func $dummy)
(func $x (type $0) (param $x i32)
diff --git a/test/passes/precompute_all-features.wast b/test/passes/precompute_all-features.wast
index cef6d4cc8..450001533 100644
--- a/test/passes/precompute_all-features.wast
+++ b/test/passes/precompute_all-features.wast
@@ -1,7 +1,5 @@
(module
- (memory 512 512
- (data "hello!")
- )
+ (memory (data "hello!") 512 512)
(type $0 (func (param i32)))
(global $global i32 (i32.const 1))
(global $global-mut (mut i32) (i32.const 2))
diff --git a/test/passes/remove-memory.txt b/test/passes/remove-memory.txt
index ee65d237e..ddfdde493 100644
--- a/test/passes/remove-memory.txt
+++ b/test/passes/remove-memory.txt
@@ -1,3 +1,3 @@
(module
- (memory $0 1024 1024)
+ (memory $mem 1024 1024)
)
diff --git a/test/passes/remove-memory.wast b/test/passes/remove-memory.wast
index bbb999007..26b4949a8 100644
--- a/test/passes/remove-memory.wast
+++ b/test/passes/remove-memory.wast
@@ -1,6 +1,5 @@
(module
- (memory 1024 1024
- (segment 10 "123")
- (segment 20 "149")
- )
+ (memory $mem 1024 1024)
+ (data (memory $mem) (i32.const 10) "123")
+ (data (memory $mem) (i32.const 20) "149")
)
diff --git a/test/passes/remove-unused-names_merge-blocks_all-features.txt b/test/passes/remove-unused-names_merge-blocks_all-features.txt
index e10a8707c..ac7647507 100644
--- a/test/passes/remove-unused-names_merge-blocks_all-features.txt
+++ b/test/passes/remove-unused-names_merge-blocks_all-features.txt
@@ -5,7 +5,7 @@
(type $ii (func (param i32 i32)))
(type $iii (func (param i32 i32 i32)))
(type $5 (func (result f64)))
- (memory $0 (shared 256 256))
+ (memory $0 256 256 shared)
(table $0 1 1 funcref)
(elem $0 (i32.const 0) $call-i)
(func $call-i (type $i) (param $0 i32)
diff --git a/test/passes/remove-unused-names_merge-blocks_all-features.wast b/test/passes/remove-unused-names_merge-blocks_all-features.wast
index 3ec2768e0..1063e2463 100644
--- a/test/passes/remove-unused-names_merge-blocks_all-features.wast
+++ b/test/passes/remove-unused-names_merge-blocks_all-features.wast
@@ -1,5 +1,5 @@
(module
- (memory (shared 256 256))
+ (memory 256 256 shared)
(type $i (func (param i32)))
(type $ii (func (param i32 i32)))
(type $iii (func (param i32 i32 i32)))
diff --git a/test/passes/remove-unused-nonfunction-module-elements_all-features.txt b/test/passes/remove-unused-nonfunction-module-elements_all-features.txt
index d19fcc514..b54087b81 100644
--- a/test/passes/remove-unused-nonfunction-module-elements_all-features.txt
+++ b/test/passes/remove-unused-nonfunction-module-elements_all-features.txt
@@ -132,7 +132,7 @@
)
(module
(type $0 (func))
- (memory $0 (shared 23 256))
+ (memory $0 23 256 shared)
(export "user" (func $user))
(func $user (type $0)
(i32.store
@@ -143,7 +143,7 @@
)
(module
(type $0 (func (result i32)))
- (memory $0 (shared 23 256))
+ (memory $0 23 256 shared)
(export "user" (func $user))
(func $user (type $0) (result i32)
(i32.atomic.rmw.add
@@ -154,7 +154,7 @@
)
(module
(type $0 (func (result i32)))
- (memory $0 (shared 23 256))
+ (memory $0 23 256 shared)
(export "user" (func $user))
(func $user (type $0) (result i32)
(i32.atomic.rmw8.cmpxchg_u
@@ -166,7 +166,7 @@
)
(module
(type $0 (func))
- (memory $0 (shared 23 256))
+ (memory $0 23 256 shared)
(export "user" (func $user))
(func $user (type $0)
(local $0 i32)
@@ -182,7 +182,7 @@
)
(module
(type $0 (func (result i32)))
- (memory $0 (shared 23 256))
+ (memory $0 23 256 shared)
(export "user" (func $user))
(func $user (type $0) (result i32)
(memory.atomic.notify
diff --git a/test/passes/remove-unused-nonfunction-module-elements_all-features.wast b/test/passes/remove-unused-nonfunction-module-elements_all-features.wast
index 057088798..942a20ee7 100644
--- a/test/passes/remove-unused-nonfunction-module-elements_all-features.wast
+++ b/test/passes/remove-unused-nonfunction-module-elements_all-features.wast
@@ -101,28 +101,28 @@
)
)
(module ;; more use checks
- (memory $0 (shared 23 256))
+ (memory $0 23 256 shared)
(export "user" $user)
(func $user
(i32.store (i32.const 0) (i32.const 0))
)
)
(module ;; more use checks
- (memory $0 (shared 23 256))
+ (memory $0 23 256 shared)
(export "user" $user)
(func $user (result i32)
(i32.atomic.rmw.add (i32.const 0) (i32.const 0))
)
)
(module ;; more use checks
- (memory $0 (shared 23 256))
+ (memory $0 23 256 shared)
(export "user" $user)
(func $user (result i32)
(i32.atomic.rmw8.cmpxchg_u (i32.const 0) (i32.const 0) (i32.const 0))
)
)
(module ;; more use checks
- (memory $0 (shared 23 256))
+ (memory $0 23 256 shared)
(export "user" $user)
(func $user
(local $0 i32)
@@ -137,7 +137,7 @@
)
)
(module ;; more use checks
- (memory $0 (shared 23 256))
+ (memory $0 23 256 shared)
(export "user" $user)
(func $user (result i32)
(memory.atomic.notify (i32.const 0) (i32.const 0))
diff --git a/test/passes/safe-heap_enable-threads_enable-simd.txt b/test/passes/safe-heap_enable-threads_enable-simd.txt
index 3d00dc96d..c1f811007 100644
--- a/test/passes/safe-heap_enable-threads_enable-simd.txt
+++ b/test/passes/safe-heap_enable-threads_enable-simd.txt
@@ -14,7 +14,7 @@
(import "env" "emscripten_get_sbrk_ptr" (func $emscripten_get_sbrk_ptr (result i32)))
(import "env" "segfault" (func $segfault))
(import "env" "alignfault" (func $alignfault))
- (memory $0 (shared 100 100))
+ (memory $0 100 100 shared)
(func $loads
(drop
(call $SAFE_HEAP_LOAD_i32_4_4
@@ -5441,7 +5441,7 @@
(import "env" "segfault" (func $segfault))
(import "env" "alignfault" (func $alignfault))
(import "env" "emscripten_get_sbrk_ptr" (func $emscripten_get_sbrk_ptr (result i32)))
- (memory $0 (shared 100 100))
+ (memory $0 100 100 shared)
(func $actions
(drop
(call $SAFE_HEAP_LOAD_i32_4_4
diff --git a/test/passes/safe-heap_enable-threads_enable-simd.wast b/test/passes/safe-heap_enable-threads_enable-simd.wast
index b1cd1f050..a973230a5 100644
--- a/test/passes/safe-heap_enable-threads_enable-simd.wast
+++ b/test/passes/safe-heap_enable-threads_enable-simd.wast
@@ -1,5 +1,5 @@
(module
- (memory (shared 100 100))
+ (memory 100 100 shared)
(func $loads
(drop (i32.load (i32.const 1)))
(drop (i32.atomic.load (i32.const 1)))
@@ -47,7 +47,7 @@
(type $FUNCSIG$v (func))
(import "env" "segfault" (func $segfault))
(import "env" "alignfault" (func $alignfault))
- (memory $0 (shared 100 100))
+ (memory $0 100 100 shared)
(func $actions
(drop (i32.load (i32.const 1)))
(i32.store (i32.const 1) (i32.const 100))
diff --git a/test/passes/safe-heap_enable-threads_enable-simd64.txt b/test/passes/safe-heap_enable-threads_enable-simd64.txt
index 0e282f0ce..49319377e 100644
--- a/test/passes/safe-heap_enable-threads_enable-simd64.txt
+++ b/test/passes/safe-heap_enable-threads_enable-simd64.txt
@@ -14,7 +14,7 @@
(import "env" "emscripten_get_sbrk_ptr" (func $emscripten_get_sbrk_ptr (result i64)))
(import "env" "segfault" (func $segfault))
(import "env" "alignfault" (func $alignfault))
- (memory $0 (shared i64 100 100))
+ (memory $0 i64 100 100 shared)
(func $loads
(drop
(call $SAFE_HEAP_LOAD_i32_4_4
@@ -5627,7 +5627,7 @@
(import "env" "emscripten_get_sbrk_ptr" (func $foo (result i64)))
(import "env" "segfault" (func $segfault))
(import "env" "alignfault" (func $alignfault))
- (memory $0 (shared i64 100 100))
+ (memory $0 i64 100 100 shared)
(func $actions
(drop
(call $SAFE_HEAP_LOAD_i32_4_4
diff --git a/test/passes/safe-heap_enable-threads_enable-simd64.wast b/test/passes/safe-heap_enable-threads_enable-simd64.wast
index d34c5772b..dc70a037b 100644
--- a/test/passes/safe-heap_enable-threads_enable-simd64.wast
+++ b/test/passes/safe-heap_enable-threads_enable-simd64.wast
@@ -1,5 +1,5 @@
(module
- (memory (shared i64 100 100))
+ (memory i64 100 100 shared)
(func $loads
(drop (i32.load (i64.const 1)))
(drop (i32.atomic.load (i64.const 1)))
@@ -48,7 +48,7 @@
(import "env" "emscripten_get_sbrk_ptr" (func $foo (result i64)))
(import "env" "segfault" (func $segfault))
(import "env" "alignfault" (func $alignfault))
- (memory $0 (shared i64 100 100))
+ (memory $0 i64 100 100 shared)
(func $actions
(drop (i32.load (i64.const 1)))
(i32.store (i64.const 1) (i32.const 100))
diff --git a/test/passes/safe-heap_low-memory-unused_enable-threads_enable-simd.txt b/test/passes/safe-heap_low-memory-unused_enable-threads_enable-simd.txt
index 26c459536..53b048331 100644
--- a/test/passes/safe-heap_low-memory-unused_enable-threads_enable-simd.txt
+++ b/test/passes/safe-heap_low-memory-unused_enable-threads_enable-simd.txt
@@ -14,7 +14,7 @@
(import "env" "emscripten_get_sbrk_ptr" (func $emscripten_get_sbrk_ptr (result i32)))
(import "env" "segfault" (func $segfault))
(import "env" "alignfault" (func $alignfault))
- (memory $0 (shared 100 100))
+ (memory $0 100 100 shared)
(func $loads
(drop
(call $SAFE_HEAP_LOAD_i32_4_4
@@ -5441,7 +5441,7 @@
(import "env" "emscripten_get_sbrk_ptr" (func $foo (result i32)))
(import "env" "segfault" (func $segfault))
(import "env" "alignfault" (func $alignfault))
- (memory $0 (shared 100 100))
+ (memory $0 100 100 shared)
(func $actions
(drop
(call $SAFE_HEAP_LOAD_i32_4_4
diff --git a/test/passes/safe-heap_low-memory-unused_enable-threads_enable-simd.wast b/test/passes/safe-heap_low-memory-unused_enable-threads_enable-simd.wast
index bad9fb8d4..6b0adf3e3 100644
--- a/test/passes/safe-heap_low-memory-unused_enable-threads_enable-simd.wast
+++ b/test/passes/safe-heap_low-memory-unused_enable-threads_enable-simd.wast
@@ -1,5 +1,5 @@
(module
- (memory (shared 100 100))
+ (memory 100 100 shared)
(func $loads
(drop (i32.load (i32.const 1)))
(drop (i32.atomic.load (i32.const 1)))
@@ -48,7 +48,7 @@
(import "env" "emscripten_get_sbrk_ptr" (func $foo (result i32)))
(import "env" "segfault" (func $segfault))
(import "env" "alignfault" (func $alignfault))
- (memory $0 (shared 100 100))
+ (memory $0 100 100 shared)
(func $actions
(drop (i32.load (i32.const 1)))
(i32.store (i32.const 1) (i32.const 100))
diff --git a/test/passes/simplify-locals_all-features.txt b/test/passes/simplify-locals_all-features.txt
index 5e5478ddf..4225a7033 100644
--- a/test/passes/simplify-locals_all-features.txt
+++ b/test/passes/simplify-locals_all-features.txt
@@ -1136,7 +1136,7 @@
(import "fuzzing-support" "log2" (func $fimport$1 (type $4) (param i32)))
(import "fuzzing-support" "log3" (func $fimport$2 (type $5) (param f32)))
(global $global$0 (mut i32) (i32.const 10))
- (memory $0 (shared 256 256))
+ (memory $0 256 256 shared)
(func $nonatomics (type $FUNCSIG$i) (result i32)
(local $x i32)
(nop)
@@ -1884,7 +1884,7 @@
)
(module
(type $0 (func (result i32)))
- (memory $0 (shared 1 1))
+ (memory $0 1 1 shared)
(data $0 "data")
(export "foo" (func $foo))
(func $foo (type $0) (result i32)
diff --git a/test/passes/simplify-locals_all-features.wast b/test/passes/simplify-locals_all-features.wast
index a2868b45d..f46f9fd71 100644
--- a/test/passes/simplify-locals_all-features.wast
+++ b/test/passes/simplify-locals_all-features.wast
@@ -1087,7 +1087,7 @@
)
)
(module
- (memory (shared 256 256))
+ (memory 256 256 shared)
(type $FUNCSIG$v (func))
(type $FUNCSIG$i (func (result i32)))
(type $FUNCSIG$iiiii (func (param i32 i32 i32 i32) (result i32)))
@@ -1673,7 +1673,7 @@
)
;; data.drop has global side effects
(module
- (memory $0 (shared 1 1))
+ (memory $0 1 1 shared)
(data "data")
(func $foo (export "foo") (result i32)
(local $0 i32)
diff --git a/test/passes/simplify-locals_all-features_disable-exception-handling.txt b/test/passes/simplify-locals_all-features_disable-exception-handling.txt
index 6e5e38716..6ee89372d 100644
--- a/test/passes/simplify-locals_all-features_disable-exception-handling.txt
+++ b/test/passes/simplify-locals_all-features_disable-exception-handling.txt
@@ -1130,7 +1130,7 @@
(import "fuzzing-support" "log2" (func $fimport$1 (type $4) (param i32)))
(import "fuzzing-support" "log3" (func $fimport$2 (type $5) (param f32)))
(global $global$0 (mut i32) (i32.const 10))
- (memory $0 (shared 256 256))
+ (memory $0 256 256 shared)
(func $nonatomics (type $FUNCSIG$i) (result i32)
(local $x i32)
(nop)
diff --git a/test/passes/simplify-locals_all-features_disable-exception-handling.wast b/test/passes/simplify-locals_all-features_disable-exception-handling.wast
index 25b452511..1f308723a 100644
--- a/test/passes/simplify-locals_all-features_disable-exception-handling.wast
+++ b/test/passes/simplify-locals_all-features_disable-exception-handling.wast
@@ -1087,7 +1087,7 @@
)
)
(module
- (memory (shared 256 256))
+ (memory 256 256 shared)
(type $FUNCSIG$v (func))
(type $FUNCSIG$i (func (result i32)))
(type $FUNCSIG$iiiii (func (param i32 i32 i32 i32) (result i32)))
diff --git a/test/passes/ssa_fuzz-exec_enable-threads.txt b/test/passes/ssa_fuzz-exec_enable-threads.txt
index 6334b35a7..f9d49d5bb 100644
--- a/test/passes/ssa_fuzz-exec_enable-threads.txt
+++ b/test/passes/ssa_fuzz-exec_enable-threads.txt
@@ -2,7 +2,7 @@
[fuzz-exec] note result: func_0 => 16384
(module
(type $0 (func (result i32)))
- (memory $0 (shared 1 1))
+ (memory $0 1 1 shared)
(table $0 0 0 funcref)
(export "func_0" (func $0))
(func $0 (result i32)
diff --git a/test/passes/ssa_fuzz-exec_enable-threads.wast b/test/passes/ssa_fuzz-exec_enable-threads.wast
index 1ad1e2a6f..5917a3eb3 100644
--- a/test/passes/ssa_fuzz-exec_enable-threads.wast
+++ b/test/passes/ssa_fuzz-exec_enable-threads.wast
@@ -2,7 +2,7 @@
(type $0 (func (result i32)))
(type $1 (func))
(table 0 0 funcref)
- (memory $0 (shared 1 1))
+ (memory $0 1 1 shared)
(export "func_0" (func $0))
(func $0 (; 0 ;) (type $0) (result i32)
(local $var$0 i32)
@@ -109,4 +109,3 @@
)
)
)
-
diff --git a/test/print/memory-import-shared.minified.txt b/test/print/memory-import-shared.minified.txt
index 8691f813c..75cbecb8b 100644
--- a/test/print/memory-import-shared.minified.txt
+++ b/test/print/memory-import-shared.minified.txt
@@ -1 +1 @@
-(module(import "env" "memory" (memory $0 (shared 256 256)))) \ No newline at end of file
+(module(import "env" "memory" (memory $0 256 256 shared))) \ No newline at end of file
diff --git a/test/print/memory-import-shared.txt b/test/print/memory-import-shared.txt
index ba5a0463c..30374cff0 100644
--- a/test/print/memory-import-shared.txt
+++ b/test/print/memory-import-shared.txt
@@ -1,3 +1,3 @@
(module
- (import "env" "memory" (memory $0 (shared 256 256)))
+ (import "env" "memory" (memory $0 256 256 shared))
)
diff --git a/test/print/memory-import-shared.wast b/test/print/memory-import-shared.wast
index ba5a0463c..30374cff0 100644
--- a/test/print/memory-import-shared.wast
+++ b/test/print/memory-import-shared.wast
@@ -1,3 +1,3 @@
(module
- (import "env" "memory" (memory $0 (shared 256 256)))
+ (import "env" "memory" (memory $0 256 256 shared))
)
diff --git a/test/print/memory-shared.minified.txt b/test/print/memory-shared.minified.txt
index c6aeccdcd..3f07a0080 100644
--- a/test/print/memory-shared.minified.txt
+++ b/test/print/memory-shared.minified.txt
@@ -1,2 +1,2 @@
-(module(memory $0 (shared 23 256))
+(module(memory $0 23 256 shared)
) \ No newline at end of file
diff --git a/test/print/memory-shared.txt b/test/print/memory-shared.txt
index ee02979b1..daff79f22 100644
--- a/test/print/memory-shared.txt
+++ b/test/print/memory-shared.txt
@@ -1,3 +1,3 @@
(module
- (memory $0 (shared 23 256))
+ (memory $0 23 256 shared)
)
diff --git a/test/print/memory-shared.wast b/test/print/memory-shared.wast
index ee02979b1..daff79f22 100644
--- a/test/print/memory-shared.wast
+++ b/test/print/memory-shared.wast
@@ -1,3 +1,3 @@
(module
- (memory $0 (shared 23 256))
+ (memory $0 23 256 shared)
)
diff --git a/test/spec/atomics.wast b/test/spec/atomics.wast
index 4e6dd3563..4ff91ddaf 100644
--- a/test/spec/atomics.wast
+++ b/test/spec/atomics.wast
@@ -1,5 +1,5 @@
(module
- (memory $0 (shared 23 256))
+ (memory $0 23 256 shared)
(func (export "atomic-fence")
(atomic.fence)
)
diff --git a/test/wasm2js/atomic_fence.wast b/test/wasm2js/atomic_fence.wast
index 2e605b690..cb1837dc4 100644
--- a/test/wasm2js/atomic_fence.wast
+++ b/test/wasm2js/atomic_fence.wast
@@ -1,5 +1,5 @@
(module
- (memory $0 (shared 23 256))
+ (memory $0 23 256 shared)
(func (export "atomic-fence")
(atomic.fence)
)
diff --git a/test/wasm2js/atomics_32.wast b/test/wasm2js/atomics_32.wast
index eeec93376..e366b7f4e 100644
--- a/test/wasm2js/atomics_32.wast
+++ b/test/wasm2js/atomics_32.wast
@@ -1,5 +1,5 @@
(module
- (memory (shared 256 256))
+ (memory 256 256 shared)
(data "hello,")
(data "world!")
(func $test (export "test")