summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/binaryen.js/expressions.js32
-rw-r--r--test/binaryen.js/expressions.js.txt2
-rw-r--r--test/binaryen.js/kitchen-sink.js2
-rw-r--r--test/binaryen.js/kitchen-sink.js.txt2
-rw-r--r--test/example/c-api-kitchen-sink.c4
5 files changed, 21 insertions, 21 deletions
diff --git a/test/binaryen.js/expressions.js b/test/binaryen.js/expressions.js
index a49546b91..6d4fa8011 100644
--- a/test/binaryen.js/expressions.js
+++ b/test/binaryen.js/expressions.js
@@ -1353,26 +1353,26 @@ console.log("# MemoryFill");
module.dispose();
})();
-console.log("# RefIsNull");
-(function testRefIsNull() {
+console.log("# RefIs");
+(function testRefIs() {
const module = new binaryen.Module();
var value = module.local.get(1, binaryen.externref);
- const theRefIsNull = binaryen.RefIsNull(module.ref.is_null(value));
- assert(theRefIsNull instanceof binaryen.RefIsNull);
- assert(theRefIsNull instanceof binaryen.Expression);
- assert(theRefIsNull.value === value);
- assert(theRefIsNull.type === binaryen.i32);
-
- theRefIsNull.value = value = module.local.get(2, binaryen.externref);
- assert(theRefIsNull.value === value);
- theRefIsNull.type = binaryen.f64;
- theRefIsNull.finalize();
- assert(theRefIsNull.type === binaryen.i32);
-
- console.log(theRefIsNull.toText());
+ const theRefIs = binaryen.RefIs(module.ref.is_null(value));
+ assert(theRefIs instanceof binaryen.RefIs);
+ assert(theRefIs instanceof binaryen.Expression);
+ assert(theRefIs.value === value);
+ assert(theRefIs.type === binaryen.i32);
+
+ theRefIs.value = value = module.local.get(2, binaryen.externref);
+ assert(theRefIs.value === value);
+ theRefIs.type = binaryen.f64;
+ theRefIs.finalize();
+ assert(theRefIs.type === binaryen.i32);
+
+ console.log(theRefIs.toText());
assert(
- theRefIsNull.toText()
+ theRefIs.toText()
==
"(ref.is_null\n (local.get $2)\n)\n"
);
diff --git a/test/binaryen.js/expressions.js.txt b/test/binaryen.js/expressions.js.txt
index f5645ff1c..5a0353c27 100644
--- a/test/binaryen.js/expressions.js.txt
+++ b/test/binaryen.js/expressions.js.txt
@@ -202,7 +202,7 @@
(i32.const 6)
)
-# RefIsNull
+# RefIs
(ref.is_null
(local.get $2)
)
diff --git a/test/binaryen.js/kitchen-sink.js b/test/binaryen.js/kitchen-sink.js
index 9655d5607..43a1a67c2 100644
--- a/test/binaryen.js/kitchen-sink.js
+++ b/test/binaryen.js/kitchen-sink.js
@@ -158,7 +158,7 @@ function test_ids() {
console.log("MemoryFillId: " + binaryen.MemoryFillId);
console.log("PopId: " + binaryen.PopId);
console.log("RefNullId: " + binaryen.RefNullId);
- console.log("RefIsNullId: " + binaryen.RefIsNullId);
+ console.log("RefIsId: " + binaryen.RefIsId);
console.log("RefFuncId: " + binaryen.RefFuncId);
console.log("RefEqId: " + binaryen.RefEqId);
console.log("TryId: " + binaryen.TryId);
diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt
index 1b1a29de6..b42bdbb18 100644
--- a/test/binaryen.js/kitchen-sink.js.txt
+++ b/test/binaryen.js/kitchen-sink.js.txt
@@ -82,7 +82,7 @@ MemoryCopyId: 39
MemoryFillId: 40
PopId: 41
RefNullId: 42
-RefIsNullId: 43
+RefIsId: 43
RefFuncId: 44
RefEqId: 45
TryId: 46
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c
index c4973d317..907ab58c9 100644
--- a/test/example/c-api-kitchen-sink.c
+++ b/test/example/c-api-kitchen-sink.c
@@ -710,8 +710,8 @@ void test_core() {
iIfF,
BinaryenTypeInt32()),
// Reference types
- BinaryenRefIsNull(module, externrefExpr),
- BinaryenRefIsNull(module, funcrefExpr),
+ BinaryenRefIs(module, BinaryenRefIsNull(), externrefExpr),
+ BinaryenRefIs(module, BinaryenRefIsNull(), funcrefExpr),
BinaryenSelect(
module,
temp10,