Debian Codegraph @

tests/cli/invalid/func.wast

raw
1 ;; RUN: wast --assert default --snapshot tests/snapshots %
2
3 (assert_malformed
4 (module binary
5 "\00asm" "\01\00\00\00" ;; magic header
6
7 "\01\04" ;; type section
8 "\01" ;; 1 count
9 "\60\00\00" ;; no params or results
10
11 "\03\02" ;; func section
12 "\01" ;; 1 count
13 "\00" ;; type 0
14
15 "\0a\05" ;; code section
16 "\01" ;; 1 count
17 "\03" ;; size of function
18 "\00" ;; no locals
19 "\0b" ;; end
20 "\01" ;; nop
21 )
22 "operators remaining after end of function")
23
24 (assert_malformed
25 (module binary
26 "\00asm" "\01\00\00\00" ;; magic header
27
28 "\01\04" ;; type section
29 "\01" ;; 1 count
30 "\60\00\00" ;; no params or results
31
32 "\03\02" ;; func section
33 "\01" ;; 1 count
34 "\00" ;; type 0
35
36 "\0a\05" ;; code section
37 "\01" ;; 1 count
38 "\03" ;; size of function
39 "\00" ;; no locals
40 "\0b" ;; end
41 "\9d" ;; f64.trunc
42 )
43 "operators remaining after end of function")
44
45 (assert_malformed
46 (module binary
47 "\00asm" "\01\00\00\00" ;; magic header
48
49 "\01\04" ;; type section
50 "\01" ;; 1 count
51 "\60\00\00" ;; no params or results
52
53 "\03\02" ;; func section
54 "\01" ;; 1 count
55 "\00" ;; type 0
56
57 "\0a\05" ;; code section
58 "\01" ;; 1 count
59 "\03" ;; size of function
60 "\00" ;; no locals
61 "\0b" ;; end
62 "\0b" ;; end
63 )
64 "operators remaining after end of function")
65
66 (assert_malformed
67 (module quote
68 "(func end unreachable)")
69 "operators remaining after end of function")
70
71 ;; binary version of previous test
72 (assert_malformed
73 (module binary
74 "\00asm\01\00\00\00\01\04\01\60\00\00\03\02\01\00\0a\06\01\04\00\0b\00\0b")
75 "operators remaining after end of function")
76
77 (assert_malformed
78 (module quote
79 "(func end return)")
80 "operators remaining after end of function")
81
82 ;; binary version of previous test
83 (assert_malformed
84 (module binary
85 "\00asm\01\00\00\00\01\04\01\60\00\00\03\02\01\00\0a\06\01\04\00\0b\0f\0b")
86 "operators remaining after end of function")
87
88 (assert_malformed
89 (module quote
90 "(func end br 0)")
91 "operators remaining after end of function")
92
93 ;; binary version of previous test
94 (assert_malformed
95 (module binary
96 "\00asm\01\00\00\00\01\04\01\60\00\00\03\02\01\00\0a\07\01\05\00\0b\0c\00\0b")
97 "operators remaining after end of function")
98
99 (assert_malformed
100 (module quote
101 "(func end br 100000)")
102 "operators remaining after end of function")
103
104 ;; binary version of previous test
105 (assert_malformed
106 (module binary
107 "\00asm\01\00\00\00\01\04\01\60\00\00\03\02\01\00\0a\09\01\07\00\0b\0c\a0\8d\06\0b")
108 "operators remaining after end of function")
109
110 (assert_malformed
111 (module quote
112 "(func end br_table 0)")
113 "operators remaining after end of function")
114
115 ;; binary version of previous test
116 (assert_malformed
117 (module binary
118 "\00asm\01\00\00\00\01\04\01\60\00\00\03\02\01\00\0a\08\01\06\00\0b\0e\00\00\0b")
119 "operators remaining after end of function")