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.c6
-rw-r--r--test/passes/translate-to-fuzz_all-features_metrics_noprint.txt2
6 files changed, 23 insertions, 23 deletions
diff --git a/test/binaryen.js/expressions.js b/test/binaryen.js/expressions.js
index 13295a33d..83e005f0d 100644
--- a/test/binaryen.js/expressions.js
+++ b/test/binaryen.js/expressions.js
@@ -1771,26 +1771,26 @@ console.log("# TupleExtract");
module.dispose();
})();
-console.log("# I31New");
-(function testI31New() {
+console.log("# RefI31");
+(function testRefI31() {
const module = new binaryen.Module();
var value = module.local.get(1, binaryen.i32);
- const theI31New = binaryen.I31New(module.i31.new(value));
- assert(theI31New instanceof binaryen.I31New);
- assert(theI31New instanceof binaryen.Expression);
- assert(theI31New.value === value);
- // assert(theI31New.type === binaryen.?); // TODO: (ref i31)
-
- theI31New.value = value = module.local.get(2, binaryen.i32);
- assert(theI31New.value === value);
- theI31New.type = binaryen.f64;
- theI31New.finalize();
- // assert(theI31New.type === binaryen.?); // TODO: (ref i31)
-
- console.log(theI31New.toText());
+ const theRefI31 = binaryen.RefI31(module.i31.new(value));
+ assert(theRefI31 instanceof binaryen.RefI31);
+ assert(theRefI31 instanceof binaryen.Expression);
+ assert(theRefI31.value === value);
+ // assert(theRefI31.type === binaryen.?); // TODO: (ref i31)
+
+ theRefI31.value = value = module.local.get(2, binaryen.i32);
+ assert(theRefI31.value === value);
+ theRefI31.type = binaryen.f64;
+ theRefI31.finalize();
+ // assert(theRefI31.type === binaryen.?); // TODO: (ref i31)
+
+ console.log(theRefI31.toText());
assert(
- theI31New.toText()
+ theRefI31.toText()
==
"(i31.new\n (local.get $2)\n)\n"
);
diff --git a/test/binaryen.js/expressions.js.txt b/test/binaryen.js/expressions.js.txt
index f548c4037..01ef40f70 100644
--- a/test/binaryen.js/expressions.js.txt
+++ b/test/binaryen.js/expressions.js.txt
@@ -330,7 +330,7 @@
)
)
-# I31New
+# RefI31
(i31.new
(local.get $2)
)
diff --git a/test/binaryen.js/kitchen-sink.js b/test/binaryen.js/kitchen-sink.js
index a9e3a4eae..ecc20448f 100644
--- a/test/binaryen.js/kitchen-sink.js
+++ b/test/binaryen.js/kitchen-sink.js
@@ -157,7 +157,7 @@ function test_ids() {
console.log("RethrowId: " + binaryen.RethrowId);
console.log("TupleMakeId: " + binaryen.TupleMakeId);
console.log("TupleExtractId: " + binaryen.TupleExtractId);
- console.log("I31NewId: " + binaryen.I31NewId);
+ console.log("RefI31Id: " + binaryen.RefI31Id);
console.log("I31GetId: " + binaryen.I31GetId);
console.log("CallRefId: " + binaryen.CallRefId);
console.log("RefTestId: " + binaryen.RefTestId);
diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt
index d8bb8d4ed..ce0150f81 100644
--- a/test/binaryen.js/kitchen-sink.js.txt
+++ b/test/binaryen.js/kitchen-sink.js.txt
@@ -87,7 +87,7 @@ ThrowId: 50
RethrowId: 51
TupleMakeId: 52
TupleExtractId: 53
-I31NewId: 54
+RefI31Id: 54
I31GetId: 55
CallRefId: 56
RefTestId: 57
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c
index c2c5d6e31..d3368a6b1 100644
--- a/test/example/c-api-kitchen-sink.c
+++ b/test/example/c-api-kitchen-sink.c
@@ -471,7 +471,7 @@ void test_core() {
funcrefExpr =
BinaryenRefFunc(module, "kitchen()sinker", BinaryenTypeFuncref());
BinaryenExpressionRef i31refExpr =
- BinaryenI31New(module, makeInt32(module, 1));
+ BinaryenRefI31(module, makeInt32(module, 1));
// Tags
BinaryenAddTag(module, "a-tag", BinaryenTypeInt32(), BinaryenTypeNone());
@@ -1101,9 +1101,9 @@ void test_core() {
BinaryenMemorySize(module, "0", false),
BinaryenMemoryGrow(module, makeInt32(module, 0), "0", false),
// GC
- BinaryenI31New(module, makeInt32(module, 0)),
+ BinaryenRefI31(module, makeInt32(module, 0)),
BinaryenI31Get(module, i31refExpr, 1),
- BinaryenI31Get(module, BinaryenI31New(module, makeInt32(module, 2)), 0),
+ BinaryenI31Get(module, BinaryenRefI31(module, makeInt32(module, 2)), 0),
BinaryenRefTest(
module, BinaryenGlobalGet(module, "i8Array-global", i8Array), i8Array),
BinaryenRefCast(
diff --git a/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt b/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt
index 0cb110a88..2c4396485 100644
--- a/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt
+++ b/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt
@@ -24,7 +24,6 @@ total
GlobalGet : 28
GlobalSet : 28
I31Get : 1
- I31New : 3
If : 24
Load : 20
LocalGet : 33
@@ -33,6 +32,7 @@ total
MemoryFill : 2
Nop : 7
RefFunc : 6
+ RefI31 : 3
RefIsNull : 1
RefNull : 7
RefTest : 1