Skip to content

Commit ffdbb6e

Browse files
authored
Test that drop instructions work w/on memory/table (WebAssembly#140)
This was fixed in the interpreter in the last PR, but only fixed the messages in various assertions. This commit adds a new explicit test for this.
1 parent 404b7e7 commit ffdbb6e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/core/bulk.wast

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@
179179
;; Test that the data segment index is properly encoded as an unsigned (not
180180
;; signed) LEB.
181181
(module
182-
(memory 1)
183182
;; 65 data segments. 64 is the smallest positive number that is encoded
184183
;; differently as a signed LEB.
185184
(data "") (data "") (data "") (data "") (data "") (data "") (data "") (data "")
@@ -193,6 +192,9 @@
193192
(data "")
194193
(func (data.drop 64)))
195194

195+
;; No memory is required for the data.drop instruction.
196+
(module (data "goodbye") (func (data.drop 0)))
197+
196198
;; table.init
197199
(module
198200
(table 3 funcref)
@@ -270,7 +272,6 @@
270272
;; Test that the elem segment index is properly encoded as an unsigned (not
271273
;; signed) LEB.
272274
(module
273-
(table 1 funcref)
274275
;; 65 elem segments. 64 is the smallest positive number that is encoded
275276
;; differently as a signed LEB.
276277
(elem funcref) (elem funcref) (elem funcref) (elem funcref)
@@ -292,6 +293,9 @@
292293
(elem funcref)
293294
(func (elem.drop 64)))
294295

296+
;; No table is required for the elem.drop instruction.
297+
(module (elem funcref (ref.func 0)) (func (elem.drop 0)))
298+
295299
;; table.copy
296300
(module
297301
(table 10 funcref)

0 commit comments

Comments
 (0)