Skip to content
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
41 changes: 9 additions & 32 deletions test/core/custom-page-sizes/memory_max.wast
Original file line number Diff line number Diff line change
@@ -1,44 +1,21 @@
;; 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 an invalid 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).

;; Helper module that exports a non-matching value.
(module
(memory (export "unknown") 0))

(register "test")

;; i32 (pagesize 1)
(assert_unlinkable
(module
(import "test" "unknown" (func))
(memory 0xFFFF_FFFF (pagesize 1)))
"incompatible import type")
(module definition
(memory 0xFFFF_FFFF (pagesize 1)))

;; i32 (pagesize 1)
(assert_unlinkable
(module
(import "test" "unknown" (memory 0xFFFF_FFFF (pagesize 1))))
"incompatible import type")
(module definition
(import "a" "b" (memory 0xFFFF_FFFF (pagesize 1))))

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

;; i32 (default pagesize)
(assert_unlinkable
(module
(import "test" "unknown" (memory 65536 (pagesize 65536))))
"incompatible import type")
(module definition
(import "test" "unknown" (memory 65536 (pagesize 65536))))

;; Memory size just over the maximum.

Expand Down
42 changes: 10 additions & 32 deletions test/core/custom-page-sizes/memory_max_i64.wast
Original file line number Diff line number Diff line change
@@ -1,44 +1,22 @@
;; 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 an invalid 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).

;; Helper module that exports a non-matching value.
(module
(memory (export "unknown") 0))

(register "test")

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

;; i64 (pagesize 1)
(assert_unlinkable
(module
(import "test" "unknown" (memory i64 0xFFFF_FFFF_FFFF_FFFF (pagesize 1))))
"incompatible import type")
(module definition
(import "test" "unknown" (memory i64 0xFFFF_FFFF_FFFF_FFFF (pagesize 1))))

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

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

;; Memory size just over the maximum.
;;
Expand Down
Loading