532c13d09ac8086a79448843abcb41f609a8af9b
[platform/framework/web/lwnode.git] /
1 ;; Test table section structure
2
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))
10
11 (module (table 1 (ref null func)))
12 (module (table 1 (ref null extern)))
13 (module (table 1 (ref null $t)) (type $t (func)))
14
15 (module (table 0 funcref) (table 0 funcref))
16 (module (table (import "spectest" "table") 0 funcref) (table 0 funcref))
17
18 (assert_invalid (module (elem (i32.const 0))) "unknown table")
19 (assert_invalid (module (elem (i32.const 0) $f) (func $f)) "unknown table")
20
21
22 (assert_invalid
23   (module (table 1 0 funcref))
24   "size minimum must not be greater than maximum"
25 )
26 (assert_invalid
27   (module (table 0xffff_ffff 0 funcref))
28   "size minimum must not be greater than maximum"
29 )
30
31 (assert_malformed
32   (module quote "(table 0x1_0000_0000 funcref)")
33   "i32 constant out of range"
34 )
35 (assert_malformed
36   (module quote "(table 0x1_0000_0000 0x1_0000_0000 funcref)")
37   "i32 constant out of range"
38 )
39 (assert_malformed
40   (module quote "(table 0 0x1_0000_0000 funcref)")
41   "i32 constant out of range"
42 )
43
44 (assert_invalid
45   (module (table 0 (ref func)))
46   "non-defaultable element type"
47 )
48 (assert_invalid
49   (module (table 0 (ref extern)))
50   "non-defaultable element type"
51 )
52 (assert_invalid
53   (module (type $t (func)) (table 0 (ref $t)))
54   "non-defaultable element type"
55 )
56
57 ;; Duplicate table identifiers
58
59 (assert_malformed (module quote
60   "(table $foo 1 funcref)"
61   "(table $foo 1 funcref)")
62   "duplicate table")
63 (assert_malformed (module quote
64   "(import \"\" \"\" (table $foo 1 funcref))"
65   "(table $foo 1 funcref)")
66   "duplicate table")
67 (assert_malformed (module quote
68   "(import \"\" \"\" (table $foo 1 funcref))"
69   "(import \"\" \"\" (table $foo 1 funcref))")
70   "duplicate table")