File tree 2 files changed +39
-25
lines changed
test/core/custom-page-sizes
2 files changed +39
-25
lines changed Original file line number Diff line number Diff line change 15
15
(memory 0xFFFF_FFFF (pagesize 1 )))
16
16
" unknown import" )
17
17
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
-
25
18
;; i32 (default pagesize)
26
19
(assert_unlinkable
27
20
(module
28
21
(import " test" " unknown" (func ))
29
22
(memory 65536 (pagesize 65536 )))
30
23
" unknown import" )
31
24
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
-
39
25
;; Memory size just over the maximum.
40
26
;;
41
27
;; These are malformed (for pagesize 1)
46
32
(module quote " (memory 0x1_0000_0000 (pagesize 1))" )
47
33
" constant out of range" )
48
34
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
-
54
35
;; i32 (default pagesize)
55
36
(assert_invalid
56
37
(module
57
38
(memory 65537 (pagesize 65536 )))
58
39
" 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 number Diff line number Diff line change
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" )
You can’t perform that action at this time.
0 commit comments