summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/example/c-api-multiple-tables.c1
-rw-r--r--test/multi-table.wast9
-rw-r--r--test/multi-table.wast.from-wast3
-rw-r--r--test/multi-table.wast.fromBinary3
-rw-r--r--test/multi-table.wast.fromBinary.noDebugInfo3
5 files changed, 15 insertions, 4 deletions
diff --git a/test/example/c-api-multiple-tables.c b/test/example/c-api-multiple-tables.c
index f3a9ba8dd..7cd215bf9 100644
--- a/test/example/c-api-multiple-tables.c
+++ b/test/example/c-api-multiple-tables.c
@@ -64,6 +64,7 @@ int main() {
assert(strcmp(BinaryenTableGetName(t2), "t2") == 0);
BinaryenTableSetName(t2, "table2");
+ BinaryenModuleUpdateMaps(module);
assert(strcmp(BinaryenTableGetName(t2), "table2") == 0);
BinaryenElementSegmentSetTable(elem1, "table2");
assert(strcmp(BinaryenElementSegmentGetTable(elem1), "table2") == 0);
diff --git a/test/multi-table.wast b/test/multi-table.wast
index a98c9e4b0..6d4610aad 100644
--- a/test/multi-table.wast
+++ b/test/multi-table.wast
@@ -9,6 +9,9 @@
(table $t3 4 4 funcref)
(table $textern 0 externref)
+ ;; A table with a typed function references specialized type.
+ (table $tspecial 5 5 (ref null $none_=>_none))
+
;; add to $t1
(elem (i32.const 0) $f)
@@ -25,7 +28,11 @@
(elem $empty func)
(elem $declarative declare func $h)
+ ;; This elem will be emitted as usesExpressions because of the type of the
+ ;; table.
+ (elem $especial (table $tspecial) (i32.const 0) (ref null $none_=>_none) $f $h)
+
(func $f (drop (ref.func $h)))
(func $g)
(func $h)
-) \ No newline at end of file
+)
diff --git a/test/multi-table.wast.from-wast b/test/multi-table.wast.from-wast
index 474e89c53..73a9abea3 100644
--- a/test/multi-table.wast.from-wast
+++ b/test/multi-table.wast.from-wast
@@ -6,6 +6,7 @@
(table $t2 3 3 funcref)
(table $t3 4 4 funcref)
(table $textern 0 externref)
+ (table $tspecial 5 5 (ref null $none_=>_none))
(elem $0 (table $t1) (i32.const 0) func $f)
(elem $1 (table $t2) (i32.const 0) func $f)
(elem $activeNonZeroOffset (table $t2) (i32.const 1) func $f $g)
@@ -15,7 +16,7 @@
(elem $passive-2 funcref (ref.func $f) (ref.func $g) (ref.null func))
(elem $passive-3 (ref null $none_=>_none) (ref.func $f) (ref.func $g) (ref.null $none_=>_none) (global.get $g1))
(elem $empty func)
- (elem declare func $h)
+ (elem $especial (table $tspecial) (i32.const 0) (ref null $none_=>_none) (ref.func $f) (ref.func $h))
(func $f
(drop
(ref.func $h)
diff --git a/test/multi-table.wast.fromBinary b/test/multi-table.wast.fromBinary
index 809740549..427fb44f3 100644
--- a/test/multi-table.wast.fromBinary
+++ b/test/multi-table.wast.fromBinary
@@ -6,6 +6,7 @@
(table $t2 3 3 funcref)
(table $t3 4 4 funcref)
(table $textern 0 externref)
+ (table $tspecial 5 5 (ref null $none_=>_none))
(elem $0 (table $t1) (i32.const 0) func $f)
(elem $1 (table $t2) (i32.const 0) func $f)
(elem $activeNonZeroOffset (table $t2) (i32.const 1) func $f $g)
@@ -15,7 +16,7 @@
(elem $passive-2 funcref (ref.func $f) (ref.func $g) (ref.null func))
(elem $passive-3 (ref null $none_=>_none) (ref.func $f) (ref.func $g) (ref.null $none_=>_none) (global.get $g1))
(elem $empty func)
- (elem declare func $h)
+ (elem $especial (table $tspecial) (i32.const 0) (ref null $none_=>_none) (ref.func $f) (ref.func $h))
(func $f
(drop
(ref.func $h)
diff --git a/test/multi-table.wast.fromBinary.noDebugInfo b/test/multi-table.wast.fromBinary.noDebugInfo
index 1fcd2a9be..7fc667087 100644
--- a/test/multi-table.wast.fromBinary.noDebugInfo
+++ b/test/multi-table.wast.fromBinary.noDebugInfo
@@ -6,6 +6,7 @@
(table $0 3 3 funcref)
(table $1 4 4 funcref)
(table $2 0 externref)
+ (table $3 5 5 (ref null $none_=>_none))
(elem $0 (table $timport$0) (i32.const 0) func $0)
(elem $1 (table $0) (i32.const 0) func $0)
(elem $2 (table $0) (i32.const 1) func $0 $1)
@@ -15,7 +16,7 @@
(elem $6 funcref (ref.func $0) (ref.func $1) (ref.null func))
(elem $7 (ref null $none_=>_none) (ref.func $0) (ref.func $1) (ref.null $none_=>_none) (global.get $global$0))
(elem $8 func)
- (elem declare func $2)
+ (elem $9 (table $3) (i32.const 0) (ref null $none_=>_none) (ref.func $0) (ref.func $2))
(func $0
(drop
(ref.func $2)