summaryrefslogtreecommitdiff
path: root/test/example
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2023-01-09 16:23:57 -0600
committerGitHub <noreply@github.com>2023-01-09 14:23:57 -0800
commit67abc2a1b9adcdf080387a29e0c92b6f5a31057a (patch)
treed8e8304e9ecdd700b56b949bb5132b26e09362f4 /test/example
parente3d9b82d9f8910063373e2952582de545659d448 (diff)
downloadbinaryen-67abc2a1b9adcdf080387a29e0c92b6f5a31057a.tar.gz
binaryen-67abc2a1b9adcdf080387a29e0c92b6f5a31057a.tar.bz2
binaryen-67abc2a1b9adcdf080387a29e0c92b6f5a31057a.zip
Replace `RefIs` with `RefIsNull` (#5401)
* Replace `RefIs` with `RefIsNull` The other `ref.is*` instructions are deprecated and expressible in terms of `ref.test`. Update binary and text parsing to parse those instructions as `RefTest` expressions. Also update the printing and emitting of `RefTest` expressions to emit the legacy instructions for now to minimize test changes and make this a mostly non-functional change. Since `ref.is_null` is the only `RefIs` instruction left, remove the `RefIsOp` field and rename the expression class to `RefIsNull`. The few test changes are due to the fact that `ref.is*` instructions are now subject to `ref.test` validation, and in particular it is no longer valid to perform a `ref.is_func` on a value outside of the `func` type hierarchy.
Diffstat (limited to 'test/example')
-rw-r--r--test/example/c-api-kitchen-sink.c13
-rw-r--r--test/example/c-api-kitchen-sink.txt15
2 files changed, 2 insertions, 26 deletions
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c
index de105d239..cc2c96538 100644
--- a/test/example/c-api-kitchen-sink.c
+++ b/test/example/c-api-kitchen-sink.c
@@ -1002,8 +1002,8 @@ void test_core() {
iIfF,
BinaryenTypeInt32()),
// Reference types
- BinaryenRefIs(module, BinaryenRefIsNull(), externrefExpr),
- BinaryenRefIs(module, BinaryenRefIsNull(), funcrefExpr),
+ BinaryenRefIsNull(module, externrefExpr),
+ BinaryenRefIsNull(module, funcrefExpr),
BinaryenSelect(
module,
temp10,
@@ -1014,15 +1014,6 @@ void test_core() {
BinaryenRefEq(module,
BinaryenRefNull(module, BinaryenTypeNullref()),
BinaryenRefNull(module, BinaryenTypeNullref())),
- BinaryenRefIs(module,
- BinaryenRefIsFunc(),
- BinaryenRefNull(module, BinaryenTypeNullref())),
- BinaryenRefIs(module,
- BinaryenRefIsData(),
- BinaryenRefNull(module, BinaryenTypeNullref())),
- BinaryenRefIs(module,
- BinaryenRefIsI31(),
- BinaryenRefNull(module, BinaryenTypeNullref())),
BinaryenRefAs(module,
BinaryenRefAsNonNull(),
BinaryenRefNull(module, BinaryenTypeNullref())),
diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt
index 1ee529eb3..51298d1a2 100644
--- a/test/example/c-api-kitchen-sink.txt
+++ b/test/example/c-api-kitchen-sink.txt
@@ -2004,21 +2004,6 @@ BinaryenFeatureAll: 126975
)
)
(drop
- (ref.is_func
- (ref.null none)
- )
- )
- (drop
- (ref.is_data
- (ref.null none)
- )
- )
- (drop
- (ref.is_i31
- (ref.null none)
- )
- )
- (drop
(ref.as_non_null
(ref.null none)
)