Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/wasm-interpreter.h
Original file line number Diff line number Diff line change
Expand Up @@ -3381,9 +3381,15 @@ class ModuleRunnerBase : public ExpressionRunner<SubType> {
if (loaded != expected.getSingleValue()) {
return Literal(int32_t(1)); // not equal
}
// TODO: add threads support!
// for now, just assume we are woken up
return Literal(int32_t(0)); // woken up
// TODO: Add threads support. For now, report a host limit here, as there
// are no other threads that can wake us up. Without such threads,
// we'd hang if there is no timeout, and even if there is a timeout
// then we can hang for a long time if it is in a loop. The only
// timeout value we allow here for now is 0.
if (timeout.getSingleValue().getInteger() != 0) {
hostLimit("threads support");
}
return Literal(int32_t(0)); // equal
}
Flow visitAtomicNotify(AtomicNotify* curr) {
NOTE_ENTER("AtomicNotify");
Expand Down
21 changes: 21 additions & 0 deletions test/lit/exec/atomic.wast
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
;; NOTE: Assertions have been generated by update_lit_checks.py --output=fuzz-exec and should not be edited.

;; RUN: wasm-opt %s -all --fuzz-exec-before -q -o /dev/null 2>&1 | filecheck %s

(module
(import "fuzzing-support" "log-i32" (func $log (param i32)))

(memory $0 23 256 shared)

;; CHECK: [fuzz-exec] calling wait_and_log
;; CHECK-NEXT: [LoggingExternalInterface logging 0]
(func $wait_and_log (export "wait_and_log")
(call $log
(memory.atomic.wait64
(i32.const 0)
(i64.const 0)
(i64.const 0)
)
)
)
)