summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2020-01-03 20:12:06 -0800
committerGitHub <noreply@github.com>2020-01-03 20:12:06 -0800
commit240e1e3ed3eb328f574ce26ddb24819796a5e6e3 (patch)
tree3b4cc0d66b8d2ddec97d2340adedb26cf26f0e53 /test
parent2343e9fea395455954adde1b70f8bd2efcc48d4a (diff)
downloadbinaryen-240e1e3ed3eb328f574ce26ddb24819796a5e6e3.tar.gz
binaryen-240e1e3ed3eb328f574ce26ddb24819796a5e6e3.tar.bz2
binaryen-240e1e3ed3eb328f574ce26ddb24819796a5e6e3.zip
Parse memarg in atomic.wait and atomic.notify (#2569)
- Allow `atomic.notify` and `atomic.wait` instructions to parse memory arguments (`align` and `offset`) and print the offset in these instruction when writing binary, rather than assuming it to be 0 - Change arguments of `parseMemAttributes` to be references
Diffstat (limited to 'test')
-rw-r--r--test/atomics.wast20
-rw-r--r--test/atomics.wast.from-wast20
-rw-r--r--test/atomics.wast.fromBinary20
-rw-r--r--test/atomics.wast.fromBinary.noDebugInfo20
4 files changed, 80 insertions, 0 deletions
diff --git a/test/atomics.wast b/test/atomics.wast
index 8ba9906c5..9cce84ccd 100644
--- a/test/atomics.wast
+++ b/test/atomics.wast
@@ -145,18 +145,38 @@
)
)
(drop
+ (i32.atomic.wait offset=4 align=4
+ (local.get $0)
+ (local.get $0)
+ (local.get $1)
+ )
+ )
+ (drop
(atomic.notify
(local.get $0)
(local.get $0)
)
)
(drop
+ (atomic.notify offset=24 align=4
+ (local.get $0)
+ (local.get $0)
+ )
+ )
+ (drop
(i64.atomic.wait
(local.get $0)
(local.get $1)
(local.get $1)
)
)
+ (drop
+ (i64.atomic.wait align=8 offset=16
+ (local.get $0)
+ (local.get $1)
+ (local.get $1)
+ )
+ )
)
(func $atomic-fence (type $0)
(atomic.fence)
diff --git a/test/atomics.wast.from-wast b/test/atomics.wast.from-wast
index 6e59febc5..b55cf9c4d 100644
--- a/test/atomics.wast.from-wast
+++ b/test/atomics.wast.from-wast
@@ -145,18 +145,38 @@
)
)
(drop
+ (i32.atomic.wait offset=4
+ (local.get $0)
+ (local.get $0)
+ (local.get $1)
+ )
+ )
+ (drop
(atomic.notify
(local.get $0)
(local.get $0)
)
)
(drop
+ (atomic.notify offset=24
+ (local.get $0)
+ (local.get $0)
+ )
+ )
+ (drop
(i64.atomic.wait
(local.get $0)
(local.get $1)
(local.get $1)
)
)
+ (drop
+ (i64.atomic.wait offset=16
+ (local.get $0)
+ (local.get $1)
+ (local.get $1)
+ )
+ )
)
(func $atomic-fence (; 4 ;)
(atomic.fence)
diff --git a/test/atomics.wast.fromBinary b/test/atomics.wast.fromBinary
index a8c6b65b8..c2f9c5c45 100644
--- a/test/atomics.wast.fromBinary
+++ b/test/atomics.wast.fromBinary
@@ -145,18 +145,38 @@
)
)
(drop
+ (i32.atomic.wait offset=4
+ (local.get $0)
+ (local.get $0)
+ (local.get $1)
+ )
+ )
+ (drop
(atomic.notify
(local.get $0)
(local.get $0)
)
)
(drop
+ (atomic.notify offset=24
+ (local.get $0)
+ (local.get $0)
+ )
+ )
+ (drop
(i64.atomic.wait
(local.get $0)
(local.get $1)
(local.get $1)
)
)
+ (drop
+ (i64.atomic.wait offset=16
+ (local.get $0)
+ (local.get $1)
+ (local.get $1)
+ )
+ )
)
(func $atomic-fence (; 4 ;)
(atomic.fence)
diff --git a/test/atomics.wast.fromBinary.noDebugInfo b/test/atomics.wast.fromBinary.noDebugInfo
index b5b91729d..8945ef403 100644
--- a/test/atomics.wast.fromBinary.noDebugInfo
+++ b/test/atomics.wast.fromBinary.noDebugInfo
@@ -145,18 +145,38 @@
)
)
(drop
+ (i32.atomic.wait offset=4
+ (local.get $0)
+ (local.get $0)
+ (local.get $1)
+ )
+ )
+ (drop
(atomic.notify
(local.get $0)
(local.get $0)
)
)
(drop
+ (atomic.notify offset=24
+ (local.get $0)
+ (local.get $0)
+ )
+ )
+ (drop
(i64.atomic.wait
(local.get $0)
(local.get $1)
(local.get $1)
)
)
+ (drop
+ (i64.atomic.wait offset=16
+ (local.get $0)
+ (local.get $1)
+ (local.get $1)
+ )
+ )
)
(func $4 (; 4 ;)
(atomic.fence)