Skip to content

Commit f722768

Browse files
authored
Merge pull request #35 from yamt/test2
separate memory64 tests for the convenience of runtimes w/o memory64
2 parents a18ff9b + 7b0b911 commit f722768

File tree

2 files changed

+39
-25
lines changed

2 files changed

+39
-25
lines changed

test/core/custom-page-sizes/memory_max.wast

-25
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,13 @@
1515
(memory 0xFFFF_FFFF (pagesize 1)))
1616
"unknown import")
1717

18-
;; i64 (pagesize 1)
19-
(assert_unlinkable
20-
(module
21-
(import "test" "import" (func))
22-
(memory i64 0xFFFF_FFFF_FFFF_FFFF (pagesize 1)))
23-
"unknown import")
24-
2518
;; i32 (default pagesize)
2619
(assert_unlinkable
2720
(module
2821
(import "test" "unknown" (func))
2922
(memory 65536 (pagesize 65536)))
3023
"unknown import")
3124

32-
;; i64 (default pagesize)
33-
(assert_unlinkable
34-
(module
35-
(import "test" "unknown" (func))
36-
(memory i64 0x1_0000_0000_0000 (pagesize 65536)))
37-
"unknown import")
38-
3925
;; Memory size just over the maximum.
4026
;;
4127
;; These are malformed (for pagesize 1)
@@ -46,19 +32,8 @@
4632
(module quote "(memory 0x1_0000_0000 (pagesize 1))")
4733
"constant out of range")
4834

49-
;; i64 (pagesize 1)
50-
(assert_malformed
51-
(module quote "(memory i64 0x1_0000_0000_0000_0000 (pagesize 1))")
52-
"constant out of range")
53-
5435
;; i32 (default pagesize)
5536
(assert_invalid
5637
(module
5738
(memory 65537 (pagesize 65536)))
5839
"memory size must be at most")
59-
60-
;; i64 (default pagesize)
61-
(assert_invalid
62-
(module
63-
(memory i64 0x1_0000_0000_0001 (pagesize 65536)))
64-
"memory size must be at most")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
;; Maximum memory sizes.
2+
;;
3+
;; These modules are valid, but instantiating them is unnecessary
4+
;; and would only allocate very large memories and slow down running
5+
;; the spec tests. Therefore, add a missing import so that it cannot
6+
;; be instantiated and use `assert_unlinkable`. This approach
7+
;; enforces that the module itself is still valid, but that its
8+
;; instantiation fails early (hopefully before any memories are
9+
;; actually allocated).
10+
11+
;; i64 (pagesize 1)
12+
(assert_unlinkable
13+
(module
14+
(import "test" "import" (func))
15+
(memory i64 0xFFFF_FFFF_FFFF_FFFF (pagesize 1)))
16+
"unknown import")
17+
18+
;; i64 (default pagesize)
19+
(assert_unlinkable
20+
(module
21+
(import "test" "unknown" (func))
22+
(memory i64 0x1_0000_0000_0000 (pagesize 65536)))
23+
"unknown import")
24+
25+
;; Memory size just over the maximum.
26+
;;
27+
;; These are malformed (for pagesize 1)
28+
;; or invalid (for other pagesizes).
29+
30+
;; i64 (pagesize 1)
31+
(assert_malformed
32+
(module quote "(memory i64 0x1_0000_0000_0000_0000 (pagesize 1))")
33+
"constant out of range")
34+
35+
;; i64 (default pagesize)
36+
(assert_invalid
37+
(module
38+
(memory i64 0x1_0000_0000_0001 (pagesize 65536)))
39+
"memory size must be at most")

0 commit comments

Comments
 (0)