summaryrefslogtreecommitdiff
path: root/test/lit/passes
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2023-03-29 17:10:08 -0700
committerGitHub <noreply@github.com>2023-03-29 17:10:08 -0700
commitdba0a08963d0452a773b9abbdd789503945c5f43 (patch)
tree79b819b0ac00e0cbf248cd2100a2763dd7f72acb /test/lit/passes
parent122f7b578c6c3887924d820b714bbd2d2c921390 (diff)
downloadbinaryen-dba0a08963d0452a773b9abbdd789503945c5f43.tar.gz
binaryen-dba0a08963d0452a773b9abbdd789503945c5f43.tar.bz2
binaryen-dba0a08963d0452a773b9abbdd789503945c5f43.zip
Do not treat `atomic.fence` as using a memory (#5603)
* Do not treat `atomic.fence` as using a memory Update RemoveUnusedModuleElements so that it no longer keeps the memory alive due to an `atomic.fence` instruction and update validation to allow modules to use `atomic.fence` without a memory. * update wasm2js tests
Diffstat (limited to 'test/lit/passes')
-rw-r--r--test/lit/passes/remove-unused-module-elements_all-features.wast13
1 files changed, 13 insertions, 0 deletions
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 d441406f9..2e784e52b 100644
--- a/test/lit/passes/remove-unused-module-elements_all-features.wast
+++ b/test/lit/passes/remove-unused-module-elements_all-features.wast
@@ -351,6 +351,19 @@
(memory.atomic.notify (i32.const 0) (i32.const 0))
)
)
+(module ;; atomic.fence does not use a memory, so should not keep the memory alive.
+ (memory $0 (shared 1 1))
+ ;; CHECK: (type $none_=>_none (func))
+
+ ;; CHECK: (export "fake-user" (func $user))
+ (export "fake-user" $user)
+ ;; CHECK: (func $user (type $none_=>_none)
+ ;; CHECK-NEXT: (atomic.fence)
+ ;; CHECK-NEXT: )
+ (func $user
+ (atomic.fence)
+ )
+)
(module ;; more use checks
;; CHECK: (type $none_=>_i32 (func (result i32)))