Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
local_set_tests.cpp File Reference
#include <algorithm>
#include <vector>
#include <iostream>
#include <iterator>
#include <cmath>
#include <cstdlib>
#include <catch2/catch.hpp>
#include <utils.hpp>
#include <wasm_config.hpp>
#include <sysio/vm/backend.hpp>
Include dependency graph for local_set_tests.cpp:

Go to the source code of this file.

Functions

 BACKEND_TEST_CASE ("Testing wasm <local_set_0_wasm>", "[local_set_0_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_1_wasm>", "[local_set_1_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_10_wasm>", "[local_set_10_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_11_wasm>", "[local_set_11_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_12_wasm>", "[local_set_12_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_13_wasm>", "[local_set_13_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_14_wasm>", "[local_set_14_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_15_wasm>", "[local_set_15_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_16_wasm>", "[local_set_16_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_17_wasm>", "[local_set_17_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_18_wasm>", "[local_set_18_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_19_wasm>", "[local_set_19_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_2_wasm>", "[local_set_2_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_20_wasm>", "[local_set_20_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_21_wasm>", "[local_set_21_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_22_wasm>", "[local_set_22_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_23_wasm>", "[local_set_23_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_24_wasm>", "[local_set_24_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_25_wasm>", "[local_set_25_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_26_wasm>", "[local_set_26_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_27_wasm>", "[local_set_27_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_28_wasm>", "[local_set_28_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_29_wasm>", "[local_set_29_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_3_wasm>", "[local_set_3_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_30_wasm>", "[local_set_30_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_31_wasm>", "[local_set_31_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_32_wasm>", "[local_set_32_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_33_wasm>", "[local_set_33_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_4_wasm>", "[local_set_4_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_5_wasm>", "[local_set_5_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_6_wasm>", "[local_set_6_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_7_wasm>", "[local_set_7_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_8_wasm>", "[local_set_8_wasm_tests]")
 
 BACKEND_TEST_CASE ("Testing wasm <local_set_9_wasm>", "[local_set_9_wasm_tests]")
 

Variables

wasm_allocator wa
 

Function Documentation

◆ BACKEND_TEST_CASE() [1/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_0_wasm>" ,
"" [local_set_0_wasm_tests] )

Definition at line 18 of file local_set_tests.cpp.

18 {
20 auto code = read_wasm( std::string(wasm_directory) + "local_set.0.wasm");
21 backend_t bkend( code, &wa );
22
23 CHECK(!bkend.call_with_return("env", "type-local-i32"));
24 CHECK(!bkend.call_with_return("env", "type-local-i64"));
25 CHECK(!bkend.call_with_return("env", "type-local-f32"));
26 CHECK(!bkend.call_with_return("env", "type-local-f64"));
27 CHECK(!bkend.call_with_return("env", "type-param-i32", UINT32_C(2)));
28 CHECK(!bkend.call_with_return("env", "type-param-i64", UINT64_C(3)));
29 CHECK(!bkend.call_with_return("env", "type-param-f32", bit_cast<float>(UINT32_C(1082969293))));
30 CHECK(!bkend.call_with_return("env", "type-param-f64", bit_cast<double>(UINT64_C(4617878467915022336))));
31 CHECK(!bkend.call_with_return("env", "as-block-value", UINT32_C(0)));
32 CHECK(!bkend.call_with_return("env", "as-loop-value", UINT32_C(0)));
33 CHECK(!bkend.call_with_return("env", "as-br-value", UINT32_C(0)));
34 CHECK(!bkend.call_with_return("env", "as-br_if-value", UINT32_C(0)));
35 CHECK(!bkend.call_with_return("env", "as-br_if-value-cond", UINT32_C(0)));
36 CHECK(!bkend.call_with_return("env", "as-br_table-value", UINT32_C(0)));
37 CHECK(!bkend.call_with_return("env", "as-return-value", UINT32_C(0)));
38 CHECK(!bkend.call_with_return("env", "as-if-then", UINT32_C(1)));
39 CHECK(!bkend.call_with_return("env", "as-if-else", UINT32_C(0)));
40 CHECK(!bkend.call_with_return("env", "type-mixed", UINT64_C(1), bit_cast<float>(UINT32_C(1074580685)), bit_cast<double>(UINT64_C(4614613358185178726)), UINT32_C(4), UINT32_C(5)));
41 CHECK(bkend.call_with_return("env", "write", UINT64_C(1), bit_cast<float>(UINT32_C(1073741824)), bit_cast<double>(UINT64_C(4614613358185178726)), UINT32_C(4), UINT32_C(5))->to_ui64() == UINT32_C(56));
42}
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)
wasm_allocator wa
Definition main.cpp:10
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
T bit_cast(const U &u)
Definition utils.hpp:35
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [2/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_10_wasm>" ,
"" [local_set_10_wasm_tests] )

Definition at line 50 of file local_set_tests.cpp.

50 {
52 auto code = read_wasm( std::string(wasm_directory) + "local_set.10.wasm");
53 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
54}
sysio::vm::backend< rhf_t > backend_t
#define CHECK_THROWS_AS(expr, exceptionType)
Definition catch.hpp:203
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [3/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_11_wasm>" ,
"" [local_set_11_wasm_tests] )

Definition at line 56 of file local_set_tests.cpp.

56 {
58 auto code = read_wasm( std::string(wasm_directory) + "local_set.11.wasm");
59 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
60}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [4/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_12_wasm>" ,
"" [local_set_12_wasm_tests] )

Definition at line 62 of file local_set_tests.cpp.

62 {
64 auto code = read_wasm( std::string(wasm_directory) + "local_set.12.wasm");
65 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
66}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [5/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_13_wasm>" ,
"" [local_set_13_wasm_tests] )

Definition at line 68 of file local_set_tests.cpp.

68 {
70 auto code = read_wasm( std::string(wasm_directory) + "local_set.13.wasm");
71 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
72}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [6/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_14_wasm>" ,
"" [local_set_14_wasm_tests] )

Definition at line 74 of file local_set_tests.cpp.

74 {
76 auto code = read_wasm( std::string(wasm_directory) + "local_set.14.wasm");
77 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
78}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [7/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_15_wasm>" ,
"" [local_set_15_wasm_tests] )

Definition at line 80 of file local_set_tests.cpp.

80 {
82 auto code = read_wasm( std::string(wasm_directory) + "local_set.15.wasm");
83 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
84}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [8/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_16_wasm>" ,
"" [local_set_16_wasm_tests] )

Definition at line 86 of file local_set_tests.cpp.

86 {
88 auto code = read_wasm( std::string(wasm_directory) + "local_set.16.wasm");
89 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
90}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [9/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_17_wasm>" ,
"" [local_set_17_wasm_tests] )

Definition at line 92 of file local_set_tests.cpp.

92 {
94 auto code = read_wasm( std::string(wasm_directory) + "local_set.17.wasm");
95 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
96}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [10/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_18_wasm>" ,
"" [local_set_18_wasm_tests] )

Definition at line 98 of file local_set_tests.cpp.

98 {
100 auto code = read_wasm( std::string(wasm_directory) + "local_set.18.wasm");
101 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
102}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [11/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_19_wasm>" ,
"" [local_set_19_wasm_tests] )

Definition at line 104 of file local_set_tests.cpp.

104 {
106 auto code = read_wasm( std::string(wasm_directory) + "local_set.19.wasm");
107 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
108}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [12/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_1_wasm>" ,
"" [local_set_1_wasm_tests] )

Definition at line 44 of file local_set_tests.cpp.

44 {
46 auto code = read_wasm( std::string(wasm_directory) + "local_set.1.wasm");
47 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
48}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [13/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_20_wasm>" ,
"" [local_set_20_wasm_tests] )

Definition at line 116 of file local_set_tests.cpp.

116 {
118 auto code = read_wasm( std::string(wasm_directory) + "local_set.20.wasm");
119 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
120}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [14/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_21_wasm>" ,
"" [local_set_21_wasm_tests] )

Definition at line 122 of file local_set_tests.cpp.

122 {
124 auto code = read_wasm( std::string(wasm_directory) + "local_set.21.wasm");
125 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
126}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [15/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_22_wasm>" ,
"" [local_set_22_wasm_tests] )

Definition at line 128 of file local_set_tests.cpp.

128 {
130 auto code = read_wasm( std::string(wasm_directory) + "local_set.22.wasm");
131 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
132}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [16/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_23_wasm>" ,
"" [local_set_23_wasm_tests] )

Definition at line 134 of file local_set_tests.cpp.

134 {
136 auto code = read_wasm( std::string(wasm_directory) + "local_set.23.wasm");
137 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
138}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [17/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_24_wasm>" ,
"" [local_set_24_wasm_tests] )

Definition at line 140 of file local_set_tests.cpp.

140 {
142 auto code = read_wasm( std::string(wasm_directory) + "local_set.24.wasm");
143 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
144}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [18/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_25_wasm>" ,
"" [local_set_25_wasm_tests] )

Definition at line 146 of file local_set_tests.cpp.

146 {
148 auto code = read_wasm( std::string(wasm_directory) + "local_set.25.wasm");
149 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
150}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [19/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_26_wasm>" ,
"" [local_set_26_wasm_tests] )

Definition at line 152 of file local_set_tests.cpp.

152 {
154 auto code = read_wasm( std::string(wasm_directory) + "local_set.26.wasm");
155 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
156}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [20/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_27_wasm>" ,
"" [local_set_27_wasm_tests] )

Definition at line 158 of file local_set_tests.cpp.

158 {
160 auto code = read_wasm( std::string(wasm_directory) + "local_set.27.wasm");
161 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
162}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [21/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_28_wasm>" ,
"" [local_set_28_wasm_tests] )

Definition at line 164 of file local_set_tests.cpp.

164 {
166 auto code = read_wasm( std::string(wasm_directory) + "local_set.28.wasm");
167 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
168}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [22/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_29_wasm>" ,
"" [local_set_29_wasm_tests] )

Definition at line 170 of file local_set_tests.cpp.

170 {
172 auto code = read_wasm( std::string(wasm_directory) + "local_set.29.wasm");
173 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
174}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [23/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_2_wasm>" ,
"" [local_set_2_wasm_tests] )

Definition at line 110 of file local_set_tests.cpp.

110 {
112 auto code = read_wasm( std::string(wasm_directory) + "local_set.2.wasm");
113 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
114}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [24/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_30_wasm>" ,
"" [local_set_30_wasm_tests] )

Definition at line 182 of file local_set_tests.cpp.

182 {
184 auto code = read_wasm( std::string(wasm_directory) + "local_set.30.wasm");
185 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
186}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [25/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_31_wasm>" ,
"" [local_set_31_wasm_tests] )

Definition at line 188 of file local_set_tests.cpp.

188 {
190 auto code = read_wasm( std::string(wasm_directory) + "local_set.31.wasm");
191 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
192}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [26/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_32_wasm>" ,
"" [local_set_32_wasm_tests] )

Definition at line 194 of file local_set_tests.cpp.

194 {
196 auto code = read_wasm( std::string(wasm_directory) + "local_set.32.wasm");
197 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
198}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [27/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_33_wasm>" ,
"" [local_set_33_wasm_tests] )

Definition at line 200 of file local_set_tests.cpp.

200 {
202 auto code = read_wasm( std::string(wasm_directory) + "local_set.33.wasm");
203 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
204}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [28/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_3_wasm>" ,
"" [local_set_3_wasm_tests] )

Definition at line 176 of file local_set_tests.cpp.

176 {
178 auto code = read_wasm( std::string(wasm_directory) + "local_set.3.wasm");
179 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
180}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [29/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_4_wasm>" ,
"" [local_set_4_wasm_tests] )

Definition at line 206 of file local_set_tests.cpp.

206 {
208 auto code = read_wasm( std::string(wasm_directory) + "local_set.4.wasm");
209 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
210}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [30/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_5_wasm>" ,
"" [local_set_5_wasm_tests] )

Definition at line 212 of file local_set_tests.cpp.

212 {
214 auto code = read_wasm( std::string(wasm_directory) + "local_set.5.wasm");
215 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
216}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [31/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_6_wasm>" ,
"" [local_set_6_wasm_tests] )

Definition at line 218 of file local_set_tests.cpp.

218 {
220 auto code = read_wasm( std::string(wasm_directory) + "local_set.6.wasm");
221 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
222}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [32/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_7_wasm>" ,
"" [local_set_7_wasm_tests] )

Definition at line 224 of file local_set_tests.cpp.

224 {
226 auto code = read_wasm( std::string(wasm_directory) + "local_set.7.wasm");
227 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
228}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [33/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_8_wasm>" ,
"" [local_set_8_wasm_tests] )

Definition at line 230 of file local_set_tests.cpp.

230 {
232 auto code = read_wasm( std::string(wasm_directory) + "local_set.8.wasm");
233 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
234}
Here is the call graph for this function:

◆ BACKEND_TEST_CASE() [34/34]

BACKEND_TEST_CASE ( "Testing wasm <local_set_9_wasm>" ,
"" [local_set_9_wasm_tests] )

Definition at line 236 of file local_set_tests.cpp.

236 {
238 auto code = read_wasm( std::string(wasm_directory) + "local_set.9.wasm");
239 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
240}
Here is the call graph for this function:

Variable Documentation

◆ wa

wasm_allocator wa
extern

Definition at line 10 of file main.cpp.