summaryrefslogtreecommitdiff
path: root/test/lit/validation
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2024-03-06 10:24:54 -0800
committerGitHub <noreply@github.com>2024-03-06 10:24:54 -0800
commit4ca311d83187bad3b5790635efc687b747a1b1e7 (patch)
treee6257f323a97a5d9a4bfe68942468f7da792f3dc /test/lit/validation
parentf44912bf234d5e19a1adb34c770335f4b3190e2a (diff)
downloadbinaryen-4ca311d83187bad3b5790635efc687b747a1b1e7.tar.gz
binaryen-4ca311d83187bad3b5790635efc687b747a1b1e7.tar.bz2
binaryen-4ca311d83187bad3b5790635efc687b747a1b1e7.zip
Print '(offset ...)` in data and element segments (#6379)
Previously we just printed the offset instruction(s) directly, which is a valid shorthand only when there is a single instruction. In the case of extended constant instructions, there can potentially be multiple instructions, in which case the explicit `offset` clause is required. Print the full clause when necessary.
Diffstat (limited to 'test/lit/validation')
-rw-r--r--test/lit/validation/extended-const.wast10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/lit/validation/extended-const.wast b/test/lit/validation/extended-const.wast
index 6b506671f..054c5e28e 100644
--- a/test/lit/validation/extended-const.wast
+++ b/test/lit/validation/extended-const.wast
@@ -11,14 +11,20 @@
;; EXTENDED: (global.get $gimport$0)
;; EXTENDED: (i32.const 42)
;; EXTENDED: ))
-;; EXTENDED: (data $0 (i32.sub
+;; EXTENDED: (data $0 (offset (i32.sub
;; EXTENDED: (global.get $gimport$0)
;; EXTENDED: (i32.const 10)
-;; EXTENDED: ) "hello world")
+;; EXTENDED: )) "hello world")
+;; EXTENDED: (elem $0 (offset (i32.sub
+;; EXTENDED: (global.get $gimport$0)
+;; EXTENDED: (i32.const 10)
+;; EXTENDED: )))
(module
(import "env" "global" (global i32))
(memory 1 1)
+ (table 1 1 funcref)
(global i32 (i32.add (global.get 0) (i32.const 42)))
(data (offset (i32.sub (global.get 0) (i32.const 10))) "hello world")
+ (elem (offset (i32.sub (global.get 0) (i32.const 10))) func)
)