diff options
author | Thomas Lively <tlively@google.com> | 2024-06-25 12:39:05 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-25 12:39:05 -0700 |
commit | 654ee6e2504f11fb0e982a2cf276bafa750f694b (patch) | |
tree | e955f95d009f2df626e3d2ff07154ec56d5d6265 /test/spec/shared-struct.wast | |
parent | 4cd8b61c5d4817f753a54ef9f501db66969e310f (diff) | |
download | binaryen-654ee6e2504f11fb0e982a2cf276bafa750f694b.tar.gz binaryen-654ee6e2504f11fb0e982a2cf276bafa750f694b.tar.bz2 binaryen-654ee6e2504f11fb0e982a2cf276bafa750f694b.zip |
[threads] Validate shared-polymorphic instructions (#6702)
Such as `ref.eq`, `i31.get_{s,u}`, and `array.len`. Also validate that
struct and array operations work on shared structs and arrays.
Diffstat (limited to 'test/spec/shared-struct.wast')
-rw-r--r-- | test/spec/shared-struct.wast | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/spec/shared-struct.wast b/test/spec/shared-struct.wast index b2c82caff..28139bb28 100644 --- a/test/spec/shared-struct.wast +++ b/test/spec/shared-struct.wast @@ -67,3 +67,26 @@ (module (type (struct (ref null (shared any)))) ) + +;; Struct instructions work on shared structs. +(module + (type $i8 (shared (struct (mut i8)))) + (type $i32 (shared (struct (mut i32)))) + (type $unshared (struct (mut i8))) + + (func (struct.new $i8 (i32.const 0)) (drop)) + + (func (struct.new_default $i8) (drop)) + + (func (param (ref null $i8)) + (struct.get_s $i8 0 (local.get 0)) (drop)) + + (func (param (ref null $i8)) + (struct.get_u $i8 0 (local.get 0)) (drop)) + + (func (param (ref null $i32)) + (struct.get $i32 0 (local.get 0)) (drop)) + + (func (param (ref null $i8)) + (struct.set $i8 0 (local.get 0) (i32.const 0))) +) |