Skip to content

separate memory64 tests for the convenience of runtimes w/o memory64 #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions test/core/custom-page-sizes/memory_max.wast
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,13 @@
(memory 0xFFFF_FFFF (pagesize 1)))
"unknown import")

;; i64 (pagesize 1)
(assert_unlinkable
(module
(import "test" "import" (func))
(memory i64 0xFFFF_FFFF_FFFF_FFFF (pagesize 1)))
"unknown import")

;; i32 (default pagesize)
(assert_unlinkable
(module
(import "test" "unknown" (func))
(memory 65536 (pagesize 65536)))
"unknown import")

;; i64 (default pagesize)
(assert_unlinkable
(module
(import "test" "unknown" (func))
(memory i64 0x1_0000_0000_0000 (pagesize 65536)))
"unknown import")

;; Memory size just over the maximum.
;;
;; These are malformed (for pagesize 1)
Expand All @@ -46,19 +32,8 @@
(module quote "(memory 0x1_0000_0000 (pagesize 1))")
"constant out of range")

;; i64 (pagesize 1)
(assert_malformed
(module quote "(memory i64 0x1_0000_0000_0000_0000 (pagesize 1))")
"constant out of range")

;; i32 (default pagesize)
(assert_invalid
(module
(memory 65537 (pagesize 65536)))
"memory size must be at most")

;; i64 (default pagesize)
(assert_invalid
(module
(memory i64 0x1_0000_0000_0001 (pagesize 65536)))
"memory size must be at most")
39 changes: 39 additions & 0 deletions test/core/custom-page-sizes/memory_max_i64.wast
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
;; Maximum memory sizes.
;;
;; These modules are valid, but instantiating them is unnecessary
;; and would only allocate very large memories and slow down running
;; the spec tests. Therefore, add a missing import so that it cannot
;; be instantiated and use `assert_unlinkable`. This approach
;; enforces that the module itself is still valid, but that its
;; instantiation fails early (hopefully before any memories are
;; actually allocated).

;; i64 (pagesize 1)
(assert_unlinkable
(module
(import "test" "import" (func))
(memory i64 0xFFFF_FFFF_FFFF_FFFF (pagesize 1)))
"unknown import")

;; i64 (default pagesize)
(assert_unlinkable
(module
(import "test" "unknown" (func))
(memory i64 0x1_0000_0000_0000 (pagesize 65536)))
"unknown import")

;; Memory size just over the maximum.
;;
;; These are malformed (for pagesize 1)
;; or invalid (for other pagesizes).

;; i64 (pagesize 1)
(assert_malformed
(module quote "(memory i64 0x1_0000_0000_0000_0000 (pagesize 1))")
"constant out of range")

;; i64 (default pagesize)
(assert_invalid
(module
(memory i64 0x1_0000_0000_0001 (pagesize 65536)))
"memory size must be at most")
Loading