summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2024-11-06 19:11:39 -0800
committerGitHub <noreply@github.com>2024-11-06 19:11:39 -0800
commitab8a41c85ddb1ea783bc8a8832254f992262bed6 (patch)
tree13a3a209c1c4f7f3e1dc42da3dee908ef50abf64 /test
parentde680182bcd1d64d597538cfa4ad6857ce298bc3 (diff)
downloadbinaryen-ab8a41c85ddb1ea783bc8a8832254f992262bed6.tar.gz
binaryen-ab8a41c85ddb1ea783bc8a8832254f992262bed6.tar.bz2
binaryen-ab8a41c85ddb1ea783bc8a8832254f992262bed6.zip
[wasm64] Fix wasm-ctor-eval + utils on 64-bit indexes for memory64 (#7059)
Some places assumed a 32-bit index.
Diffstat (limited to 'test')
-rw-r--r--test/lit/ctor-eval/memory64.wast42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/lit/ctor-eval/memory64.wast b/test/lit/ctor-eval/memory64.wast
new file mode 100644
index 000000000..b1e7b1613
--- /dev/null
+++ b/test/lit/ctor-eval/memory64.wast
@@ -0,0 +1,42 @@
+;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
+;; RUN: wasm-ctor-eval %s --ctors=mem,tab --kept-exports=mem,tab --quiet -all -S -o - | filecheck %s
+
+(module
+ (memory $0 i64 16 17 shared)
+ (data $0 (i64.const 0) "abcd")
+
+ (table i64 1 funcref)
+ (elem $foo)
+
+ (func $mem (export "mem") (result i32)
+ (i32.load
+ (i64.const 0)
+ )
+ )
+
+ ;; CHECK: (type $0 (func (result funcref)))
+
+ ;; CHECK: (type $1 (func (result i32)))
+
+ ;; CHECK: (table $0 i64 1 funcref)
+
+ ;; CHECK: (export "mem" (func $mem_2))
+
+ ;; CHECK: (export "tab" (func $tab))
+
+ ;; CHECK: (func $tab (type $0) (result funcref)
+ ;; CHECK-NEXT: (table.get $0
+ ;; CHECK-NEXT: (i64.const 0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ (func $tab (export "tab") (result funcref)
+ ;; Not optimized yet, but we should not error either.
+ (table.get
+ (i64.const 0)
+ )
+ )
+)
+
+;; CHECK: (func $mem_2 (type $1) (result i32)
+;; CHECK-NEXT: (i32.const 1684234849)
+;; CHECK-NEXT: )