summaryrefslogtreecommitdiff
path: root/test/lit/validation
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2023-04-04 11:33:15 -0700
committerGitHub <noreply@github.com>2023-04-04 11:33:15 -0700
commita802fbe07c270f510c87dfa93577bd4731c075f3 (patch)
tree4c67b39ced46258593f6904bba4a5ac20292886c /test/lit/validation
parent05e1183954e49f8b3a1669cc7973af590afe9fc3 (diff)
downloadbinaryen-a802fbe07c270f510c87dfa93577bd4731c075f3.tar.gz
binaryen-a802fbe07c270f510c87dfa93577bd4731c075f3.tar.bz2
binaryen-a802fbe07c270f510c87dfa93577bd4731c075f3.zip
Use Names instead of indices to identify segments (#5618)
All top-level Module elements are identified and referred to by Name, but for historical reasons element and data segments were referred to by index instead. Fix this inconsistency by using Names to refer to segments from expressions that use them. Also parse and print segment names like we do for other elements. The C API is partially converted to use names instead of indices, but there are still many functions that refer to data segments by index. Finishing the conversion can be done in the future once it becomes necessary.
Diffstat (limited to 'test/lit/validation')
-rw-r--r--test/lit/validation/bulk.wast2
-rw-r--r--test/lit/validation/extended-const.wast2
2 files changed, 2 insertions, 2 deletions
diff --git a/test/lit/validation/bulk.wast b/test/lit/validation/bulk.wast
index d53dae264..36d2841dd 100644
--- a/test/lit/validation/bulk.wast
+++ b/test/lit/validation/bulk.wast
@@ -2,7 +2,7 @@
;; RUN: not wasm-opt -all %s 2>&1 | filecheck %s
-;; CHECK: data.drop segment index out of bounds
+;; CHECK: unknown data segment
(module
(memory $0 16)
diff --git a/test/lit/validation/extended-const.wast b/test/lit/validation/extended-const.wast
index 715209341..9317f47b7 100644
--- a/test/lit/validation/extended-const.wast
+++ b/test/lit/validation/extended-const.wast
@@ -11,7 +11,7 @@
;; EXTENDED: (global.get $gimport$0)
;; EXTENDED: (i32.const 42)
;; EXTENDED: ))
-;; EXTENDED: (data (i32.sub
+;; EXTENDED: (data $0 (i32.sub
;; EXTENDED: (global.get $gimport$0)
;; EXTENDED: (i32.const 10)
;; EXTENDED: ) "hello world")