Skip to content

Commit

Permalink
tests: add atomics_notify.wast
Browse files Browse the repository at this point in the history
checking that notify with 0 waiters returns 0 on shared and non-shared
memory.

Signed-off-by: Harald Hoyer <harald@profian.com>
  • Loading branch information
haraldh committed Nov 18, 2022
1 parent 93cc245 commit 8c0b176
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/misc_testsuite/threads/atomics_notify.wast
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
;; From https://github.com/bytecodealliance/wasmtime/pull/5255
;;

(module
(memory 1 1)
(func (export "notify") (result i32) (memory.atomic.notify (i32.const 0) (i32.const -1)))
)

;; notify returns 0 on unshared memories
(assert_return (invoke "notify") (i32.const 0))

(module
(memory 1 1 shared)
(func (export "notify_shared") (result i32) (memory.atomic.notify (i32.const 0) (i32.const -1)))
)

;; notify returns 0 with 0 waiters
(assert_return (invoke "notify_shared") (i32.const 0))

0 comments on commit 8c0b176

Please sign in to comment.