summaryrefslogtreecommitdiff
path: root/test/spec
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2023-01-10 15:05:56 -0600
committerGitHub <noreply@github.com>2023-01-10 13:05:56 -0800
commit31171ca083c7a4d1394ad7812369d385e1dd38a0 (patch)
tree51d6691faf64fdd266ca31acb5b66295a53d9cc5 /test/spec
parent36e2abbcdd22b2b1707757b49fb4ac8844f28e5d (diff)
downloadbinaryen-31171ca083c7a4d1394ad7812369d385e1dd38a0.tar.gz
binaryen-31171ca083c7a4d1394ad7812369d385e1dd38a0.tar.bz2
binaryen-31171ca083c7a4d1394ad7812369d385e1dd38a0.zip
[Wasm GC] Replace `HeapType::data` with `HeapType::struct_` (#5416)
`struct` has replaced `data` in the upstream spec, so update Binaryen's types to match. We had already supported `struct` as an alias for data, but now remove support for `data` entirely. Also remove instructions like `ref.is_data` that are deprecated and do not make sense without a `data` type.
Diffstat (limited to 'test/spec')
-rw-r--r--test/spec/array.wast4
-rw-r--r--test/spec/ref_cast.wast24
-rw-r--r--test/spec/ref_eq.wast2
-rw-r--r--test/spec/ref_test.wast2
4 files changed, 16 insertions, 16 deletions
diff --git a/test/spec/array.wast b/test/spec/array.wast
index c30365030..6e7b8cddb 100644
--- a/test/spec/array.wast
+++ b/test/spec/array.wast
@@ -8,7 +8,7 @@
(type (array f32))
(type (array f64))
(type (array anyref))
- (type (array (ref data)))
+ (type (array (ref struct)))
(type (array (ref 0)))
(type (array (ref null 1)))
(type (array (mut i8)))
@@ -18,7 +18,7 @@
(type (array (mut i32)))
(type (array (mut i64)))
(type (array (mut anyref)))
- (type (array (mut (ref data))))
+ (type (array (mut (ref struct))))
(type (array (mut (ref 0))))
(type (array (mut (ref null i31))))
)
diff --git a/test/spec/ref_cast.wast b/test/spec/ref_cast.wast
index b81671e30..f1cfbe24b 100644
--- a/test/spec/ref_cast.wast
+++ b/test/spec/ref_cast.wast
@@ -6,14 +6,14 @@
(type $t2' (struct_subtype (field i32) (field i32) $t2))
(type $t3 (struct_subtype (field i32) (field i32) $t2))
- (global $tab.0 (mut (ref null data)) (ref.null data))
- (global $tab.1 (mut (ref null data)) (ref.null data))
- (global $tab.2 (mut (ref null data)) (ref.null data))
- (global $tab.3 (mut (ref null data)) (ref.null data))
- (global $tab.4 (mut (ref null data)) (ref.null data))
- (global $tab.10 (mut (ref null data)) (ref.null data))
- (global $tab.11 (mut (ref null data)) (ref.null data))
- (global $tab.12 (mut (ref null data)) (ref.null data))
+ (global $tab.0 (mut (ref null struct)) (ref.null struct))
+ (global $tab.1 (mut (ref null struct)) (ref.null struct))
+ (global $tab.2 (mut (ref null struct)) (ref.null struct))
+ (global $tab.3 (mut (ref null struct)) (ref.null struct))
+ (global $tab.4 (mut (ref null struct)) (ref.null struct))
+ (global $tab.10 (mut (ref null struct)) (ref.null struct))
+ (global $tab.11 (mut (ref null struct)) (ref.null struct))
+ (global $tab.12 (mut (ref null struct)) (ref.null struct))
(func $init
(global.set $tab.0 (struct.new_default $t0))
@@ -29,7 +29,7 @@
(func (export "test-sub")
(call $init)
- (drop (ref.cast null $t0 (ref.null data)))
+ (drop (ref.cast null $t0 (ref.null struct)))
(drop (ref.cast null $t0 (struct.new_default $t0)))
(drop (ref.cast null $t0 (global.get $tab.0)))
(drop (ref.cast null $t0 (global.get $tab.1)))
@@ -42,19 +42,19 @@
(drop (ref.cast $t0 (global.get $tab.3)))
(drop (ref.cast $t0 (global.get $tab.4)))
- (drop (ref.cast null $t1 (ref.null data)))
+ (drop (ref.cast null $t1 (ref.null struct)))
(drop (ref.cast null $t1 (struct.new_default $t1)))
(drop (ref.cast null $t1 (global.get $tab.1)))
(drop (ref.cast null $t1 (global.get $tab.2)))
(drop (ref.cast $t1 (global.get $tab.1)))
(drop (ref.cast $t1 (global.get $tab.2)))
- (drop (ref.cast null $t2 (ref.null data)))
+ (drop (ref.cast null $t2 (ref.null struct)))
(drop (ref.cast null $t2 (struct.new_default $t2)))
(drop (ref.cast null $t2 (global.get $tab.2)))
(drop (ref.cast $t2 (global.get $tab.2)))
- (drop (ref.cast null $t3 (ref.null data)))
+ (drop (ref.cast null $t3 (ref.null struct)))
(drop (ref.cast null $t3 (struct.new_default $t3)))
(drop (ref.cast null $t3 (global.get $tab.3)))
(drop (ref.cast $t3 (global.get $tab.3)))
diff --git a/test/spec/ref_eq.wast b/test/spec/ref_eq.wast
index f170bcc06..a5224834c 100644
--- a/test/spec/ref_eq.wast
+++ b/test/spec/ref_eq.wast
@@ -8,4 +8,4 @@
)
;; All nulls compare equal, regardless of their type.
-(assert_return (invoke "compare" (ref.null data) (ref.null eq)) (i32.const 1))
+(assert_return (invoke "compare" (ref.null none) (ref.null eq)) (i32.const 1))
diff --git a/test/spec/ref_test.wast b/test/spec/ref_test.wast
index bb6479548..b0bb1df3d 100644
--- a/test/spec/ref_test.wast
+++ b/test/spec/ref_test.wast
@@ -141,7 +141,7 @@
(assert_return (invoke "ref_test_struct" (i32.const 2)) (i32.const 1))
(assert_return (invoke "ref_test_struct" (i32.const 3)) (i32.const 0))
(assert_return (invoke "ref_test_struct" (i32.const 4)) (i32.const 2))
-(assert_return (invoke "ref_test_struct" (i32.const 5)) (i32.const 2)) ;; TOOD: expect 0 once struct is not an alias for data
+(assert_return (invoke "ref_test_struct" (i32.const 5)) (i32.const 0))
;; (assert_return (invoke "ref_test_struct" (i32.const 6)) (i32.const 0))
;; (assert_return (invoke "ref_test_struct" (i32.const 7)) (i32.const 1))