Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
max_mutable_globals_tests.cpp
Go to the documentation of this file.
1#include <sysio/vm/backend.hpp>
2
3#include "utils.hpp"
4#include <catch2/catch.hpp>
5
6using namespace sysio::vm;
7
8extern wasm_allocator wa;
9
10namespace {
11
12/*
13 * (module
14 * (global (mut i32) (i32.const 0))
15 * (global (mut i32) (i32.const 0))
16 * (global (mut i32) (i32.const 0))
17 * (global (mut i32) (i32.const 0))
18 * (global (mut i32) (i32.const 0))
19 * (global (mut i32) (i32.const 0))
20 * (global (mut i32) (i32.const 0))
21 * (global (mut i32) (i32.const 0))
22 * (global (mut i32) (i32.const 0))
23 * (global (mut i32) (i32.const 0))
24 * (global (mut i32) (i32.const 0))
25 * (global (mut i32) (i32.const 0))
26 * (global (mut i32) (i32.const 0))
27 * (global (mut i32) (i32.const 0))
28 * (global (mut i32) (i32.const 0))
29 * (global (mut i32) (i32.const 0))
30 * (global (mut i32) (i32.const 0))
31 * (global (mut i32) (i32.const 0))
32 * (global (mut i32) (i32.const 0))
33 * (global (mut i32) (i32.const 0))
34 * (global (mut i32) (i32.const 0))
35 * (global (mut i32) (i32.const 0))
36 * (global (mut i32) (i32.const 0))
37 * (global (mut i32) (i32.const 0))
38 * (global (mut i32) (i32.const 0))
39 * (global (mut i32) (i32.const 0))
40 * (global (mut i32) (i32.const 0))
41 * (global (mut i32) (i32.const 0))
42 * (global (mut i32) (i32.const 0))
43 * (global (mut i32) (i32.const 0))
44 * (global (mut i32) (i32.const 0))
45 * (global (mut i32) (i32.const 0))
46 * (global (mut i64) (i64.const 0))
47 * (global (mut i64) (i64.const 0))
48 * (global (mut i64) (i64.const 0))
49 * (global (mut i64) (i64.const 0))
50 * (global (mut i64) (i64.const 0))
51 * (global (mut i64) (i64.const 0))
52 * (global (mut i64) (i64.const 0))
53 * (global (mut i64) (i64.const 0))
54 * (global (mut i64) (i64.const 0))
55 * (global (mut i64) (i64.const 0))
56 * (global (mut i64) (i64.const 0))
57 * (global (mut i64) (i64.const 0))
58 * (global (mut i64) (i64.const 0))
59 * (global (mut i64) (i64.const 0))
60 * (global (mut i64) (i64.const 0))
61 * (global (mut i64) (i64.const 0))
62 * (global (mut i32) (i32.const 0))
63 * (global (mut i32) (i32.const 0))
64 * (global (mut i32) (i32.const 0))
65 * (global (mut i32) (i32.const 0))
66 * (global (mut i32) (i32.const 0))
67 * (global (mut i32) (i32.const 0))
68 * (global (mut i32) (i32.const 0))
69 * (global (mut i32) (i32.const 0))
70 * (global (mut i32) (i32.const 0))
71 * (global (mut i32) (i32.const 0))
72 * (global (mut i32) (i32.const 0))
73 * (global (mut i32) (i32.const 0))
74 * (global (mut i32) (i32.const 0))
75 * (global (mut i32) (i32.const 0))
76 * (global (mut i32) (i32.const 0))
77 * (global (mut i32) (i32.const 0))
78 * (global (mut i32) (i32.const 0))
79 * (global (mut i32) (i32.const 0))
80 * (global (mut i32) (i32.const 0))
81 * (global (mut i32) (i32.const 0))
82 * (global (mut i32) (i32.const 0))
83 * (global (mut i32) (i32.const 0))
84 * (global (mut i32) (i32.const 0))
85 * (global (mut i32) (i32.const 0))
86 * (global (mut i32) (i32.const 0))
87 * (global (mut i32) (i32.const 0))
88 * (global (mut i32) (i32.const 0))
89 * (global (mut i32) (i32.const 0))
90 * (global (mut i32) (i32.const 0))
91 * (global (mut i32) (i32.const 0))
92 * (global (mut i32) (i32.const 0))
93 * (global (mut i32) (i32.const 0))
94 * (global (mut i64) (i64.const 0))
95 * (global (mut i64) (i64.const 0))
96 * (global (mut i64) (i64.const 0))
97 * (global (mut i64) (i64.const 0))
98 * (global (mut i64) (i64.const 0))
99 * (global (mut i64) (i64.const 0))
100 * (global (mut i64) (i64.const 0))
101 * (global (mut i64) (i64.const 0))
102 * (global (mut i64) (i64.const 0))
103 * (global (mut i64) (i64.const 0))
104 * (global (mut i64) (i64.const 0))
105 * (global (mut i64) (i64.const 0))
106 * (global (mut i64) (i64.const 0))
107 * (global (mut i64) (i64.const 0))
108 * (global (mut i64) (i64.const 0))
109 * (global (mut i64) (i64.const 0))
110 * (global (mut i32) (i32.const 0))
111 * (global (mut i32) (i32.const 0))
112 * (global (mut i32) (i32.const 0))
113 * (global (mut i32) (i32.const 0))
114 * (global (mut i32) (i32.const 0))
115 * (global (mut i32) (i32.const 0))
116 * (global (mut i32) (i32.const 0))
117 * (global (mut i32) (i32.const 0))
118 * (global (mut i32) (i32.const 0))
119 * (global (mut i32) (i32.const 0))
120 * (global (mut i32) (i32.const 0))
121 * (global (mut i32) (i32.const 0))
122 * (global (mut i32) (i32.const 0))
123 * (global (mut i32) (i32.const 0))
124 * (global (mut i32) (i32.const 0))
125 * (global (mut i32) (i32.const 0))
126 * (global (mut i32) (i32.const 0))
127 * (global (mut i32) (i32.const 0))
128 * (global (mut i32) (i32.const 0))
129 * (global (mut i32) (i32.const 0))
130 * (global (mut i32) (i32.const 0))
131 * (global (mut i32) (i32.const 0))
132 * (global (mut i32) (i32.const 0))
133 * (global (mut i32) (i32.const 0))
134 * (global (mut i32) (i32.const 0))
135 * (global (mut i32) (i32.const 0))
136 * (global (mut i32) (i32.const 0))
137 * (global (mut i32) (i32.const 0))
138 * (global (mut i32) (i32.const 0))
139 * (global (mut i32) (i32.const 0))
140 * (global (mut i32) (i32.const 0))
141 * (global (mut i32) (i32.const 0))
142 * (global (mut i64) (i64.const 0))
143 * (global (mut i64) (i64.const 0))
144 * (global (mut i64) (i64.const 0))
145 * (global (mut i64) (i64.const 0))
146 * (global (mut i64) (i64.const 0))
147 * (global (mut i64) (i64.const 0))
148 * (global (mut i64) (i64.const 0))
149 * (global (mut i64) (i64.const 0))
150 * (global (mut i64) (i64.const 0))
151 * (global (mut i64) (i64.const 0))
152 * (global (mut i64) (i64.const 0))
153 * (global (mut i64) (i64.const 0))
154 * (global (mut i64) (i64.const 0))
155 * (global (mut i64) (i64.const 0))
156 * (global (mut i64) (i64.const 0))
157 * (global (mut i64) (i64.const 0))
158 * (global (mut i32) (i32.const 0))
159 * (global (mut i32) (i32.const 0))
160 * (global (mut i32) (i32.const 0))
161 * (global (mut i32) (i32.const 0))
162 * (global (mut i32) (i32.const 0))
163 * (global (mut i32) (i32.const 0))
164 * (global (mut i32) (i32.const 0))
165 * (global (mut i32) (i32.const 0))
166 * (global (mut i32) (i32.const 0))
167 * (global (mut i32) (i32.const 0))
168 * (global (mut i32) (i32.const 0))
169 * (global (mut i32) (i32.const 0))
170 * (global (mut i32) (i32.const 0))
171 * (global (mut i32) (i32.const 0))
172 * (global (mut i32) (i32.const 0))
173 * (global (mut i32) (i32.const 0))
174 * (global (mut i32) (i32.const 0))
175 * (global (mut i32) (i32.const 0))
176 * (global (mut i32) (i32.const 0))
177 * (global (mut i32) (i32.const 0))
178 * (global (mut i32) (i32.const 0))
179 * (global (mut i32) (i32.const 0))
180 * (global (mut i32) (i32.const 0))
181 * (global (mut i32) (i32.const 0))
182 * (global (mut i32) (i32.const 0))
183 * (global (mut i32) (i32.const 0))
184 * (global (mut i32) (i32.const 0))
185 * (global (mut i32) (i32.const 0))
186 * (global (mut i32) (i32.const 0))
187 * (global (mut i32) (i32.const 0))
188 * (global (mut i32) (i32.const 0))
189 * (global (mut i32) (i32.const 0))
190 * (global (mut i64) (i64.const 0))
191 * (global (mut i64) (i64.const 0))
192 * (global (mut i64) (i64.const 0))
193 * (global (mut i64) (i64.const 0))
194 * (global (mut i64) (i64.const 0))
195 * (global (mut i64) (i64.const 0))
196 * (global (mut i64) (i64.const 0))
197 * (global (mut i64) (i64.const 0))
198 * (global (mut i64) (i64.const 0))
199 * (global (mut i64) (i64.const 0))
200 * (global (mut i64) (i64.const 0))
201 * (global (mut i64) (i64.const 0))
202 * (global (mut i64) (i64.const 0))
203 * (global (mut i64) (i64.const 0))
204 * (global (mut i64) (i64.const 0))
205 * (global (mut i64) (i64.const 0))
206 * (global (mut i32) (i32.const 0))
207 * )
208 */
209
210std::vector<uint8_t> _1024_bytes_mixed_wasm = {
211 0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00, 0x06, 0xc2, 0x07, 0xc0,
212 0x01, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f,
213 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41,
214 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b,
215 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01,
216 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00,
217 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f,
218 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41,
219 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b,
220 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01,
221 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00,
222 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f,
223 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41,
224 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b,
225 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01,
226 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00,
227 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e,
228 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42,
229 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b,
230 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01,
231 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00,
232 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f,
233 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41,
234 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b,
235 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01,
236 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00,
237 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f,
238 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41,
239 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b,
240 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01,
241 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00,
242 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f,
243 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41,
244 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b,
245 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01,
246 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00,
247 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e,
248 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42,
249 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b,
250 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01,
251 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00,
252 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f,
253 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41,
254 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b,
255 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01,
256 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00,
257 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f,
258 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41,
259 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b,
260 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01,
261 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00,
262 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f,
263 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41,
264 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b,
265 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01,
266 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00,
267 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e,
268 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42,
269 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b,
270 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01,
271 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00,
272 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f,
273 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41,
274 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b,
275 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01,
276 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00,
277 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f,
278 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41,
279 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b,
280 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01,
281 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00,
282 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f,
283 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41,
284 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b,
285 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01,
286 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00,
287 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e,
288 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42,
289 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b,
290 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01,
291 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00,
292 0x0b
293};
294
295/*
296 * (module
297 * (global (mut i32) (i32.const 0))
298 * (global (mut i32) (i32.const 0))
299 * (global (mut i32) (i32.const 0))
300 * (global (mut i32) (i32.const 0))
301 * (global (mut i32) (i32.const 0))
302 * (global (mut i32) (i32.const 0))
303 * (global (mut i32) (i32.const 0))
304 * (global (mut i32) (i32.const 0))
305 * (global (mut i32) (i32.const 0))
306 * (global (mut i32) (i32.const 0))
307 * (global (mut i32) (i32.const 0))
308 * (global (mut i32) (i32.const 0))
309 * (global (mut i32) (i32.const 0))
310 * (global (mut i32) (i32.const 0))
311 * (global (mut i32) (i32.const 0))
312 * (global (mut i32) (i32.const 0))
313 * (global (mut i32) (i32.const 0))
314 * (global (mut i32) (i32.const 0))
315 * (global (mut i32) (i32.const 0))
316 * (global (mut i32) (i32.const 0))
317 * (global (mut i32) (i32.const 0))
318 * (global (mut i32) (i32.const 0))
319 * (global (mut i32) (i32.const 0))
320 * (global (mut i32) (i32.const 0))
321 * (global (mut i32) (i32.const 0))
322 * (global (mut i32) (i32.const 0))
323 * (global (mut i32) (i32.const 0))
324 * (global (mut i32) (i32.const 0))
325 * (global (mut i32) (i32.const 0))
326 * (global (mut i32) (i32.const 0))
327 * (global (mut i32) (i32.const 0))
328 * (global (mut i32) (i32.const 0))
329 * (global (mut i64) (i64.const 0))
330 * (global (mut i64) (i64.const 0))
331 * (global (mut i64) (i64.const 0))
332 * (global (mut i64) (i64.const 0))
333 * (global (mut i64) (i64.const 0))
334 * (global (mut i64) (i64.const 0))
335 * (global (mut i64) (i64.const 0))
336 * (global (mut i64) (i64.const 0))
337 * (global (mut i64) (i64.const 0))
338 * (global (mut i64) (i64.const 0))
339 * (global (mut i64) (i64.const 0))
340 * (global (mut i64) (i64.const 0))
341 * (global (mut i64) (i64.const 0))
342 * (global (mut i64) (i64.const 0))
343 * (global (mut i64) (i64.const 0))
344 * (global (mut i64) (i64.const 0))
345 * (global (mut i32) (i32.const 0))
346 * (global (mut i32) (i32.const 0))
347 * (global (mut i32) (i32.const 0))
348 * (global (mut i32) (i32.const 0))
349 * (global (mut i32) (i32.const 0))
350 * (global (mut i32) (i32.const 0))
351 * (global (mut i32) (i32.const 0))
352 * (global (mut i32) (i32.const 0))
353 * (global (mut i32) (i32.const 0))
354 * (global (mut i32) (i32.const 0))
355 * (global (mut i32) (i32.const 0))
356 * (global (mut i32) (i32.const 0))
357 * (global (mut i32) (i32.const 0))
358 * (global (mut i32) (i32.const 0))
359 * (global (mut i32) (i32.const 0))
360 * (global (mut i32) (i32.const 0))
361 * (global (mut i32) (i32.const 0))
362 * (global (mut i32) (i32.const 0))
363 * (global (mut i32) (i32.const 0))
364 * (global (mut i32) (i32.const 0))
365 * (global (mut i32) (i32.const 0))
366 * (global (mut i32) (i32.const 0))
367 * (global (mut i32) (i32.const 0))
368 * (global (mut i32) (i32.const 0))
369 * (global (mut i32) (i32.const 0))
370 * (global (mut i32) (i32.const 0))
371 * (global (mut i32) (i32.const 0))
372 * (global (mut i32) (i32.const 0))
373 * (global (mut i32) (i32.const 0))
374 * (global (mut i32) (i32.const 0))
375 * (global (mut i32) (i32.const 0))
376 * (global (mut i32) (i32.const 0))
377 * (global (mut i64) (i64.const 0))
378 * (global (mut i64) (i64.const 0))
379 * (global (mut i64) (i64.const 0))
380 * (global (mut i64) (i64.const 0))
381 * (global (mut i64) (i64.const 0))
382 * (global (mut i64) (i64.const 0))
383 * (global (mut i64) (i64.const 0))
384 * (global (mut i64) (i64.const 0))
385 * (global (mut i64) (i64.const 0))
386 * (global (mut i64) (i64.const 0))
387 * (global (mut i64) (i64.const 0))
388 * (global (mut i64) (i64.const 0))
389 * (global (mut i64) (i64.const 0))
390 * (global (mut i64) (i64.const 0))
391 * (global (mut i64) (i64.const 0))
392 * (global (mut i64) (i64.const 0))
393 * (global (mut i32) (i32.const 0))
394 * (global (mut i32) (i32.const 0))
395 * (global (mut i32) (i32.const 0))
396 * (global (mut i32) (i32.const 0))
397 * (global (mut i32) (i32.const 0))
398 * (global (mut i32) (i32.const 0))
399 * (global (mut i32) (i32.const 0))
400 * (global (mut i32) (i32.const 0))
401 * (global (mut i32) (i32.const 0))
402 * (global (mut i32) (i32.const 0))
403 * (global (mut i32) (i32.const 0))
404 * (global (mut i32) (i32.const 0))
405 * (global (mut i32) (i32.const 0))
406 * (global (mut i32) (i32.const 0))
407 * (global (mut i32) (i32.const 0))
408 * (global (mut i32) (i32.const 0))
409 * (global (mut i32) (i32.const 0))
410 * (global (mut i32) (i32.const 0))
411 * (global (mut i32) (i32.const 0))
412 * (global (mut i32) (i32.const 0))
413 * (global (mut i32) (i32.const 0))
414 * (global (mut i32) (i32.const 0))
415 * (global (mut i32) (i32.const 0))
416 * (global (mut i32) (i32.const 0))
417 * (global (mut i32) (i32.const 0))
418 * (global (mut i32) (i32.const 0))
419 * (global (mut i32) (i32.const 0))
420 * (global (mut i32) (i32.const 0))
421 * (global (mut i32) (i32.const 0))
422 * (global (mut i32) (i32.const 0))
423 * (global (mut i32) (i32.const 0))
424 * (global (mut i32) (i32.const 0))
425 * (global (mut i64) (i64.const 0))
426 * (global (mut i64) (i64.const 0))
427 * (global (mut i64) (i64.const 0))
428 * (global (mut i64) (i64.const 0))
429 * (global (mut i64) (i64.const 0))
430 * (global (mut i64) (i64.const 0))
431 * (global (mut i64) (i64.const 0))
432 * (global (mut i64) (i64.const 0))
433 * (global (mut i64) (i64.const 0))
434 * (global (mut i64) (i64.const 0))
435 * (global (mut i64) (i64.const 0))
436 * (global (mut i64) (i64.const 0))
437 * (global (mut i64) (i64.const 0))
438 * (global (mut i64) (i64.const 0))
439 * (global (mut i64) (i64.const 0))
440 * (global (mut i64) (i64.const 0))
441 * (global (mut i32) (i32.const 0))
442 * (global (mut i32) (i32.const 0))
443 * (global (mut i32) (i32.const 0))
444 * (global (mut i32) (i32.const 0))
445 * (global (mut i32) (i32.const 0))
446 * (global (mut i32) (i32.const 0))
447 * (global (mut i32) (i32.const 0))
448 * (global (mut i32) (i32.const 0))
449 * (global (mut i32) (i32.const 0))
450 * (global (mut i32) (i32.const 0))
451 * (global (mut i32) (i32.const 0))
452 * (global (mut i32) (i32.const 0))
453 * (global (mut i32) (i32.const 0))
454 * (global (mut i32) (i32.const 0))
455 * (global (mut i32) (i32.const 0))
456 * (global (mut i32) (i32.const 0))
457 * (global (mut i32) (i32.const 0))
458 * (global (mut i32) (i32.const 0))
459 * (global (mut i32) (i32.const 0))
460 * (global (mut i32) (i32.const 0))
461 * (global (mut i32) (i32.const 0))
462 * (global (mut i32) (i32.const 0))
463 * (global (mut i32) (i32.const 0))
464 * (global (mut i32) (i32.const 0))
465 * (global (mut i32) (i32.const 0))
466 * (global (mut i32) (i32.const 0))
467 * (global (mut i32) (i32.const 0))
468 * (global (mut i32) (i32.const 0))
469 * (global (mut i32) (i32.const 0))
470 * (global (mut i32) (i32.const 0))
471 * (global (mut i32) (i32.const 0))
472 * (global (mut i32) (i32.const 0))
473 * (global (mut i64) (i64.const 0))
474 * (global (mut i64) (i64.const 0))
475 * (global (mut i64) (i64.const 0))
476 * (global (mut i64) (i64.const 0))
477 * (global (mut i64) (i64.const 0))
478 * (global (mut i64) (i64.const 0))
479 * (global (mut i64) (i64.const 0))
480 * (global (mut i64) (i64.const 0))
481 * (global (mut i64) (i64.const 0))
482 * (global (mut i64) (i64.const 0))
483 * (global (mut i64) (i64.const 0))
484 * (global (mut i64) (i64.const 0))
485 * (global (mut i64) (i64.const 0))
486 * (global (mut i64) (i64.const 0))
487 * (global (mut i64) (i64.const 0))
488 * (global (mut i64) (i64.const 0))
489 * )
490 */
491
492std::vector<uint8_t> _1028_bytes_mixed_wasm = {
493 0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00, 0x06, 0xc7, 0x07, 0xc1,
494 0x01, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f,
495 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41,
496 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b,
497 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01,
498 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00,
499 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f,
500 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41,
501 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b,
502 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01,
503 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00,
504 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f,
505 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41,
506 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b,
507 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01,
508 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00,
509 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e,
510 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42,
511 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b,
512 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01,
513 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00,
514 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f,
515 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41,
516 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b,
517 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01,
518 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00,
519 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f,
520 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41,
521 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b,
522 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01,
523 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00,
524 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f,
525 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41,
526 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b,
527 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01,
528 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00,
529 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e,
530 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42,
531 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b,
532 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01,
533 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00,
534 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f,
535 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41,
536 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b,
537 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01,
538 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00,
539 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f,
540 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41,
541 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b,
542 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01,
543 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00,
544 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f,
545 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41,
546 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b,
547 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01,
548 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00,
549 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e,
550 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42,
551 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b,
552 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01,
553 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00,
554 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f,
555 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41,
556 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b,
557 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01,
558 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00,
559 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f,
560 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41,
561 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b,
562 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01,
563 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00,
564 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f,
565 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41,
566 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b,
567 0x7f, 0x01, 0x41, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01,
568 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00,
569 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e,
570 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42,
571 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b,
572 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01,
573 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00, 0x0b, 0x7e, 0x01, 0x42, 0x00,
574 0x0b, 0x7f, 0x01, 0x41, 0x00, 0x0b
575};
576
577struct empty_options {};
578struct dynamic_options {
579 std::uint32_t max_mutable_global_bytes;
580};
581struct static_options {
582 static constexpr std::uint32_t max_mutable_global_bytes = 1024;
583};
584struct small_options {
585 static constexpr std::uint8_t max_mutable_global_bytes = 255;
586};
587
588}
589
590BACKEND_TEST_CASE("Test max_mutable_global_bytes default", "[max_mutable_global_bytes_test]") {
592 backend_t backend1024(_1024_bytes_mixed_wasm, &wa);
593 backend_t backend1028(_1028_bytes_mixed_wasm, &wa);
594}
595
596BACKEND_TEST_CASE("Test max_mutable_global_bytes static", "[max_mutable_global_bytes_test]") {
598 backend_t backend(_1024_bytes_mixed_wasm, &wa);
599 CHECK_THROWS_AS(backend_t(_1028_bytes_mixed_wasm, &wa), wasm_parse_exception);
600}
601
602BACKEND_TEST_CASE("Test max_mutable_global_bytes unlimited", "[max_mutable_global_bytes_test]") {
604 backend_t backend1024(_1024_bytes_mixed_wasm, &wa);
605 backend_t backend1028(_1028_bytes_mixed_wasm, &wa);
606}
607
608BACKEND_TEST_CASE("Test max_mutable_global_bytes dynamic", "[max_mutable_global_bytes_test]") {
610 backend_t backend1024(_1024_bytes_mixed_wasm, nullptr, dynamic_options{1024});
611 CHECK_THROWS_AS(backend_t(_1028_bytes_mixed_wasm, nullptr, dynamic_options{1024}), wasm_parse_exception);
612 backend_t backend1028(_1028_bytes_mixed_wasm, nullptr, dynamic_options{1028});
613}
614
615BACKEND_TEST_CASE("Test max_mutable_global_bytes small", "[max_mutable_global_bytes_test]") {
617 CHECK_THROWS_AS(backend_t(_1024_bytes_mixed_wasm, &wa), wasm_parse_exception);
618 CHECK_THROWS_AS(backend_t(_1028_bytes_mixed_wasm, &wa), wasm_parse_exception);
619}
sysio::vm::backend< rhf_t > backend_t
#define CHECK_THROWS_AS(expr, exceptionType)
Definition catch.hpp:203
wasm_allocator wa
Definition main.cpp:10
#define BACKEND_TEST_CASE(name, tags)
Definition utils.hpp:59