85 {
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
159 0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00, 0x01, 0x17, 0x04, 0x60,
160 0x03, 0x7f, 0x7f, 0x7f, 0x00, 0x60, 0x02, 0x7f, 0x7d, 0x00, 0x60, 0x00,
161 0x00, 0x60, 0x05, 0x7d, 0x7f, 0x7f, 0x7f, 0x7f, 0x00, 0x02, 0x5b, 0x05,
162 0x03, 0x65, 0x6e, 0x76, 0x0b, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x66, 0x75,
163 0x6e, 0x63, 0x5f, 0x62, 0x00, 0x00, 0x03, 0x65, 0x6e, 0x76, 0x0b, 0x74,
164 0x65, 0x73, 0x74, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x5f, 0x61, 0x00, 0x01,
165 0x03, 0x65, 0x6e, 0x76, 0x0b, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x66, 0x75,
166 0x6e, 0x63, 0x5f, 0x63, 0x00, 0x03, 0x03, 0x65, 0x6e, 0x76, 0x0b, 0x74,
167 0x65, 0x73, 0x74, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x5f, 0x64, 0x00, 0x02,
168 0x03, 0x65, 0x6e, 0x76, 0x0b, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x66, 0x75,
169 0x6e, 0x63, 0x5f, 0x65, 0x00, 0x03, 0x03, 0x0a, 0x09, 0x02, 0x02, 0x02,
170 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x05, 0x03, 0x01, 0x00, 0x01, 0x07,
171 0x7f, 0x09, 0x0b, 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x74, 0x65, 0x73, 0x74,
172 0x5f, 0x61, 0x00, 0x05, 0x0b, 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x74, 0x65,
173 0x73, 0x74, 0x5f, 0x62, 0x00, 0x06, 0x0b, 0x63, 0x61, 0x6c, 0x6c, 0x5f,
174 0x74, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x00, 0x07, 0x0b, 0x63, 0x61, 0x6c,
175 0x6c, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x64, 0x00, 0x08, 0x0b, 0x63,
176 0x61, 0x6c, 0x6c, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x65, 0x00, 0x09,
177 0x0b, 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x66,
178 0x00, 0x0a, 0x0b, 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x74, 0x65, 0x73, 0x74,
179 0x5f, 0x67, 0x00, 0x0b, 0x0b, 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x74, 0x65,
180 0x73, 0x74, 0x5f, 0x68, 0x00, 0x0c, 0x0b, 0x63, 0x61, 0x6c, 0x6c, 0x5f,
181 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6a, 0x00, 0x0d, 0x0a, 0x8b, 0x01, 0x09,
182 0x0b, 0x00, 0x41, 0x2a, 0x43, 0x14, 0xae, 0x29, 0x42, 0x10, 0x01, 0x0b,
183 0x10, 0x00, 0x41, 0x90, 0xc0, 0x00, 0x41, 0xa8, 0xc0, 0x00, 0x41, 0xa8,
184 0xc0, 0x00, 0x10, 0x00, 0x0b, 0x0b, 0x00, 0x41, 0x20, 0x43, 0x00, 0x00,
185 0x28, 0x42, 0x10, 0x01, 0x0b, 0x0b, 0x00, 0x41, 0x2a, 0x43, 0x00, 0x00,
186 0x00, 0x42, 0x10, 0x01, 0x0b, 0x0a, 0x00, 0x41, 0x00, 0x41, 0x00, 0x41,
187 0x00, 0x10, 0x00, 0x0b, 0x16, 0x00, 0x43, 0x14, 0xae, 0x29, 0x42, 0x41,
188 0x90, 0xc0, 0x00, 0x41, 0x90, 0xc0, 0x00, 0x41, 0x07, 0x41, 0xcd, 0x00,
189 0x10, 0x02, 0x0b, 0x16, 0x00, 0x43, 0x14, 0xae, 0x29, 0x42, 0x41, 0xa8,
190 0xc0, 0x00, 0x41, 0xa8, 0xc0, 0x00, 0x41, 0x04, 0x41, 0xcd, 0x00, 0x10,
191 0x02, 0x0b, 0x04, 0x00, 0x10, 0x03, 0x0b, 0x16, 0x00, 0x43, 0x14, 0xae,
192 0x29, 0x42, 0x41, 0xa8, 0xc0, 0x00, 0x41, 0xa8, 0xc0, 0x00, 0x41, 0x04,
193 0x41, 0xcd, 0x00, 0x10, 0x04, 0x0b, 0x0b, 0x1e, 0x02, 0x00, 0x41, 0x90,
194 0xc0, 0x00, 0x0b, 0x0b, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x68, 0x65, 0x6c,
195 0x6c, 0x6f, 0x00, 0x00, 0x41, 0xa8, 0xc0, 0x00, 0x0b, 0x04, 0xff, 0xff,
196 0xff, 0xff
197 };
198
204
207
208 check = 0;
209 check2 = 0;
210 bkend(
"env",
"call_test_a");
211 bkend(
"env",
"call_test_b");
214 bkend(
"env",
"call_test_e");
216 bkend(
"env",
"call_test_f");
218
219
220 check = 0;
223
224 bkend(
"env",
"call_test_h");
226 bkend(
"env",
"call_test_h");
228
229 check2 = 0;
230 bkend(
"env",
"call_test_j");
232 bkend(
"env",
"call_test_j");
234}
backend_t bkend(hello_wasm, ehm, &wa)
std::vector< uint8_t > wasm_code
#define CHECK_MSG(Msg,...)
static void add(const std::string &mod, const std::string &name)