Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
br_table_tests.cpp
Go to the documentation of this file.
1// Generated by spec_test_generator. DO NOT MODIFY THIS FILE.
2
3#include <algorithm>
4#include <vector>
5#include <iostream>
6#include <iterator>
7#include <cmath>
8#include <cstdlib>
9#include <catch2/catch.hpp>
10#include <utils.hpp>
11#include <wasm_config.hpp>
12#include <sysio/vm/backend.hpp>
13
14using namespace sysio;
15using namespace sysio::vm;
16extern wasm_allocator wa;
17
18BACKEND_TEST_CASE( "Testing wasm <br_table_0_wasm>", "[br_table_0_wasm_tests]" ) {
20 auto code = read_wasm( std::string(wasm_directory) + "br_table.0.wasm");
21 backend_t bkend( code, &wa );
22
23 CHECK(!bkend.call_with_return("env", "type-i32"));
24 CHECK(!bkend.call_with_return("env", "type-i64"));
25 CHECK(!bkend.call_with_return("env", "type-f32"));
26 CHECK(!bkend.call_with_return("env", "type-f64"));
27 CHECK(bkend.call_with_return("env", "type-i32-value")->to_ui32() == UINT32_C(1));
28 CHECK(bkend.call_with_return("env", "type-i64-value")->to_ui64() == UINT32_C(2));
29 CHECK(bit_cast<uint32_t>(bkend.call_with_return("env", "type-f32-value")->to_f32()) == UINT32_C(1077936128));
30 CHECK(bit_cast<uint64_t>(bkend.call_with_return("env", "type-f64-value")->to_f64()) == UINT64_C(4616189618054758400));
31 CHECK(bkend.call_with_return("env", "empty", UINT32_C(0))->to_ui32() == UINT32_C(22));
32 CHECK(bkend.call_with_return("env", "empty", UINT32_C(1))->to_ui32() == UINT32_C(22));
33 CHECK(bkend.call_with_return("env", "empty", UINT32_C(11))->to_ui32() == UINT32_C(22));
34 CHECK(bkend.call_with_return("env", "empty", UINT32_C(4294967295))->to_ui32() == UINT32_C(22));
35 CHECK(bkend.call_with_return("env", "empty", UINT32_C(4294967196))->to_ui32() == UINT32_C(22));
36 CHECK(bkend.call_with_return("env", "empty", UINT32_C(4294967295))->to_ui32() == UINT32_C(22));
37 CHECK(bkend.call_with_return("env", "empty-value", UINT32_C(0))->to_ui32() == UINT32_C(33));
38 CHECK(bkend.call_with_return("env", "empty-value", UINT32_C(1))->to_ui32() == UINT32_C(33));
39 CHECK(bkend.call_with_return("env", "empty-value", UINT32_C(11))->to_ui32() == UINT32_C(33));
40 CHECK(bkend.call_with_return("env", "empty-value", UINT32_C(4294967295))->to_ui32() == UINT32_C(33));
41 CHECK(bkend.call_with_return("env", "empty-value", UINT32_C(4294967196))->to_ui32() == UINT32_C(33));
42 CHECK(bkend.call_with_return("env", "empty-value", UINT32_C(4294967295))->to_ui32() == UINT32_C(33));
43 CHECK(bkend.call_with_return("env", "singleton", UINT32_C(0))->to_ui32() == UINT32_C(22));
44 CHECK(bkend.call_with_return("env", "singleton", UINT32_C(1))->to_ui32() == UINT32_C(20));
45 CHECK(bkend.call_with_return("env", "singleton", UINT32_C(11))->to_ui32() == UINT32_C(20));
46 CHECK(bkend.call_with_return("env", "singleton", UINT32_C(4294967295))->to_ui32() == UINT32_C(20));
47 CHECK(bkend.call_with_return("env", "singleton", UINT32_C(4294967196))->to_ui32() == UINT32_C(20));
48 CHECK(bkend.call_with_return("env", "singleton", UINT32_C(4294967295))->to_ui32() == UINT32_C(20));
49 CHECK(bkend.call_with_return("env", "singleton-value", UINT32_C(0))->to_ui32() == UINT32_C(32));
50 CHECK(bkend.call_with_return("env", "singleton-value", UINT32_C(1))->to_ui32() == UINT32_C(33));
51 CHECK(bkend.call_with_return("env", "singleton-value", UINT32_C(11))->to_ui32() == UINT32_C(33));
52 CHECK(bkend.call_with_return("env", "singleton-value", UINT32_C(4294967295))->to_ui32() == UINT32_C(33));
53 CHECK(bkend.call_with_return("env", "singleton-value", UINT32_C(4294967196))->to_ui32() == UINT32_C(33));
54 CHECK(bkend.call_with_return("env", "singleton-value", UINT32_C(4294967295))->to_ui32() == UINT32_C(33));
55 CHECK(bkend.call_with_return("env", "multiple", UINT32_C(0))->to_ui32() == UINT32_C(103));
56 CHECK(bkend.call_with_return("env", "multiple", UINT32_C(1))->to_ui32() == UINT32_C(102));
57 CHECK(bkend.call_with_return("env", "multiple", UINT32_C(2))->to_ui32() == UINT32_C(101));
58 CHECK(bkend.call_with_return("env", "multiple", UINT32_C(3))->to_ui32() == UINT32_C(100));
59 CHECK(bkend.call_with_return("env", "multiple", UINT32_C(4))->to_ui32() == UINT32_C(104));
60 CHECK(bkend.call_with_return("env", "multiple", UINT32_C(5))->to_ui32() == UINT32_C(104));
61 CHECK(bkend.call_with_return("env", "multiple", UINT32_C(6))->to_ui32() == UINT32_C(104));
62 CHECK(bkend.call_with_return("env", "multiple", UINT32_C(10))->to_ui32() == UINT32_C(104));
63 CHECK(bkend.call_with_return("env", "multiple", UINT32_C(4294967295))->to_ui32() == UINT32_C(104));
64 CHECK(bkend.call_with_return("env", "multiple", UINT32_C(4294967295))->to_ui32() == UINT32_C(104));
65 CHECK(bkend.call_with_return("env", "multiple-value", UINT32_C(0))->to_ui32() == UINT32_C(213));
66 CHECK(bkend.call_with_return("env", "multiple-value", UINT32_C(1))->to_ui32() == UINT32_C(212));
67 CHECK(bkend.call_with_return("env", "multiple-value", UINT32_C(2))->to_ui32() == UINT32_C(211));
68 CHECK(bkend.call_with_return("env", "multiple-value", UINT32_C(3))->to_ui32() == UINT32_C(210));
69 CHECK(bkend.call_with_return("env", "multiple-value", UINT32_C(4))->to_ui32() == UINT32_C(214));
70 CHECK(bkend.call_with_return("env", "multiple-value", UINT32_C(5))->to_ui32() == UINT32_C(214));
71 CHECK(bkend.call_with_return("env", "multiple-value", UINT32_C(6))->to_ui32() == UINT32_C(214));
72 CHECK(bkend.call_with_return("env", "multiple-value", UINT32_C(10))->to_ui32() == UINT32_C(214));
73 CHECK(bkend.call_with_return("env", "multiple-value", UINT32_C(4294967295))->to_ui32() == UINT32_C(214));
74 CHECK(bkend.call_with_return("env", "multiple-value", UINT32_C(4294967295))->to_ui32() == UINT32_C(214));
75 CHECK(bkend.call_with_return("env", "large", UINT32_C(0))->to_ui32() == UINT32_C(0));
76 CHECK(bkend.call_with_return("env", "large", UINT32_C(1))->to_ui32() == UINT32_C(1));
77 CHECK(bkend.call_with_return("env", "large", UINT32_C(100))->to_ui32() == UINT32_C(0));
78 CHECK(bkend.call_with_return("env", "large", UINT32_C(101))->to_ui32() == UINT32_C(1));
79 CHECK(bkend.call_with_return("env", "large", UINT32_C(10000))->to_ui32() == UINT32_C(0));
80 CHECK(bkend.call_with_return("env", "large", UINT32_C(10001))->to_ui32() == UINT32_C(1));
81 CHECK(bkend.call_with_return("env", "large", UINT32_C(1000000))->to_ui32() == UINT32_C(1));
82 CHECK(bkend.call_with_return("env", "large", UINT32_C(1000001))->to_ui32() == UINT32_C(1));
83 CHECK(!bkend.call_with_return("env", "as-block-first"));
84 CHECK(!bkend.call_with_return("env", "as-block-mid"));
85 CHECK(!bkend.call_with_return("env", "as-block-last"));
86 CHECK(bkend.call_with_return("env", "as-block-value")->to_ui32() == UINT32_C(2));
87 CHECK(bkend.call_with_return("env", "as-loop-first")->to_ui32() == UINT32_C(3));
88 CHECK(bkend.call_with_return("env", "as-loop-mid")->to_ui32() == UINT32_C(4));
89 CHECK(bkend.call_with_return("env", "as-loop-last")->to_ui32() == UINT32_C(5));
90 CHECK(bkend.call_with_return("env", "as-br-value")->to_ui32() == UINT32_C(9));
91 CHECK(!bkend.call_with_return("env", "as-br_if-cond"));
92 CHECK(bkend.call_with_return("env", "as-br_if-value")->to_ui32() == UINT32_C(8));
93 CHECK(bkend.call_with_return("env", "as-br_if-value-cond")->to_ui32() == UINT32_C(9));
94 CHECK(!bkend.call_with_return("env", "as-br_table-index"));
95 CHECK(bkend.call_with_return("env", "as-br_table-value")->to_ui32() == UINT32_C(10));
96 CHECK(bkend.call_with_return("env", "as-br_table-value-index")->to_ui32() == UINT32_C(11));
97 CHECK(bkend.call_with_return("env", "as-return-value")->to_ui64() == UINT32_C(7));
98 CHECK(bkend.call_with_return("env", "as-if-cond")->to_ui32() == UINT32_C(2));
99 CHECK(bkend.call_with_return("env", "as-if-then", UINT32_C(1), UINT32_C(6))->to_ui32() == UINT32_C(3));
100 CHECK(bkend.call_with_return("env", "as-if-then", UINT32_C(0), UINT32_C(6))->to_ui32() == UINT32_C(6));
101 CHECK(bkend.call_with_return("env", "as-if-else", UINT32_C(0), UINT32_C(6))->to_ui32() == UINT32_C(4));
102 CHECK(bkend.call_with_return("env", "as-if-else", UINT32_C(1), UINT32_C(6))->to_ui32() == UINT32_C(6));
103 CHECK(bkend.call_with_return("env", "as-select-first", UINT32_C(0), UINT32_C(6))->to_ui32() == UINT32_C(5));
104 CHECK(bkend.call_with_return("env", "as-select-first", UINT32_C(1), UINT32_C(6))->to_ui32() == UINT32_C(5));
105 CHECK(bkend.call_with_return("env", "as-select-second", UINT32_C(0), UINT32_C(6))->to_ui32() == UINT32_C(6));
106 CHECK(bkend.call_with_return("env", "as-select-second", UINT32_C(1), UINT32_C(6))->to_ui32() == UINT32_C(6));
107 CHECK(bkend.call_with_return("env", "as-select-cond")->to_ui32() == UINT32_C(7));
108 CHECK(bkend.call_with_return("env", "as-call-first")->to_ui32() == UINT32_C(12));
109 CHECK(bkend.call_with_return("env", "as-call-mid")->to_ui32() == UINT32_C(13));
110 CHECK(bkend.call_with_return("env", "as-call-last")->to_ui32() == UINT32_C(14));
111 CHECK(bkend.call_with_return("env", "as-call_indirect-first")->to_ui32() == UINT32_C(20));
112 CHECK(bkend.call_with_return("env", "as-call_indirect-mid")->to_ui32() == UINT32_C(21));
113 CHECK(bkend.call_with_return("env", "as-call_indirect-last")->to_ui32() == UINT32_C(22));
114 CHECK(bkend.call_with_return("env", "as-call_indirect-func")->to_ui32() == UINT32_C(23));
115 CHECK(bkend.call_with_return("env", "as-local.set-value")->to_ui32() == UINT32_C(17));
116 CHECK(bkend.call_with_return("env", "as-local.tee-value")->to_ui32() == UINT32_C(1));
117 CHECK(bkend.call_with_return("env", "as-global.set-value")->to_ui32() == UINT32_C(1));
118 CHECK(bit_cast<uint32_t>(bkend.call_with_return("env", "as-load-address")->to_f32()) == UINT32_C(1071225242));
119 CHECK(bkend.call_with_return("env", "as-loadN-address")->to_ui64() == UINT32_C(30));
120 CHECK(bkend.call_with_return("env", "as-store-address")->to_ui32() == UINT32_C(30));
121 CHECK(bkend.call_with_return("env", "as-store-value")->to_ui32() == UINT32_C(31));
122 CHECK(bkend.call_with_return("env", "as-storeN-address")->to_ui32() == UINT32_C(32));
123 CHECK(bkend.call_with_return("env", "as-storeN-value")->to_ui32() == UINT32_C(33));
124 CHECK(bit_cast<uint32_t>(bkend.call_with_return("env", "as-unary-operand")->to_f32()) == UINT32_C(1079613850));
125 CHECK(bkend.call_with_return("env", "as-binary-left")->to_ui32() == UINT32_C(3));
126 CHECK(bkend.call_with_return("env", "as-binary-right")->to_ui64() == UINT32_C(45));
127 CHECK(bkend.call_with_return("env", "as-test-operand")->to_ui32() == UINT32_C(44));
128 CHECK(bkend.call_with_return("env", "as-compare-left")->to_ui32() == UINT32_C(43));
129 CHECK(bkend.call_with_return("env", "as-compare-right")->to_ui32() == UINT32_C(42));
130 CHECK(bkend.call_with_return("env", "as-convert-operand")->to_ui32() == UINT32_C(41));
131 CHECK(bkend.call_with_return("env", "as-memory.grow-size")->to_ui32() == UINT32_C(40));
132 CHECK(bkend.call_with_return("env", "nested-block-value", UINT32_C(0))->to_ui32() == UINT32_C(19));
133 CHECK(bkend.call_with_return("env", "nested-block-value", UINT32_C(1))->to_ui32() == UINT32_C(17));
134 CHECK(bkend.call_with_return("env", "nested-block-value", UINT32_C(2))->to_ui32() == UINT32_C(16));
135 CHECK(bkend.call_with_return("env", "nested-block-value", UINT32_C(10))->to_ui32() == UINT32_C(16));
136 CHECK(bkend.call_with_return("env", "nested-block-value", UINT32_C(4294967295))->to_ui32() == UINT32_C(16));
137 CHECK(bkend.call_with_return("env", "nested-block-value", UINT32_C(100000))->to_ui32() == UINT32_C(16));
138 CHECK(bkend.call_with_return("env", "nested-br-value", UINT32_C(0))->to_ui32() == UINT32_C(8));
139 CHECK(bkend.call_with_return("env", "nested-br-value", UINT32_C(1))->to_ui32() == UINT32_C(9));
140 CHECK(bkend.call_with_return("env", "nested-br-value", UINT32_C(2))->to_ui32() == UINT32_C(17));
141 CHECK(bkend.call_with_return("env", "nested-br-value", UINT32_C(11))->to_ui32() == UINT32_C(17));
142 CHECK(bkend.call_with_return("env", "nested-br-value", UINT32_C(4294967292))->to_ui32() == UINT32_C(17));
143 CHECK(bkend.call_with_return("env", "nested-br-value", UINT32_C(10213210))->to_ui32() == UINT32_C(17));
144 CHECK(bkend.call_with_return("env", "nested-br_if-value", UINT32_C(0))->to_ui32() == UINT32_C(17));
145 CHECK(bkend.call_with_return("env", "nested-br_if-value", UINT32_C(1))->to_ui32() == UINT32_C(9));
146 CHECK(bkend.call_with_return("env", "nested-br_if-value", UINT32_C(2))->to_ui32() == UINT32_C(8));
147 CHECK(bkend.call_with_return("env", "nested-br_if-value", UINT32_C(9))->to_ui32() == UINT32_C(8));
148 CHECK(bkend.call_with_return("env", "nested-br_if-value", UINT32_C(4294967287))->to_ui32() == UINT32_C(8));
149 CHECK(bkend.call_with_return("env", "nested-br_if-value", UINT32_C(999999))->to_ui32() == UINT32_C(8));
150 CHECK(bkend.call_with_return("env", "nested-br_if-value-cond", UINT32_C(0))->to_ui32() == UINT32_C(9));
151 CHECK(bkend.call_with_return("env", "nested-br_if-value-cond", UINT32_C(1))->to_ui32() == UINT32_C(8));
152 CHECK(bkend.call_with_return("env", "nested-br_if-value-cond", UINT32_C(2))->to_ui32() == UINT32_C(9));
153 CHECK(bkend.call_with_return("env", "nested-br_if-value-cond", UINT32_C(3))->to_ui32() == UINT32_C(9));
154 CHECK(bkend.call_with_return("env", "nested-br_if-value-cond", UINT32_C(4293967296))->to_ui32() == UINT32_C(9));
155 CHECK(bkend.call_with_return("env", "nested-br_if-value-cond", UINT32_C(9423975))->to_ui32() == UINT32_C(9));
156 CHECK(bkend.call_with_return("env", "nested-br_table-value", UINT32_C(0))->to_ui32() == UINT32_C(17));
157 CHECK(bkend.call_with_return("env", "nested-br_table-value", UINT32_C(1))->to_ui32() == UINT32_C(9));
158 CHECK(bkend.call_with_return("env", "nested-br_table-value", UINT32_C(2))->to_ui32() == UINT32_C(8));
159 CHECK(bkend.call_with_return("env", "nested-br_table-value", UINT32_C(9))->to_ui32() == UINT32_C(8));
160 CHECK(bkend.call_with_return("env", "nested-br_table-value", UINT32_C(4294967287))->to_ui32() == UINT32_C(8));
161 CHECK(bkend.call_with_return("env", "nested-br_table-value", UINT32_C(999999))->to_ui32() == UINT32_C(8));
162 CHECK(bkend.call_with_return("env", "nested-br_table-value-index", UINT32_C(0))->to_ui32() == UINT32_C(9));
163 CHECK(bkend.call_with_return("env", "nested-br_table-value-index", UINT32_C(1))->to_ui32() == UINT32_C(8));
164 CHECK(bkend.call_with_return("env", "nested-br_table-value-index", UINT32_C(2))->to_ui32() == UINT32_C(9));
165 CHECK(bkend.call_with_return("env", "nested-br_table-value-index", UINT32_C(3))->to_ui32() == UINT32_C(9));
166 CHECK(bkend.call_with_return("env", "nested-br_table-value-index", UINT32_C(4293967296))->to_ui32() == UINT32_C(9));
167 CHECK(bkend.call_with_return("env", "nested-br_table-value-index", UINT32_C(9423975))->to_ui32() == UINT32_C(9));
168 CHECK(bkend.call_with_return("env", "nested-br_table-loop-block", UINT32_C(1))->to_ui32() == UINT32_C(3));
169}
170
171BACKEND_TEST_CASE( "Testing wasm <br_table_1_wasm>", "[br_table_1_wasm_tests]" ) {
173 auto code = read_wasm( std::string(wasm_directory) + "br_table.1.wasm");
174 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
175}
176
177BACKEND_TEST_CASE( "Testing wasm <br_table_10_wasm>", "[br_table_10_wasm_tests]" ) {
179 auto code = read_wasm( std::string(wasm_directory) + "br_table.10.wasm");
180 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
181}
182
183BACKEND_TEST_CASE( "Testing wasm <br_table_11_wasm>", "[br_table_11_wasm_tests]" ) {
185 auto code = read_wasm( std::string(wasm_directory) + "br_table.11.wasm");
186 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
187}
188
189BACKEND_TEST_CASE( "Testing wasm <br_table_12_wasm>", "[br_table_12_wasm_tests]" ) {
191 auto code = read_wasm( std::string(wasm_directory) + "br_table.12.wasm");
192 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
193}
194
195BACKEND_TEST_CASE( "Testing wasm <br_table_13_wasm>", "[br_table_13_wasm_tests]" ) {
197 auto code = read_wasm( std::string(wasm_directory) + "br_table.13.wasm");
198 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
199}
200
201BACKEND_TEST_CASE( "Testing wasm <br_table_14_wasm>", "[br_table_14_wasm_tests]" ) {
203 auto code = read_wasm( std::string(wasm_directory) + "br_table.14.wasm");
204 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
205}
206
207BACKEND_TEST_CASE( "Testing wasm <br_table_15_wasm>", "[br_table_15_wasm_tests]" ) {
209 auto code = read_wasm( std::string(wasm_directory) + "br_table.15.wasm");
210 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
211}
212
213BACKEND_TEST_CASE( "Testing wasm <br_table_16_wasm>", "[br_table_16_wasm_tests]" ) {
215 auto code = read_wasm( std::string(wasm_directory) + "br_table.16.wasm");
216 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
217}
218
219BACKEND_TEST_CASE( "Testing wasm <br_table_17_wasm>", "[br_table_17_wasm_tests]" ) {
221 auto code = read_wasm( std::string(wasm_directory) + "br_table.17.wasm");
222 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
223}
224
225BACKEND_TEST_CASE( "Testing wasm <br_table_18_wasm>", "[br_table_18_wasm_tests]" ) {
227 auto code = read_wasm( std::string(wasm_directory) + "br_table.18.wasm");
228 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
229}
230
231BACKEND_TEST_CASE( "Testing wasm <br_table_19_wasm>", "[br_table_19_wasm_tests]" ) {
233 auto code = read_wasm( std::string(wasm_directory) + "br_table.19.wasm");
234 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
235}
236
237BACKEND_TEST_CASE( "Testing wasm <br_table_2_wasm>", "[br_table_2_wasm_tests]" ) {
239 auto code = read_wasm( std::string(wasm_directory) + "br_table.2.wasm");
240 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
241}
242
243BACKEND_TEST_CASE( "Testing wasm <br_table_20_wasm>", "[br_table_20_wasm_tests]" ) {
245 auto code = read_wasm( std::string(wasm_directory) + "br_table.20.wasm");
246 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
247}
248
249BACKEND_TEST_CASE( "Testing wasm <br_table_21_wasm>", "[br_table_21_wasm_tests]" ) {
251 auto code = read_wasm( std::string(wasm_directory) + "br_table.21.wasm");
252 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
253}
254
255BACKEND_TEST_CASE( "Testing wasm <br_table_3_wasm>", "[br_table_3_wasm_tests]" ) {
257 auto code = read_wasm( std::string(wasm_directory) + "br_table.3.wasm");
258 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
259}
260
261BACKEND_TEST_CASE( "Testing wasm <br_table_4_wasm>", "[br_table_4_wasm_tests]" ) {
263 auto code = read_wasm( std::string(wasm_directory) + "br_table.4.wasm");
264 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
265}
266
267BACKEND_TEST_CASE( "Testing wasm <br_table_5_wasm>", "[br_table_5_wasm_tests]" ) {
269 auto code = read_wasm( std::string(wasm_directory) + "br_table.5.wasm");
270 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
271}
272
273BACKEND_TEST_CASE( "Testing wasm <br_table_6_wasm>", "[br_table_6_wasm_tests]" ) {
275 auto code = read_wasm( std::string(wasm_directory) + "br_table.6.wasm");
276 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
277}
278
279BACKEND_TEST_CASE( "Testing wasm <br_table_7_wasm>", "[br_table_7_wasm_tests]" ) {
281 auto code = read_wasm( std::string(wasm_directory) + "br_table.7.wasm");
282 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
283}
284
285BACKEND_TEST_CASE( "Testing wasm <br_table_8_wasm>", "[br_table_8_wasm_tests]" ) {
287 auto code = read_wasm( std::string(wasm_directory) + "br_table.8.wasm");
288 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
289}
290
291BACKEND_TEST_CASE( "Testing wasm <br_table_9_wasm>", "[br_table_9_wasm_tests]" ) {
293 auto code = read_wasm( std::string(wasm_directory) + "br_table.9.wasm");
294 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
295}
296
wasm_allocator wa
Definition main.cpp:10
auto call_with_return(host_t &host, const std::string_view &mod, const std::string_view &func, Args... args)
Definition backend.hpp:178
#define CHECK(cond)
Definition util.h:80
backend_t bkend(hello_wasm, ehm, &wa)
sysio::vm::backend< rhf_t > backend_t
#define CHECK_THROWS_AS(expr, exceptionType)
Definition catch.hpp:203
std::vector< uint8_t > read_wasm(const std::string &fname)
Definition utils.hpp:30
#define UINT32_C(val)
Definition stdint.h:283
#define UINT64_C(val)
Definition stdint.h:284
#define BACKEND_TEST_CASE(name, tags)
Definition utils.hpp:59
T bit_cast(const U &u)
Definition utils.hpp:35