summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorArthur Islamov <me@daken.ru>2023-07-18 21:57:11 +0400
committerGitHub <noreply@github.com>2023-07-18 10:57:11 -0700
commit4a6d45ff6ffd0eae971f4b0894b69f365cfc86c6 (patch)
tree2af694153605ee4e82289c361489b086e2db6d82 /test
parent159750d0fccd7ee453ac2f8569128e0ea94ba8a5 (diff)
downloadbinaryen-4a6d45ff6ffd0eae971f4b0894b69f365cfc86c6.tar.gz
binaryen-4a6d45ff6ffd0eae971f4b0894b69f365cfc86c6.tar.bz2
binaryen-4a6d45ff6ffd0eae971f4b0894b69f365cfc86c6.zip
MemoryPacking: memory.init fixes for 64 bit (#5809)
Fixes emscripten-core/emscripten#17485 This allows emscripten to complie code with MEMORY64 + PTHREADS by fixing using the proper pointer type in the MemoryPacking pass.
Diffstat (limited to 'test')
-rw-r--r--test/lit/passes/memory-packing_zero-filled-memory64.wast38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/lit/passes/memory-packing_zero-filled-memory64.wast b/test/lit/passes/memory-packing_zero-filled-memory64.wast
new file mode 100644
index 000000000..60c4ea3f7
--- /dev/null
+++ b/test/lit/passes/memory-packing_zero-filled-memory64.wast
@@ -0,0 +1,38 @@
+;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
+
+;; RUN: foreach %s %t wasm-opt --memory-packing -all --zero-filled-memory -S -o - | filecheck %s
+
+(module
+ (type (;0;) (func (param i64)))
+ ;; CHECK: (type $i64_=>_none (func (param i64)))
+
+ ;; CHECK: (import "env" "memory" (memory $0 i64 1 1))
+ (import "env" "memory" (memory $0 i64 1 1))
+ (data (i64.const 1024) "x")
+ (data (i64.const 1023) "\00")
+ (data $.tdata "\00\00\00\00\00\00\00\00")
+ ;; CHECK: (global $__mem_segment_drop_state (mut i32) (i32.const 0))
+
+ ;; CHECK: (data $0 (i64.const 1024) "x")
+
+ ;; CHECK: (func $__wasm_init_tls (type $i64_=>_none) (param $0 i64)
+ ;; CHECK-NEXT: (local $1 i64)
+ ;; CHECK-NEXT: (local.set $1
+ ;; CHECK-NEXT: (local.get $0)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (if
+ ;; CHECK-NEXT: (global.get $__mem_segment_drop_state)
+ ;; CHECK-NEXT: (unreachable)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (memory.fill
+ ;; CHECK-NEXT: (local.get $1)
+ ;; CHECK-NEXT: (i32.const 0)
+ ;; CHECK-NEXT: (i64.const 8)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ (func $__wasm_init_tls (type 0) (param i64)
+ (memory.init $.tdata
+ (local.get 0)
+ (i32.const 0)
+ (i32.const 8)))
+)