summaryrefslogtreecommitdiff
path: root/test/heap-types.wast.fromBinary
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-06-02 13:24:22 -0700
committerGitHub <noreply@github.com>2021-06-02 13:24:22 -0700
commitd8f2ddd4d680b059c2daded7f57051bf21d77297 (patch)
tree11a1f5d1e2621152bdfcef385201b950c379f0c5 /test/heap-types.wast.fromBinary
parente40396003798678803f4091ac4132aefa3905d7a (diff)
downloadbinaryen-d8f2ddd4d680b059c2daded7f57051bf21d77297.tar.gz
binaryen-d8f2ddd4d680b059c2daded7f57051bf21d77297.tar.bz2
binaryen-d8f2ddd4d680b059c2daded7f57051bf21d77297.zip
[Wasm GC] Add negated BrOn* operations (#3913)
They are basically the flip versions. The only interesting part in the impl is that their returned typed and sent types are different. Spec: https://docs.google.com/document/d/1DklC3qVuOdLHSXB5UXghM_syCh-4cMinQ50ICiXnK3Q/edit
Diffstat (limited to 'test/heap-types.wast.fromBinary')
-rw-r--r--test/heap-types.wast.fromBinary55
1 files changed, 54 insertions, 1 deletions
diff --git a/test/heap-types.wast.fromBinary b/test/heap-types.wast.fromBinary
index dbe080996..314b3c29e 100644
--- a/test/heap-types.wast.fromBinary
+++ b/test/heap-types.wast.fromBinary
@@ -1,8 +1,8 @@
(module
(type $struct.A (struct (field i32) (field f32) (field $named f64)))
+ (type $struct.B (struct (field i8) (field (mut i16)) (field (ref $struct.A)) (field (mut (ref $struct.A)))))
(type $vector (array (mut f64)))
(type $none_=>_none (func))
- (type $struct.B (struct (field i8) (field (mut i16)) (field (ref $struct.A)) (field (mut (ref $struct.A)))))
(type $grandchild (struct (field i32) (field i64)))
(type $matrix (array (mut (ref null $vector))))
(type $struct.C (struct (field $named-mut (mut f32))))
@@ -195,6 +195,7 @@
)
(func $rtt-operations
(local $temp.A (ref null $struct.A))
+ (local $temp.B (ref null $struct.B))
(drop
(ref.test
(ref.null $struct.A)
@@ -223,6 +224,17 @@
)
)
)
+ (drop
+ (block $label$3 (result (ref null $struct.A))
+ (local.set $temp.B
+ (br_on_cast_fail $label$3
+ (ref.null $struct.A)
+ (rtt.canon $struct.B)
+ )
+ )
+ (ref.null $struct.A)
+ )
+ )
)
(func $ref.is_X (param $x anyref)
(if
@@ -269,6 +281,9 @@
(func $br_on_X (param $x anyref)
(local $y anyref)
(local $z anyref)
+ (local $temp-func funcref)
+ (local $temp-data (ref null data))
+ (local $temp-i31 (ref null i31))
(block $label$1
(local.set $z
(br_on_null $label$1
@@ -306,6 +321,44 @@
(ref.null i31)
)
)
+ (drop
+ (block $label$5 (result (ref any))
+ (br_on_non_null $label$5
+ (local.get $x)
+ )
+ (unreachable)
+ )
+ )
+ (drop
+ (block $label$6 (result anyref)
+ (local.set $temp-func
+ (br_on_non_func $label$6
+ (local.get $x)
+ )
+ )
+ (ref.null any)
+ )
+ )
+ (drop
+ (block $label$7 (result anyref)
+ (local.set $temp-data
+ (br_on_non_data $label$7
+ (local.get $x)
+ )
+ )
+ (ref.null any)
+ )
+ )
+ (drop
+ (block $label$8 (result anyref)
+ (local.set $temp-i31
+ (br_on_non_i31 $label$8
+ (local.get $x)
+ )
+ )
+ (ref.null any)
+ )
+ )
)
(func $unreachables-1
(unreachable)