summaryrefslogtreecommitdiff
path: root/test/spec/ref_test.wast
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2023-03-16 11:35:51 -0500
committerGitHub <noreply@github.com>2023-03-16 09:35:51 -0700
commit9a744b2b373eabbe3b64deaa6cddc09cde5e8fca (patch)
tree00d9c4679d20d9fd50a63175daa40ee8df0c2aa2 /test/spec/ref_test.wast
parentffe4152320b4d72fbfc9c350abda922067ebec01 (diff)
downloadbinaryen-9a744b2b373eabbe3b64deaa6cddc09cde5e8fca.tar.gz
binaryen-9a744b2b373eabbe3b64deaa6cddc09cde5e8fca.tar.bz2
binaryen-9a744b2b373eabbe3b64deaa6cddc09cde5e8fca.zip
Support interpretation of extern.externalize and extern.internalize (#5576)
To allow the external and internal reference values to be differentiated yet round-trippable, set the `Literal` type to externref on external references, but keep the gcData the same for both. The only exception is for i31 references, for which the externalized version gets a `gcData` that contains a copy of the original i31 literal.
Diffstat (limited to 'test/spec/ref_test.wast')
-rw-r--r--test/spec/ref_test.wast52
1 files changed, 26 insertions, 26 deletions
diff --git a/test/spec/ref_test.wast b/test/spec/ref_test.wast
index b0bb1df3d..b5291e179 100644
--- a/test/spec/ref_test.wast
+++ b/test/spec/ref_test.wast
@@ -19,8 +19,8 @@
(table.set $ta (i32.const 3) (i31.new (i32.const 7)))
(table.set $ta (i32.const 4) (struct.new_default $st))
(table.set $ta (i32.const 5) (array.new_default $at (i32.const 0)))
- ;; (table.set $ta (i32.const 6) (extern.internalize (extern.externalize (i31.new (i32.const 0)))))
- ;; (table.set $ta (i32.const 7) (extern.internalize (ref.null extern)))
+ (table.set $ta (i32.const 6) (extern.internalize (extern.externalize (i31.new (i32.const 0)))))
+ (table.set $ta (i32.const 7) (extern.internalize (ref.null extern)))
(table.set $tf (i32.const 0) (ref.null nofunc))
(table.set $tf (i32.const 1) (ref.null func))
@@ -28,10 +28,10 @@
(table.set $te (i32.const 0) (ref.null noextern))
(table.set $te (i32.const 1) (ref.null extern))
- ;; (table.set $te (i32.const 2) (extern.externalize (i31.new (i32.const 0))))
- ;; (table.set $te (i32.const 3) (extern.externalize (i31.new (i32.const 8))))
- ;; (table.set $te (i32.const 4) (extern.externalize (struct.new_default $st)))
- ;; (table.set $te (i32.const 5) (extern.externalize (ref.null any)))
+ (table.set $te (i32.const 2) (extern.externalize (i31.new (i32.const 0))))
+ (table.set $te (i32.const 3) (extern.externalize (i31.new (i32.const 8))))
+ (table.set $te (i32.const 4) (extern.externalize (struct.new_default $st)))
+ (table.set $te (i32.const 5) (extern.externalize (ref.null any)))
)
(func (export "ref_test_null_data") (param $i i32) (result i32)
@@ -106,8 +106,8 @@
(assert_return (invoke "ref_test_null_data" (i32.const 3)) (i32.const 0))
(assert_return (invoke "ref_test_null_data" (i32.const 4)) (i32.const 0))
(assert_return (invoke "ref_test_null_data" (i32.const 5)) (i32.const 0))
-;; (assert_return (invoke "ref_test_null_data" (i32.const 6)) (i32.const 0))
-;; (assert_return (invoke "ref_test_null_data" (i32.const 7)) (i32.const 2))
+(assert_return (invoke "ref_test_null_data" (i32.const 6)) (i32.const 0))
+(assert_return (invoke "ref_test_null_data" (i32.const 7)) (i32.const 2))
(assert_return (invoke "ref_test_any" (i32.const 0)) (i32.const 1))
(assert_return (invoke "ref_test_any" (i32.const 1)) (i32.const 1))
@@ -115,8 +115,8 @@
(assert_return (invoke "ref_test_any" (i32.const 3)) (i32.const 2))
(assert_return (invoke "ref_test_any" (i32.const 4)) (i32.const 2))
(assert_return (invoke "ref_test_any" (i32.const 5)) (i32.const 2))
-;; (assert_return (invoke "ref_test_any" (i32.const 6)) (i32.const 2))
-;; (assert_return (invoke "ref_test_any" (i32.const 7)) (i32.const 1))
+(assert_return (invoke "ref_test_any" (i32.const 6)) (i32.const 2))
+(assert_return (invoke "ref_test_any" (i32.const 7)) (i32.const 1))
(assert_return (invoke "ref_test_eq" (i32.const 0)) (i32.const 1))
(assert_return (invoke "ref_test_eq" (i32.const 1)) (i32.const 1))
@@ -124,8 +124,8 @@
(assert_return (invoke "ref_test_eq" (i32.const 3)) (i32.const 2))
(assert_return (invoke "ref_test_eq" (i32.const 4)) (i32.const 2))
(assert_return (invoke "ref_test_eq" (i32.const 5)) (i32.const 2))
-;; (assert_return (invoke "ref_test_eq" (i32.const 6)) (i32.const 0))
-;; (assert_return (invoke "ref_test_eq" (i32.const 7)) (i32.const 1))
+(assert_return (invoke "ref_test_eq" (i32.const 6)) (i32.const 2))
+(assert_return (invoke "ref_test_eq" (i32.const 7)) (i32.const 1))
(assert_return (invoke "ref_test_i31" (i32.const 0)) (i32.const 1))
(assert_return (invoke "ref_test_i31" (i32.const 1)) (i32.const 1))
@@ -133,8 +133,8 @@
(assert_return (invoke "ref_test_i31" (i32.const 3)) (i32.const 2))
(assert_return (invoke "ref_test_i31" (i32.const 4)) (i32.const 0))
(assert_return (invoke "ref_test_i31" (i32.const 5)) (i32.const 0))
-;; (assert_return (invoke "ref_test_i31" (i32.const 6)) (i32.const 0))
-;; (assert_return (invoke "ref_test_i31" (i32.const 7)) (i32.const 1))
+(assert_return (invoke "ref_test_i31" (i32.const 6)) (i32.const 2))
+(assert_return (invoke "ref_test_i31" (i32.const 7)) (i32.const 1))
(assert_return (invoke "ref_test_struct" (i32.const 0)) (i32.const 1))
(assert_return (invoke "ref_test_struct" (i32.const 1)) (i32.const 1))
@@ -142,8 +142,8 @@
(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 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))
+(assert_return (invoke "ref_test_struct" (i32.const 6)) (i32.const 0))
+(assert_return (invoke "ref_test_struct" (i32.const 7)) (i32.const 1))
(assert_return (invoke "ref_test_array" (i32.const 0)) (i32.const 1))
(assert_return (invoke "ref_test_array" (i32.const 1)) (i32.const 1))
@@ -151,8 +151,8 @@
(assert_return (invoke "ref_test_array" (i32.const 3)) (i32.const 0))
(assert_return (invoke "ref_test_array" (i32.const 4)) (i32.const 0))
(assert_return (invoke "ref_test_array" (i32.const 5)) (i32.const 2))
-;; (assert_return (invoke "ref_test_array" (i32.const 6)) (i32.const 0))
-;; (assert_return (invoke "ref_test_array" (i32.const 7)) (i32.const 1))
+(assert_return (invoke "ref_test_array" (i32.const 6)) (i32.const 0))
+(assert_return (invoke "ref_test_array" (i32.const 7)) (i32.const 1))
(assert_return (invoke "ref_test_null_func" (i32.const 0)) (i32.const 2))
(assert_return (invoke "ref_test_null_func" (i32.const 1)) (i32.const 2))
@@ -164,17 +164,17 @@
(assert_return (invoke "ref_test_null_extern" (i32.const 0)) (i32.const 2))
(assert_return (invoke "ref_test_null_extern" (i32.const 1)) (i32.const 2))
-;; (assert_return (invoke "ref_test_null_extern" (i32.const 2)) (i32.const 0))
-;; (assert_return (invoke "ref_test_null_extern" (i32.const 3)) (i32.const 0))
-;; (assert_return (invoke "ref_test_null_extern" (i32.const 4)) (i32.const 0))
-;; (assert_return (invoke "ref_test_null_extern" (i32.const 5)) (i32.const 2))
+(assert_return (invoke "ref_test_null_extern" (i32.const 2)) (i32.const 0))
+(assert_return (invoke "ref_test_null_extern" (i32.const 3)) (i32.const 0))
+(assert_return (invoke "ref_test_null_extern" (i32.const 4)) (i32.const 0))
+(assert_return (invoke "ref_test_null_extern" (i32.const 5)) (i32.const 2))
(assert_return (invoke "ref_test_extern" (i32.const 0)) (i32.const 1))
(assert_return (invoke "ref_test_extern" (i32.const 1)) (i32.const 1))
-;; (assert_return (invoke "ref_test_extern" (i32.const 2)) (i32.const 2))
-;; (assert_return (invoke "ref_test_extern" (i32.const 3)) (i32.const 2))
-;; (assert_return (invoke "ref_test_extern" (i32.const 4)) (i32.const 2))
-;; (assert_return (invoke "ref_test_extern" (i32.const 5)) (i32.const 1))
+(assert_return (invoke "ref_test_extern" (i32.const 2)) (i32.const 2))
+(assert_return (invoke "ref_test_extern" (i32.const 3)) (i32.const 2))
+(assert_return (invoke "ref_test_extern" (i32.const 4)) (i32.const 2))
+(assert_return (invoke "ref_test_extern" (i32.const 5)) (i32.const 1))
;; Concrete Types