diff options
author | Thomas Lively <tlively@google.com> | 2024-01-03 14:59:38 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-03 14:59:38 -0800 |
commit | 0ed42cf976ce9a3dfbe9cbb0885122e8fb6a377b (patch) | |
tree | b7969243a22e1878f37a8d02336ac81fd5fb7e33 /test/example | |
parent | 1878403ec9c4382ab51ca72257f4d97a23a1fc0d (diff) | |
download | binaryen-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/example')
-rw-r--r-- | test/example/c-api-kitchen-sink.txt | 2 | ||||
-rw-r--r-- | test/example/module-splitting.cpp | 6 | ||||
-rw-r--r-- | test/example/module-splitting.txt | 18 |
3 files changed, 13 insertions, 13 deletions
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))) |