1 ;; Test table section structure
3 (module (table 0 funcref))
4 (module (table 1 funcref))
5 (module (table 0 0 funcref))
6 (module (table 0 1 funcref))
7 (module (table 1 256 funcref))
8 (module (table 0 65536 funcref))
9 (module (table 0 0xffff_ffff funcref))
11 (module (table 1 (ref null func)))
12 (module (table 1 (ref null extern)))
13 (module (table 1 (ref null $t)) (type $t (func)))
15 (module (table 0 funcref) (table 0 funcref))
16 (module (table (import "spectest" "table") 0 funcref) (table 0 funcref))
18 (assert_invalid (module (elem (i32.const 0))) "unknown table")
19 (assert_invalid (module (elem (i32.const 0) $f) (func $f)) "unknown table")
23 (module (table 1 0 funcref))
24 "size minimum must not be greater than maximum"
27 (module (table 0xffff_ffff 0 funcref))
28 "size minimum must not be greater than maximum"
32 (module quote "(table 0x1_0000_0000 funcref)")
33 "i32 constant out of range"
36 (module quote "(table 0x1_0000_0000 0x1_0000_0000 funcref)")
37 "i32 constant out of range"
40 (module quote "(table 0 0x1_0000_0000 funcref)")
41 "i32 constant out of range"
45 (module (table 0 (ref func)))
46 "non-defaultable element type"
49 (module (table 0 (ref extern)))
50 "non-defaultable element type"
53 (module (type $t (func)) (table 0 (ref $t)))
54 "non-defaultable element type"
57 ;; Duplicate table identifiers
59 (assert_malformed (module quote
60 "(table $foo 1 funcref)"
61 "(table $foo 1 funcref)")
63 (assert_malformed (module quote
64 "(import \"\" \"\" (table $foo 1 funcref))"
65 "(table $foo 1 funcref)")
67 (assert_malformed (module quote
68 "(import \"\" \"\" (table $foo 1 funcref))"
69 "(import \"\" \"\" (table $foo 1 funcref))")