diff options
author | Thomas Lively <tlively@google.com> | 2023-03-29 14:52:23 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-29 14:52:23 -0700 |
commit | 3b9bea03b62028047cdc0bd4d360cdcdd97323d9 (patch) | |
tree | efaeaa01a8aa195c7bb8e6158e19b53599d5be62 /test | |
parent | 1343476a53c6b7a7b955e8e44971bc520fd937d5 (diff) | |
download | binaryen-3b9bea03b62028047cdc0bd4d360cdcdd97323d9.tar.gz binaryen-3b9bea03b62028047cdc0bd4d360cdcdd97323d9.tar.bz2 binaryen-3b9bea03b62028047cdc0bd4d360cdcdd97323d9.zip |
Support memory64 in MemoryPacking (#5605)
Fix the relevant pointer and size expressions produced by MemoryPacking to be
i64s when working with 64-bit memories.
Fixes #5578.
Diffstat (limited to 'test')
-rw-r--r-- | test/lit/passes/memory-packing_all-features.wast | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/test/lit/passes/memory-packing_all-features.wast b/test/lit/passes/memory-packing_all-features.wast index ba5a4b505..890fe20e6 100644 --- a/test/lit/passes/memory-packing_all-features.wast +++ b/test/lit/passes/memory-packing_all-features.wast @@ -2297,3 +2297,50 @@ ) ) ) +(module + ;; memory64 works! + ;; CHECK: (type $none_=>_none (func)) + + ;; CHECK: (global $__mem_segment_drop_state (mut i32) (i32.const 0)) + + ;; CHECK: (memory $0 i64 1 1) + (memory $0 i64 1 1) + (data "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00wasm64\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00is cool") + ;; CHECK: (data "wasm64") + + ;; CHECK: (data "is cool") + + ;; CHECK: (func $0 (type $none_=>_none) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (global.get $__mem_segment_drop_state) + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (memory.fill + ;; CHECK-NEXT: (i64.const 0) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (i64.const 57) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (memory.init 0 + ;; CHECK-NEXT: (i64.const 57) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (i32.const 6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (memory.fill + ;; CHECK-NEXT: (i64.const 63) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (i64.const 57) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (memory.init 1 + ;; CHECK-NEXT: (i64.const 120) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (i32.const 7) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $0 + (memory.init 0 + (i64.const 0) + (i32.const 0) + (i32.const 127) + ) + ) +) |