summaryrefslogtreecommitdiff
path: root/test/gc.wast
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-01-07 20:01:06 +0000
committerGitHub <noreply@github.com>2021-01-07 12:01:06 -0800
commit6a35e33f126d80e7583821e584ae9d101ba0ccb5 (patch)
tree3d339d81d52078bb97ba404d9f8bed348f6cbaa3 /test/gc.wast
parent5693bc850110f2fd6c687f2b8753ec04f15d1f9e (diff)
downloadbinaryen-6a35e33f126d80e7583821e584ae9d101ba0ccb5.tar.gz
binaryen-6a35e33f126d80e7583821e584ae9d101ba0ccb5.tar.bz2
binaryen-6a35e33f126d80e7583821e584ae9d101ba0ccb5.zip
[GC] Fix parsing/printing of ref types using i31 (#3469)
This lets us parse (ref null i31) and (ref i31) and not just i31ref. It also fixes the parsing of i31ref, making it nullable for now, which we need to do until we support non-nullability. Fix some internal handling of i31 where we had just i31ref (which meant we just handled the non-nullable type). After fixing a bug in printing (where we didn't print out (ref null i31) properly), I found some a simplification, to remove TypeName.
Diffstat (limited to 'test/gc.wast')
-rw-r--r--test/gc.wast5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/gc.wast b/test/gc.wast
index 7ce6e01a9..2fa99a9ac 100644
--- a/test/gc.wast
+++ b/test/gc.wast
@@ -68,4 +68,9 @@
(local.set $local_i32 (i31.get_s (local.get $local_i31ref)))
(local.set $local_i32 (i31.get_u (local.get $local_i31ref)))
)
+
+ (func $test-variants
+ (local $local_i31refnull (ref null i31))
+ (local $local_i31refnonnull (ref i31))
+ )
)