Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
i64_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 <i64_0_wasm>", "[i64_0_wasm_tests]" ) {
20 auto code = read_wasm( std::string(wasm_directory) + "i64.0.wasm");
21 backend_t bkend( code, &wa );
22
23 CHECK(bkend.call_with_return("env", "add", UINT64_C(1), UINT64_C(1))->to_ui64() == UINT32_C(2));
24 CHECK(bkend.call_with_return("env", "add", UINT64_C(1), UINT64_C(0))->to_ui64() == UINT32_C(1));
25 CHECK(bkend.call_with_return("env", "add", UINT64_C(18446744073709551615), UINT64_C(18446744073709551615))->to_ui64() == UINT32_C(18446744073709551614));
26 CHECK(bkend.call_with_return("env", "add", UINT64_C(18446744073709551615), UINT64_C(1))->to_ui64() == UINT32_C(0));
27 CHECK(bkend.call_with_return("env", "add", UINT64_C(9223372036854775807), UINT64_C(1))->to_ui64() == UINT32_C(9223372036854775808));
28 CHECK(bkend.call_with_return("env", "add", UINT64_C(9223372036854775808), UINT64_C(18446744073709551615))->to_ui64() == UINT32_C(9223372036854775807));
29 CHECK(bkend.call_with_return("env", "add", UINT64_C(9223372036854775808), UINT64_C(9223372036854775808))->to_ui64() == UINT32_C(0));
30 CHECK(bkend.call_with_return("env", "add", UINT64_C(1073741823), UINT64_C(1))->to_ui64() == UINT32_C(1073741824));
31 CHECK(bkend.call_with_return("env", "sub", UINT64_C(1), UINT64_C(1))->to_ui64() == UINT32_C(0));
32 CHECK(bkend.call_with_return("env", "sub", UINT64_C(1), UINT64_C(0))->to_ui64() == UINT32_C(1));
33 CHECK(bkend.call_with_return("env", "sub", UINT64_C(18446744073709551615), UINT64_C(18446744073709551615))->to_ui64() == UINT32_C(0));
34 CHECK(bkend.call_with_return("env", "sub", UINT64_C(9223372036854775807), UINT64_C(18446744073709551615))->to_ui64() == UINT32_C(9223372036854775808));
35 CHECK(bkend.call_with_return("env", "sub", UINT64_C(9223372036854775808), UINT64_C(1))->to_ui64() == UINT32_C(9223372036854775807));
36 CHECK(bkend.call_with_return("env", "sub", UINT64_C(9223372036854775808), UINT64_C(9223372036854775808))->to_ui64() == UINT32_C(0));
37 CHECK(bkend.call_with_return("env", "sub", UINT64_C(1073741823), UINT64_C(18446744073709551615))->to_ui64() == UINT32_C(1073741824));
38 CHECK(bkend.call_with_return("env", "mul", UINT64_C(1), UINT64_C(1))->to_ui64() == UINT32_C(1));
39 CHECK(bkend.call_with_return("env", "mul", UINT64_C(1), UINT64_C(0))->to_ui64() == UINT32_C(0));
40 CHECK(bkend.call_with_return("env", "mul", UINT64_C(18446744073709551615), UINT64_C(18446744073709551615))->to_ui64() == UINT32_C(1));
41 CHECK(bkend.call_with_return("env", "mul", UINT64_C(1152921504606846976), UINT64_C(4096))->to_ui64() == UINT32_C(0));
42 CHECK(bkend.call_with_return("env", "mul", UINT64_C(9223372036854775808), UINT64_C(0))->to_ui64() == UINT32_C(0));
43 CHECK(bkend.call_with_return("env", "mul", UINT64_C(9223372036854775808), UINT64_C(18446744073709551615))->to_ui64() == UINT32_C(9223372036854775808));
44 CHECK(bkend.call_with_return("env", "mul", UINT64_C(9223372036854775807), UINT64_C(18446744073709551615))->to_ui64() == UINT32_C(9223372036854775809));
45 CHECK(bkend.call_with_return("env", "mul", UINT64_C(81985529216486895), UINT64_C(18364758544493064720))->to_ui64() == UINT32_C(2465395958572223728));
46 CHECK(bkend.call_with_return("env", "mul", UINT64_C(9223372036854775807), UINT64_C(9223372036854775807))->to_ui64() == UINT32_C(1));
47 CHECK_THROWS_AS(bkend("env", "div_s", UINT64_C(1), UINT64_C(0)), std::exception);
48 CHECK_THROWS_AS(bkend("env", "div_s", UINT64_C(0), UINT64_C(0)), std::exception);
49 CHECK_THROWS_AS(bkend("env", "div_s", UINT64_C(9223372036854775808), UINT64_C(18446744073709551615)), std::exception);
50 CHECK(bkend.call_with_return("env", "div_s", UINT64_C(1), UINT64_C(1))->to_ui64() == UINT32_C(1));
51 CHECK(bkend.call_with_return("env", "div_s", UINT64_C(0), UINT64_C(1))->to_ui64() == UINT32_C(0));
52 CHECK(bkend.call_with_return("env", "div_s", UINT64_C(0), UINT64_C(18446744073709551615))->to_ui64() == UINT32_C(0));
53 CHECK(bkend.call_with_return("env", "div_s", UINT64_C(18446744073709551615), UINT64_C(18446744073709551615))->to_ui64() == UINT32_C(1));
54 CHECK(bkend.call_with_return("env", "div_s", UINT64_C(9223372036854775808), UINT64_C(2))->to_ui64() == UINT32_C(13835058055282163712));
55 CHECK(bkend.call_with_return("env", "div_s", UINT64_C(9223372036854775809), UINT64_C(1000))->to_ui64() == UINT32_C(18437520701672696841));
56 CHECK(bkend.call_with_return("env", "div_s", UINT64_C(5), UINT64_C(2))->to_ui64() == UINT32_C(2));
57 CHECK(bkend.call_with_return("env", "div_s", UINT64_C(18446744073709551611), UINT64_C(2))->to_ui64() == UINT32_C(18446744073709551614));
58 CHECK(bkend.call_with_return("env", "div_s", UINT64_C(5), UINT64_C(18446744073709551614))->to_ui64() == UINT32_C(18446744073709551614));
59 CHECK(bkend.call_with_return("env", "div_s", UINT64_C(18446744073709551611), UINT64_C(18446744073709551614))->to_ui64() == UINT32_C(2));
60 CHECK(bkend.call_with_return("env", "div_s", UINT64_C(7), UINT64_C(3))->to_ui64() == UINT32_C(2));
61 CHECK(bkend.call_with_return("env", "div_s", UINT64_C(18446744073709551609), UINT64_C(3))->to_ui64() == UINT32_C(18446744073709551614));
62 CHECK(bkend.call_with_return("env", "div_s", UINT64_C(7), UINT64_C(18446744073709551613))->to_ui64() == UINT32_C(18446744073709551614));
63 CHECK(bkend.call_with_return("env", "div_s", UINT64_C(18446744073709551609), UINT64_C(18446744073709551613))->to_ui64() == UINT32_C(2));
64 CHECK(bkend.call_with_return("env", "div_s", UINT64_C(11), UINT64_C(5))->to_ui64() == UINT32_C(2));
65 CHECK(bkend.call_with_return("env", "div_s", UINT64_C(17), UINT64_C(7))->to_ui64() == UINT32_C(2));
66 CHECK_THROWS_AS(bkend("env", "div_u", UINT64_C(1), UINT64_C(0)), std::exception);
67 CHECK_THROWS_AS(bkend("env", "div_u", UINT64_C(0), UINT64_C(0)), std::exception);
68 CHECK(bkend.call_with_return("env", "div_u", UINT64_C(1), UINT64_C(1))->to_ui64() == UINT32_C(1));
69 CHECK(bkend.call_with_return("env", "div_u", UINT64_C(0), UINT64_C(1))->to_ui64() == UINT32_C(0));
70 CHECK(bkend.call_with_return("env", "div_u", UINT64_C(18446744073709551615), UINT64_C(18446744073709551615))->to_ui64() == UINT32_C(1));
71 CHECK(bkend.call_with_return("env", "div_u", UINT64_C(9223372036854775808), UINT64_C(18446744073709551615))->to_ui64() == UINT32_C(0));
72 CHECK(bkend.call_with_return("env", "div_u", UINT64_C(9223372036854775808), UINT64_C(2))->to_ui64() == UINT32_C(4611686018427387904));
73 CHECK(bkend.call_with_return("env", "div_u", UINT64_C(10371807465568210928), UINT64_C(4294967297))->to_ui64() == UINT32_C(2414874607));
74 CHECK(bkend.call_with_return("env", "div_u", UINT64_C(9223372036854775809), UINT64_C(1000))->to_ui64() == UINT32_C(9223372036854775));
75 CHECK(bkend.call_with_return("env", "div_u", UINT64_C(5), UINT64_C(2))->to_ui64() == UINT32_C(2));
76 CHECK(bkend.call_with_return("env", "div_u", UINT64_C(18446744073709551611), UINT64_C(2))->to_ui64() == UINT32_C(9223372036854775805));
77 CHECK(bkend.call_with_return("env", "div_u", UINT64_C(5), UINT64_C(18446744073709551614))->to_ui64() == UINT32_C(0));
78 CHECK(bkend.call_with_return("env", "div_u", UINT64_C(18446744073709551611), UINT64_C(18446744073709551614))->to_ui64() == UINT32_C(0));
79 CHECK(bkend.call_with_return("env", "div_u", UINT64_C(7), UINT64_C(3))->to_ui64() == UINT32_C(2));
80 CHECK(bkend.call_with_return("env", "div_u", UINT64_C(11), UINT64_C(5))->to_ui64() == UINT32_C(2));
81 CHECK(bkend.call_with_return("env", "div_u", UINT64_C(17), UINT64_C(7))->to_ui64() == UINT32_C(2));
82 CHECK_THROWS_AS(bkend("env", "rem_s", UINT64_C(1), UINT64_C(0)), std::exception);
83 CHECK_THROWS_AS(bkend("env", "rem_s", UINT64_C(0), UINT64_C(0)), std::exception);
84 CHECK(bkend.call_with_return("env", "rem_s", UINT64_C(9223372036854775807), UINT64_C(18446744073709551615))->to_ui64() == UINT32_C(0));
85 CHECK(bkend.call_with_return("env", "rem_s", UINT64_C(1), UINT64_C(1))->to_ui64() == UINT32_C(0));
86 CHECK(bkend.call_with_return("env", "rem_s", UINT64_C(0), UINT64_C(1))->to_ui64() == UINT32_C(0));
87 CHECK(bkend.call_with_return("env", "rem_s", UINT64_C(0), UINT64_C(18446744073709551615))->to_ui64() == UINT32_C(0));
88 CHECK(bkend.call_with_return("env", "rem_s", UINT64_C(18446744073709551615), UINT64_C(18446744073709551615))->to_ui64() == UINT32_C(0));
89 CHECK(bkend.call_with_return("env", "rem_s", UINT64_C(9223372036854775808), UINT64_C(18446744073709551615))->to_ui64() == UINT32_C(0));
90 CHECK(bkend.call_with_return("env", "rem_s", UINT64_C(9223372036854775808), UINT64_C(2))->to_ui64() == UINT32_C(0));
91 CHECK(bkend.call_with_return("env", "rem_s", UINT64_C(9223372036854775809), UINT64_C(1000))->to_ui64() == UINT32_C(18446744073709550809));
92 CHECK(bkend.call_with_return("env", "rem_s", UINT64_C(5), UINT64_C(2))->to_ui64() == UINT32_C(1));
93 CHECK(bkend.call_with_return("env", "rem_s", UINT64_C(18446744073709551611), UINT64_C(2))->to_ui64() == UINT32_C(18446744073709551615));
94 CHECK(bkend.call_with_return("env", "rem_s", UINT64_C(5), UINT64_C(18446744073709551614))->to_ui64() == UINT32_C(1));
95 CHECK(bkend.call_with_return("env", "rem_s", UINT64_C(18446744073709551611), UINT64_C(18446744073709551614))->to_ui64() == UINT32_C(18446744073709551615));
96 CHECK(bkend.call_with_return("env", "rem_s", UINT64_C(7), UINT64_C(3))->to_ui64() == UINT32_C(1));
97 CHECK(bkend.call_with_return("env", "rem_s", UINT64_C(18446744073709551609), UINT64_C(3))->to_ui64() == UINT32_C(18446744073709551615));
98 CHECK(bkend.call_with_return("env", "rem_s", UINT64_C(7), UINT64_C(18446744073709551613))->to_ui64() == UINT32_C(1));
99 CHECK(bkend.call_with_return("env", "rem_s", UINT64_C(18446744073709551609), UINT64_C(18446744073709551613))->to_ui64() == UINT32_C(18446744073709551615));
100 CHECK(bkend.call_with_return("env", "rem_s", UINT64_C(11), UINT64_C(5))->to_ui64() == UINT32_C(1));
101 CHECK(bkend.call_with_return("env", "rem_s", UINT64_C(17), UINT64_C(7))->to_ui64() == UINT32_C(3));
102 CHECK_THROWS_AS(bkend("env", "rem_u", UINT64_C(1), UINT64_C(0)), std::exception);
103 CHECK_THROWS_AS(bkend("env", "rem_u", UINT64_C(0), UINT64_C(0)), std::exception);
104 CHECK(bkend.call_with_return("env", "rem_u", UINT64_C(1), UINT64_C(1))->to_ui64() == UINT32_C(0));
105 CHECK(bkend.call_with_return("env", "rem_u", UINT64_C(0), UINT64_C(1))->to_ui64() == UINT32_C(0));
106 CHECK(bkend.call_with_return("env", "rem_u", UINT64_C(18446744073709551615), UINT64_C(18446744073709551615))->to_ui64() == UINT32_C(0));
107 CHECK(bkend.call_with_return("env", "rem_u", UINT64_C(9223372036854775808), UINT64_C(18446744073709551615))->to_ui64() == UINT32_C(9223372036854775808));
108 CHECK(bkend.call_with_return("env", "rem_u", UINT64_C(9223372036854775808), UINT64_C(2))->to_ui64() == UINT32_C(0));
109 CHECK(bkend.call_with_return("env", "rem_u", UINT64_C(10371807465568210928), UINT64_C(4294967297))->to_ui64() == UINT32_C(2147483649));
110 CHECK(bkend.call_with_return("env", "rem_u", UINT64_C(9223372036854775809), UINT64_C(1000))->to_ui64() == UINT32_C(809));
111 CHECK(bkend.call_with_return("env", "rem_u", UINT64_C(5), UINT64_C(2))->to_ui64() == UINT32_C(1));
112 CHECK(bkend.call_with_return("env", "rem_u", UINT64_C(18446744073709551611), UINT64_C(2))->to_ui64() == UINT32_C(1));
113 CHECK(bkend.call_with_return("env", "rem_u", UINT64_C(5), UINT64_C(18446744073709551614))->to_ui64() == UINT32_C(5));
114 CHECK(bkend.call_with_return("env", "rem_u", UINT64_C(18446744073709551611), UINT64_C(18446744073709551614))->to_ui64() == UINT32_C(18446744073709551611));
115 CHECK(bkend.call_with_return("env", "rem_u", UINT64_C(7), UINT64_C(3))->to_ui64() == UINT32_C(1));
116 CHECK(bkend.call_with_return("env", "rem_u", UINT64_C(11), UINT64_C(5))->to_ui64() == UINT32_C(1));
117 CHECK(bkend.call_with_return("env", "rem_u", UINT64_C(17), UINT64_C(7))->to_ui64() == UINT32_C(3));
118 CHECK(bkend.call_with_return("env", "and", UINT64_C(1), UINT64_C(0))->to_ui64() == UINT32_C(0));
119 CHECK(bkend.call_with_return("env", "and", UINT64_C(0), UINT64_C(1))->to_ui64() == UINT32_C(0));
120 CHECK(bkend.call_with_return("env", "and", UINT64_C(1), UINT64_C(1))->to_ui64() == UINT32_C(1));
121 CHECK(bkend.call_with_return("env", "and", UINT64_C(0), UINT64_C(0))->to_ui64() == UINT32_C(0));
122 CHECK(bkend.call_with_return("env", "and", UINT64_C(9223372036854775807), UINT64_C(9223372036854775808))->to_ui64() == UINT32_C(0));
123 CHECK(bkend.call_with_return("env", "and", UINT64_C(9223372036854775807), UINT64_C(18446744073709551615))->to_ui64() == UINT32_C(9223372036854775807));
124 CHECK(bkend.call_with_return("env", "and", UINT64_C(4042326015), UINT64_C(4294963440))->to_ui64() == UINT32_C(4042322160));
125 CHECK(bkend.call_with_return("env", "and", UINT64_C(18446744073709551615), UINT64_C(18446744073709551615))->to_ui64() == UINT32_C(18446744073709551615));
126 CHECK(bkend.call_with_return("env", "or", UINT64_C(1), UINT64_C(0))->to_ui64() == UINT32_C(1));
127 CHECK(bkend.call_with_return("env", "or", UINT64_C(0), UINT64_C(1))->to_ui64() == UINT32_C(1));
128 CHECK(bkend.call_with_return("env", "or", UINT64_C(1), UINT64_C(1))->to_ui64() == UINT32_C(1));
129 CHECK(bkend.call_with_return("env", "or", UINT64_C(0), UINT64_C(0))->to_ui64() == UINT32_C(0));
130 CHECK(bkend.call_with_return("env", "or", UINT64_C(9223372036854775807), UINT64_C(9223372036854775808))->to_ui64() == UINT32_C(18446744073709551615));
131 CHECK(bkend.call_with_return("env", "or", UINT64_C(9223372036854775808), UINT64_C(0))->to_ui64() == UINT32_C(9223372036854775808));
132 CHECK(bkend.call_with_return("env", "or", UINT64_C(4042326015), UINT64_C(4294963440))->to_ui64() == UINT32_C(4294967295));
133 CHECK(bkend.call_with_return("env", "or", UINT64_C(18446744073709551615), UINT64_C(18446744073709551615))->to_ui64() == UINT32_C(18446744073709551615));
134 CHECK(bkend.call_with_return("env", "xor", UINT64_C(1), UINT64_C(0))->to_ui64() == UINT32_C(1));
135 CHECK(bkend.call_with_return("env", "xor", UINT64_C(0), UINT64_C(1))->to_ui64() == UINT32_C(1));
136 CHECK(bkend.call_with_return("env", "xor", UINT64_C(1), UINT64_C(1))->to_ui64() == UINT32_C(0));
137 CHECK(bkend.call_with_return("env", "xor", UINT64_C(0), UINT64_C(0))->to_ui64() == UINT32_C(0));
138 CHECK(bkend.call_with_return("env", "xor", UINT64_C(9223372036854775807), UINT64_C(9223372036854775808))->to_ui64() == UINT32_C(18446744073709551615));
139 CHECK(bkend.call_with_return("env", "xor", UINT64_C(9223372036854775808), UINT64_C(0))->to_ui64() == UINT32_C(9223372036854775808));
140 CHECK(bkend.call_with_return("env", "xor", UINT64_C(18446744073709551615), UINT64_C(9223372036854775808))->to_ui64() == UINT32_C(9223372036854775807));
141 CHECK(bkend.call_with_return("env", "xor", UINT64_C(18446744073709551615), UINT64_C(9223372036854775807))->to_ui64() == UINT32_C(9223372036854775808));
142 CHECK(bkend.call_with_return("env", "xor", UINT64_C(4042326015), UINT64_C(4294963440))->to_ui64() == UINT32_C(252645135));
143 CHECK(bkend.call_with_return("env", "xor", UINT64_C(18446744073709551615), UINT64_C(18446744073709551615))->to_ui64() == UINT32_C(0));
144 CHECK(bkend.call_with_return("env", "shl", UINT64_C(1), UINT64_C(1))->to_ui64() == UINT32_C(2));
145 CHECK(bkend.call_with_return("env", "shl", UINT64_C(1), UINT64_C(0))->to_ui64() == UINT32_C(1));
146 CHECK(bkend.call_with_return("env", "shl", UINT64_C(9223372036854775807), UINT64_C(1))->to_ui64() == UINT32_C(18446744073709551614));
147 CHECK(bkend.call_with_return("env", "shl", UINT64_C(18446744073709551615), UINT64_C(1))->to_ui64() == UINT32_C(18446744073709551614));
148 CHECK(bkend.call_with_return("env", "shl", UINT64_C(9223372036854775808), UINT64_C(1))->to_ui64() == UINT32_C(0));
149 CHECK(bkend.call_with_return("env", "shl", UINT64_C(4611686018427387904), UINT64_C(1))->to_ui64() == UINT32_C(9223372036854775808));
150 CHECK(bkend.call_with_return("env", "shl", UINT64_C(1), UINT64_C(63))->to_ui64() == UINT32_C(9223372036854775808));
151 CHECK(bkend.call_with_return("env", "shl", UINT64_C(1), UINT64_C(64))->to_ui64() == UINT32_C(1));
152 CHECK(bkend.call_with_return("env", "shl", UINT64_C(1), UINT64_C(65))->to_ui64() == UINT32_C(2));
153 CHECK(bkend.call_with_return("env", "shl", UINT64_C(1), UINT64_C(18446744073709551615))->to_ui64() == UINT32_C(9223372036854775808));
154 CHECK(bkend.call_with_return("env", "shl", UINT64_C(1), UINT64_C(9223372036854775807))->to_ui64() == UINT32_C(9223372036854775808));
155 CHECK(bkend.call_with_return("env", "shr_s", UINT64_C(1), UINT64_C(1))->to_ui64() == UINT32_C(0));
156 CHECK(bkend.call_with_return("env", "shr_s", UINT64_C(1), UINT64_C(0))->to_ui64() == UINT32_C(1));
157 CHECK(bkend.call_with_return("env", "shr_s", UINT64_C(18446744073709551615), UINT64_C(1))->to_ui64() == UINT32_C(18446744073709551615));
158 CHECK(bkend.call_with_return("env", "shr_s", UINT64_C(9223372036854775807), UINT64_C(1))->to_ui64() == UINT32_C(4611686018427387903));
159 CHECK(bkend.call_with_return("env", "shr_s", UINT64_C(9223372036854775808), UINT64_C(1))->to_ui64() == UINT32_C(13835058055282163712));
160 CHECK(bkend.call_with_return("env", "shr_s", UINT64_C(4611686018427387904), UINT64_C(1))->to_ui64() == UINT32_C(2305843009213693952));
161 CHECK(bkend.call_with_return("env", "shr_s", UINT64_C(1), UINT64_C(64))->to_ui64() == UINT32_C(1));
162 CHECK(bkend.call_with_return("env", "shr_s", UINT64_C(1), UINT64_C(65))->to_ui64() == UINT32_C(0));
163 CHECK(bkend.call_with_return("env", "shr_s", UINT64_C(1), UINT64_C(18446744073709551615))->to_ui64() == UINT32_C(0));
164 CHECK(bkend.call_with_return("env", "shr_s", UINT64_C(1), UINT64_C(9223372036854775807))->to_ui64() == UINT32_C(0));
165 CHECK(bkend.call_with_return("env", "shr_s", UINT64_C(1), UINT64_C(9223372036854775808))->to_ui64() == UINT32_C(1));
166 CHECK(bkend.call_with_return("env", "shr_s", UINT64_C(9223372036854775808), UINT64_C(63))->to_ui64() == UINT32_C(18446744073709551615));
167 CHECK(bkend.call_with_return("env", "shr_s", UINT64_C(18446744073709551615), UINT64_C(64))->to_ui64() == UINT32_C(18446744073709551615));
168 CHECK(bkend.call_with_return("env", "shr_s", UINT64_C(18446744073709551615), UINT64_C(65))->to_ui64() == UINT32_C(18446744073709551615));
169 CHECK(bkend.call_with_return("env", "shr_s", UINT64_C(18446744073709551615), UINT64_C(18446744073709551615))->to_ui64() == UINT32_C(18446744073709551615));
170 CHECK(bkend.call_with_return("env", "shr_s", UINT64_C(18446744073709551615), UINT64_C(9223372036854775807))->to_ui64() == UINT32_C(18446744073709551615));
171 CHECK(bkend.call_with_return("env", "shr_s", UINT64_C(18446744073709551615), UINT64_C(9223372036854775808))->to_ui64() == UINT32_C(18446744073709551615));
172 CHECK(bkend.call_with_return("env", "shr_u", UINT64_C(1), UINT64_C(1))->to_ui64() == UINT32_C(0));
173 CHECK(bkend.call_with_return("env", "shr_u", UINT64_C(1), UINT64_C(0))->to_ui64() == UINT32_C(1));
174 CHECK(bkend.call_with_return("env", "shr_u", UINT64_C(18446744073709551615), UINT64_C(1))->to_ui64() == UINT32_C(9223372036854775807));
175 CHECK(bkend.call_with_return("env", "shr_u", UINT64_C(9223372036854775807), UINT64_C(1))->to_ui64() == UINT32_C(4611686018427387903));
176 CHECK(bkend.call_with_return("env", "shr_u", UINT64_C(9223372036854775808), UINT64_C(1))->to_ui64() == UINT32_C(4611686018427387904));
177 CHECK(bkend.call_with_return("env", "shr_u", UINT64_C(4611686018427387904), UINT64_C(1))->to_ui64() == UINT32_C(2305843009213693952));
178 CHECK(bkend.call_with_return("env", "shr_u", UINT64_C(1), UINT64_C(64))->to_ui64() == UINT32_C(1));
179 CHECK(bkend.call_with_return("env", "shr_u", UINT64_C(1), UINT64_C(65))->to_ui64() == UINT32_C(0));
180 CHECK(bkend.call_with_return("env", "shr_u", UINT64_C(1), UINT64_C(18446744073709551615))->to_ui64() == UINT32_C(0));
181 CHECK(bkend.call_with_return("env", "shr_u", UINT64_C(1), UINT64_C(9223372036854775807))->to_ui64() == UINT32_C(0));
182 CHECK(bkend.call_with_return("env", "shr_u", UINT64_C(1), UINT64_C(9223372036854775808))->to_ui64() == UINT32_C(1));
183 CHECK(bkend.call_with_return("env", "shr_u", UINT64_C(9223372036854775808), UINT64_C(63))->to_ui64() == UINT32_C(1));
184 CHECK(bkend.call_with_return("env", "shr_u", UINT64_C(18446744073709551615), UINT64_C(64))->to_ui64() == UINT32_C(18446744073709551615));
185 CHECK(bkend.call_with_return("env", "shr_u", UINT64_C(18446744073709551615), UINT64_C(65))->to_ui64() == UINT32_C(9223372036854775807));
186 CHECK(bkend.call_with_return("env", "shr_u", UINT64_C(18446744073709551615), UINT64_C(18446744073709551615))->to_ui64() == UINT32_C(1));
187 CHECK(bkend.call_with_return("env", "shr_u", UINT64_C(18446744073709551615), UINT64_C(9223372036854775807))->to_ui64() == UINT32_C(1));
188 CHECK(bkend.call_with_return("env", "shr_u", UINT64_C(18446744073709551615), UINT64_C(9223372036854775808))->to_ui64() == UINT32_C(18446744073709551615));
189 CHECK(bkend.call_with_return("env", "rotl", UINT64_C(1), UINT64_C(1))->to_ui64() == UINT32_C(2));
190 CHECK(bkend.call_with_return("env", "rotl", UINT64_C(1), UINT64_C(0))->to_ui64() == UINT32_C(1));
191 CHECK(bkend.call_with_return("env", "rotl", UINT64_C(18446744073709551615), UINT64_C(1))->to_ui64() == UINT32_C(18446744073709551615));
192 CHECK(bkend.call_with_return("env", "rotl", UINT64_C(1), UINT64_C(64))->to_ui64() == UINT32_C(1));
193 CHECK(bkend.call_with_return("env", "rotl", UINT64_C(12379718583323101902), UINT64_C(1))->to_ui64() == UINT32_C(6312693092936652189));
194 CHECK(bkend.call_with_return("env", "rotl", UINT64_C(18302628889324683264), UINT64_C(4))->to_ui64() == UINT32_C(16140901123551657999));
195 CHECK(bkend.call_with_return("env", "rotl", UINT64_C(12379570969274382345), UINT64_C(53))->to_ui64() == UINT32_C(87109505680009935));
196 CHECK(bkend.call_with_return("env", "rotl", UINT64_C(12380715672649826460), UINT64_C(63))->to_ui64() == UINT32_C(6190357836324913230));
197 CHECK(bkend.call_with_return("env", "rotl", UINT64_C(12379570969274382345), UINT64_C(245))->to_ui64() == UINT32_C(87109505680009935));
198 CHECK(bkend.call_with_return("env", "rotl", UINT64_C(12379676934707509257), UINT64_C(18446744073709551597))->to_ui64() == UINT32_C(14916262237559758314));
199 CHECK(bkend.call_with_return("env", "rotl", UINT64_C(12380715672649826460), UINT64_C(9223372036854775871))->to_ui64() == UINT32_C(6190357836324913230));
200 CHECK(bkend.call_with_return("env", "rotl", UINT64_C(1), UINT64_C(63))->to_ui64() == UINT32_C(9223372036854775808));
201 CHECK(bkend.call_with_return("env", "rotl", UINT64_C(9223372036854775808), UINT64_C(1))->to_ui64() == UINT32_C(1));
202 CHECK(bkend.call_with_return("env", "rotr", UINT64_C(1), UINT64_C(1))->to_ui64() == UINT32_C(9223372036854775808));
203 CHECK(bkend.call_with_return("env", "rotr", UINT64_C(1), UINT64_C(0))->to_ui64() == UINT32_C(1));
204 CHECK(bkend.call_with_return("env", "rotr", UINT64_C(18446744073709551615), UINT64_C(1))->to_ui64() == UINT32_C(18446744073709551615));
205 CHECK(bkend.call_with_return("env", "rotr", UINT64_C(1), UINT64_C(64))->to_ui64() == UINT32_C(1));
206 CHECK(bkend.call_with_return("env", "rotr", UINT64_C(12379718583323101902), UINT64_C(1))->to_ui64() == UINT32_C(6189859291661550951));
207 CHECK(bkend.call_with_return("env", "rotr", UINT64_C(18302628889324683264), UINT64_C(4))->to_ui64() == UINT32_C(1143914305582792704));
208 CHECK(bkend.call_with_return("env", "rotr", UINT64_C(12379570969274382345), UINT64_C(53))->to_ui64() == UINT32_C(7534987797011123550));
209 CHECK(bkend.call_with_return("env", "rotr", UINT64_C(12380715672649826460), UINT64_C(63))->to_ui64() == UINT32_C(6314687271590101305));
210 CHECK(bkend.call_with_return("env", "rotr", UINT64_C(12379570969274382345), UINT64_C(245))->to_ui64() == UINT32_C(7534987797011123550));
211 CHECK(bkend.call_with_return("env", "rotr", UINT64_C(12379676934707509257), UINT64_C(18446744073709551597))->to_ui64() == UINT32_C(10711665151168044651));
212 CHECK(bkend.call_with_return("env", "rotr", UINT64_C(12380715672649826460), UINT64_C(9223372036854775871))->to_ui64() == UINT32_C(6314687271590101305));
213 CHECK(bkend.call_with_return("env", "rotr", UINT64_C(1), UINT64_C(63))->to_ui64() == UINT32_C(2));
214 CHECK(bkend.call_with_return("env", "rotr", UINT64_C(9223372036854775808), UINT64_C(63))->to_ui64() == UINT32_C(1));
215 CHECK(bkend.call_with_return("env", "clz", UINT64_C(18446744073709551615))->to_ui64() == UINT32_C(0));
216 CHECK(bkend.call_with_return("env", "clz", UINT64_C(0))->to_ui64() == UINT32_C(64));
217 CHECK(bkend.call_with_return("env", "clz", UINT64_C(32768))->to_ui64() == UINT32_C(48));
218 CHECK(bkend.call_with_return("env", "clz", UINT64_C(255))->to_ui64() == UINT32_C(56));
219 CHECK(bkend.call_with_return("env", "clz", UINT64_C(9223372036854775808))->to_ui64() == UINT32_C(0));
220 CHECK(bkend.call_with_return("env", "clz", UINT64_C(1))->to_ui64() == UINT32_C(63));
221 CHECK(bkend.call_with_return("env", "clz", UINT64_C(2))->to_ui64() == UINT32_C(62));
222 CHECK(bkend.call_with_return("env", "clz", UINT64_C(9223372036854775807))->to_ui64() == UINT32_C(1));
223 CHECK(bkend.call_with_return("env", "ctz", UINT64_C(18446744073709551615))->to_ui64() == UINT32_C(0));
224 CHECK(bkend.call_with_return("env", "ctz", UINT64_C(0))->to_ui64() == UINT32_C(64));
225 CHECK(bkend.call_with_return("env", "ctz", UINT64_C(32768))->to_ui64() == UINT32_C(15));
226 CHECK(bkend.call_with_return("env", "ctz", UINT64_C(65536))->to_ui64() == UINT32_C(16));
227 CHECK(bkend.call_with_return("env", "ctz", UINT64_C(9223372036854775808))->to_ui64() == UINT32_C(63));
228 CHECK(bkend.call_with_return("env", "ctz", UINT64_C(9223372036854775807))->to_ui64() == UINT32_C(0));
229 CHECK(bkend.call_with_return("env", "popcnt", UINT64_C(18446744073709551615))->to_ui64() == UINT32_C(64));
230 CHECK(bkend.call_with_return("env", "popcnt", UINT64_C(0))->to_ui64() == UINT32_C(0));
231 CHECK(bkend.call_with_return("env", "popcnt", UINT64_C(32768))->to_ui64() == UINT32_C(1));
232 CHECK(bkend.call_with_return("env", "popcnt", UINT64_C(9223512776490647552))->to_ui64() == UINT32_C(4));
233 CHECK(bkend.call_with_return("env", "popcnt", UINT64_C(9223372036854775807))->to_ui64() == UINT32_C(63));
234 CHECK(bkend.call_with_return("env", "popcnt", UINT64_C(12297829381041378645))->to_ui64() == UINT32_C(32));
235 CHECK(bkend.call_with_return("env", "popcnt", UINT64_C(11068046444512062122))->to_ui64() == UINT32_C(32));
236 CHECK(bkend.call_with_return("env", "popcnt", UINT64_C(16045690984833335023))->to_ui64() == UINT32_C(48));
237 CHECK(bkend.call_with_return("env", "eqz", UINT64_C(0))->to_ui32() == UINT32_C(1));
238 CHECK(bkend.call_with_return("env", "eqz", UINT64_C(1))->to_ui32() == UINT32_C(0));
239 CHECK(bkend.call_with_return("env", "eqz", UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(0));
240 CHECK(bkend.call_with_return("env", "eqz", UINT64_C(9223372036854775807))->to_ui32() == UINT32_C(0));
241 CHECK(bkend.call_with_return("env", "eqz", UINT64_C(18446744073709551615))->to_ui32() == UINT32_C(0));
242 CHECK(bkend.call_with_return("env", "eq", UINT64_C(0), UINT64_C(0))->to_ui32() == UINT32_C(1));
243 CHECK(bkend.call_with_return("env", "eq", UINT64_C(1), UINT64_C(1))->to_ui32() == UINT32_C(1));
244 CHECK(bkend.call_with_return("env", "eq", UINT64_C(18446744073709551615), UINT64_C(1))->to_ui32() == UINT32_C(0));
245 CHECK(bkend.call_with_return("env", "eq", UINT64_C(9223372036854775808), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(1));
246 CHECK(bkend.call_with_return("env", "eq", UINT64_C(9223372036854775807), UINT64_C(9223372036854775807))->to_ui32() == UINT32_C(1));
247 CHECK(bkend.call_with_return("env", "eq", UINT64_C(18446744073709551615), UINT64_C(18446744073709551615))->to_ui32() == UINT32_C(1));
248 CHECK(bkend.call_with_return("env", "eq", UINT64_C(1), UINT64_C(0))->to_ui32() == UINT32_C(0));
249 CHECK(bkend.call_with_return("env", "eq", UINT64_C(0), UINT64_C(1))->to_ui32() == UINT32_C(0));
250 CHECK(bkend.call_with_return("env", "eq", UINT64_C(9223372036854775808), UINT64_C(0))->to_ui32() == UINT32_C(0));
251 CHECK(bkend.call_with_return("env", "eq", UINT64_C(0), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(0));
252 CHECK(bkend.call_with_return("env", "eq", UINT64_C(9223372036854775808), UINT64_C(18446744073709551615))->to_ui32() == UINT32_C(0));
253 CHECK(bkend.call_with_return("env", "eq", UINT64_C(18446744073709551615), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(0));
254 CHECK(bkend.call_with_return("env", "eq", UINT64_C(9223372036854775808), UINT64_C(9223372036854775807))->to_ui32() == UINT32_C(0));
255 CHECK(bkend.call_with_return("env", "eq", UINT64_C(9223372036854775807), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(0));
256 CHECK(bkend.call_with_return("env", "ne", UINT64_C(0), UINT64_C(0))->to_ui32() == UINT32_C(0));
257 CHECK(bkend.call_with_return("env", "ne", UINT64_C(1), UINT64_C(1))->to_ui32() == UINT32_C(0));
258 CHECK(bkend.call_with_return("env", "ne", UINT64_C(18446744073709551615), UINT64_C(1))->to_ui32() == UINT32_C(1));
259 CHECK(bkend.call_with_return("env", "ne", UINT64_C(9223372036854775808), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(0));
260 CHECK(bkend.call_with_return("env", "ne", UINT64_C(9223372036854775807), UINT64_C(9223372036854775807))->to_ui32() == UINT32_C(0));
261 CHECK(bkend.call_with_return("env", "ne", UINT64_C(18446744073709551615), UINT64_C(18446744073709551615))->to_ui32() == UINT32_C(0));
262 CHECK(bkend.call_with_return("env", "ne", UINT64_C(1), UINT64_C(0))->to_ui32() == UINT32_C(1));
263 CHECK(bkend.call_with_return("env", "ne", UINT64_C(0), UINT64_C(1))->to_ui32() == UINT32_C(1));
264 CHECK(bkend.call_with_return("env", "ne", UINT64_C(9223372036854775808), UINT64_C(0))->to_ui32() == UINT32_C(1));
265 CHECK(bkend.call_with_return("env", "ne", UINT64_C(0), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(1));
266 CHECK(bkend.call_with_return("env", "ne", UINT64_C(9223372036854775808), UINT64_C(18446744073709551615))->to_ui32() == UINT32_C(1));
267 CHECK(bkend.call_with_return("env", "ne", UINT64_C(18446744073709551615), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(1));
268 CHECK(bkend.call_with_return("env", "ne", UINT64_C(9223372036854775808), UINT64_C(9223372036854775807))->to_ui32() == UINT32_C(1));
269 CHECK(bkend.call_with_return("env", "ne", UINT64_C(9223372036854775807), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(1));
270 CHECK(bkend.call_with_return("env", "lt_s", UINT64_C(0), UINT64_C(0))->to_ui32() == UINT32_C(0));
271 CHECK(bkend.call_with_return("env", "lt_s", UINT64_C(1), UINT64_C(1))->to_ui32() == UINT32_C(0));
272 CHECK(bkend.call_with_return("env", "lt_s", UINT64_C(18446744073709551615), UINT64_C(1))->to_ui32() == UINT32_C(1));
273 CHECK(bkend.call_with_return("env", "lt_s", UINT64_C(9223372036854775808), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(0));
274 CHECK(bkend.call_with_return("env", "lt_s", UINT64_C(9223372036854775807), UINT64_C(9223372036854775807))->to_ui32() == UINT32_C(0));
275 CHECK(bkend.call_with_return("env", "lt_s", UINT64_C(18446744073709551615), UINT64_C(18446744073709551615))->to_ui32() == UINT32_C(0));
276 CHECK(bkend.call_with_return("env", "lt_s", UINT64_C(1), UINT64_C(0))->to_ui32() == UINT32_C(0));
277 CHECK(bkend.call_with_return("env", "lt_s", UINT64_C(0), UINT64_C(1))->to_ui32() == UINT32_C(1));
278 CHECK(bkend.call_with_return("env", "lt_s", UINT64_C(9223372036854775808), UINT64_C(0))->to_ui32() == UINT32_C(1));
279 CHECK(bkend.call_with_return("env", "lt_s", UINT64_C(0), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(0));
280 CHECK(bkend.call_with_return("env", "lt_s", UINT64_C(9223372036854775808), UINT64_C(18446744073709551615))->to_ui32() == UINT32_C(1));
281 CHECK(bkend.call_with_return("env", "lt_s", UINT64_C(18446744073709551615), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(0));
282 CHECK(bkend.call_with_return("env", "lt_s", UINT64_C(9223372036854775808), UINT64_C(9223372036854775807))->to_ui32() == UINT32_C(1));
283 CHECK(bkend.call_with_return("env", "lt_s", UINT64_C(9223372036854775807), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(0));
284 CHECK(bkend.call_with_return("env", "lt_u", UINT64_C(0), UINT64_C(0))->to_ui32() == UINT32_C(0));
285 CHECK(bkend.call_with_return("env", "lt_u", UINT64_C(1), UINT64_C(1))->to_ui32() == UINT32_C(0));
286 CHECK(bkend.call_with_return("env", "lt_u", UINT64_C(18446744073709551615), UINT64_C(1))->to_ui32() == UINT32_C(0));
287 CHECK(bkend.call_with_return("env", "lt_u", UINT64_C(9223372036854775808), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(0));
288 CHECK(bkend.call_with_return("env", "lt_u", UINT64_C(9223372036854775807), UINT64_C(9223372036854775807))->to_ui32() == UINT32_C(0));
289 CHECK(bkend.call_with_return("env", "lt_u", UINT64_C(18446744073709551615), UINT64_C(18446744073709551615))->to_ui32() == UINT32_C(0));
290 CHECK(bkend.call_with_return("env", "lt_u", UINT64_C(1), UINT64_C(0))->to_ui32() == UINT32_C(0));
291 CHECK(bkend.call_with_return("env", "lt_u", UINT64_C(0), UINT64_C(1))->to_ui32() == UINT32_C(1));
292 CHECK(bkend.call_with_return("env", "lt_u", UINT64_C(9223372036854775808), UINT64_C(0))->to_ui32() == UINT32_C(0));
293 CHECK(bkend.call_with_return("env", "lt_u", UINT64_C(0), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(1));
294 CHECK(bkend.call_with_return("env", "lt_u", UINT64_C(9223372036854775808), UINT64_C(18446744073709551615))->to_ui32() == UINT32_C(1));
295 CHECK(bkend.call_with_return("env", "lt_u", UINT64_C(18446744073709551615), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(0));
296 CHECK(bkend.call_with_return("env", "lt_u", UINT64_C(9223372036854775808), UINT64_C(9223372036854775807))->to_ui32() == UINT32_C(0));
297 CHECK(bkend.call_with_return("env", "lt_u", UINT64_C(9223372036854775807), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(1));
298 CHECK(bkend.call_with_return("env", "le_s", UINT64_C(0), UINT64_C(0))->to_ui32() == UINT32_C(1));
299 CHECK(bkend.call_with_return("env", "le_s", UINT64_C(1), UINT64_C(1))->to_ui32() == UINT32_C(1));
300 CHECK(bkend.call_with_return("env", "le_s", UINT64_C(18446744073709551615), UINT64_C(1))->to_ui32() == UINT32_C(1));
301 CHECK(bkend.call_with_return("env", "le_s", UINT64_C(9223372036854775808), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(1));
302 CHECK(bkend.call_with_return("env", "le_s", UINT64_C(9223372036854775807), UINT64_C(9223372036854775807))->to_ui32() == UINT32_C(1));
303 CHECK(bkend.call_with_return("env", "le_s", UINT64_C(18446744073709551615), UINT64_C(18446744073709551615))->to_ui32() == UINT32_C(1));
304 CHECK(bkend.call_with_return("env", "le_s", UINT64_C(1), UINT64_C(0))->to_ui32() == UINT32_C(0));
305 CHECK(bkend.call_with_return("env", "le_s", UINT64_C(0), UINT64_C(1))->to_ui32() == UINT32_C(1));
306 CHECK(bkend.call_with_return("env", "le_s", UINT64_C(9223372036854775808), UINT64_C(0))->to_ui32() == UINT32_C(1));
307 CHECK(bkend.call_with_return("env", "le_s", UINT64_C(0), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(0));
308 CHECK(bkend.call_with_return("env", "le_s", UINT64_C(9223372036854775808), UINT64_C(18446744073709551615))->to_ui32() == UINT32_C(1));
309 CHECK(bkend.call_with_return("env", "le_s", UINT64_C(18446744073709551615), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(0));
310 CHECK(bkend.call_with_return("env", "le_s", UINT64_C(9223372036854775808), UINT64_C(9223372036854775807))->to_ui32() == UINT32_C(1));
311 CHECK(bkend.call_with_return("env", "le_s", UINT64_C(9223372036854775807), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(0));
312 CHECK(bkend.call_with_return("env", "le_u", UINT64_C(0), UINT64_C(0))->to_ui32() == UINT32_C(1));
313 CHECK(bkend.call_with_return("env", "le_u", UINT64_C(1), UINT64_C(1))->to_ui32() == UINT32_C(1));
314 CHECK(bkend.call_with_return("env", "le_u", UINT64_C(18446744073709551615), UINT64_C(1))->to_ui32() == UINT32_C(0));
315 CHECK(bkend.call_with_return("env", "le_u", UINT64_C(9223372036854775808), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(1));
316 CHECK(bkend.call_with_return("env", "le_u", UINT64_C(9223372036854775807), UINT64_C(9223372036854775807))->to_ui32() == UINT32_C(1));
317 CHECK(bkend.call_with_return("env", "le_u", UINT64_C(18446744073709551615), UINT64_C(18446744073709551615))->to_ui32() == UINT32_C(1));
318 CHECK(bkend.call_with_return("env", "le_u", UINT64_C(1), UINT64_C(0))->to_ui32() == UINT32_C(0));
319 CHECK(bkend.call_with_return("env", "le_u", UINT64_C(0), UINT64_C(1))->to_ui32() == UINT32_C(1));
320 CHECK(bkend.call_with_return("env", "le_u", UINT64_C(9223372036854775808), UINT64_C(0))->to_ui32() == UINT32_C(0));
321 CHECK(bkend.call_with_return("env", "le_u", UINT64_C(0), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(1));
322 CHECK(bkend.call_with_return("env", "le_u", UINT64_C(9223372036854775808), UINT64_C(18446744073709551615))->to_ui32() == UINT32_C(1));
323 CHECK(bkend.call_with_return("env", "le_u", UINT64_C(18446744073709551615), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(0));
324 CHECK(bkend.call_with_return("env", "le_u", UINT64_C(9223372036854775808), UINT64_C(9223372036854775807))->to_ui32() == UINT32_C(0));
325 CHECK(bkend.call_with_return("env", "le_u", UINT64_C(9223372036854775807), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(1));
326 CHECK(bkend.call_with_return("env", "gt_s", UINT64_C(0), UINT64_C(0))->to_ui32() == UINT32_C(0));
327 CHECK(bkend.call_with_return("env", "gt_s", UINT64_C(1), UINT64_C(1))->to_ui32() == UINT32_C(0));
328 CHECK(bkend.call_with_return("env", "gt_s", UINT64_C(18446744073709551615), UINT64_C(1))->to_ui32() == UINT32_C(0));
329 CHECK(bkend.call_with_return("env", "gt_s", UINT64_C(9223372036854775808), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(0));
330 CHECK(bkend.call_with_return("env", "gt_s", UINT64_C(9223372036854775807), UINT64_C(9223372036854775807))->to_ui32() == UINT32_C(0));
331 CHECK(bkend.call_with_return("env", "gt_s", UINT64_C(18446744073709551615), UINT64_C(18446744073709551615))->to_ui32() == UINT32_C(0));
332 CHECK(bkend.call_with_return("env", "gt_s", UINT64_C(1), UINT64_C(0))->to_ui32() == UINT32_C(1));
333 CHECK(bkend.call_with_return("env", "gt_s", UINT64_C(0), UINT64_C(1))->to_ui32() == UINT32_C(0));
334 CHECK(bkend.call_with_return("env", "gt_s", UINT64_C(9223372036854775808), UINT64_C(0))->to_ui32() == UINT32_C(0));
335 CHECK(bkend.call_with_return("env", "gt_s", UINT64_C(0), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(1));
336 CHECK(bkend.call_with_return("env", "gt_s", UINT64_C(9223372036854775808), UINT64_C(18446744073709551615))->to_ui32() == UINT32_C(0));
337 CHECK(bkend.call_with_return("env", "gt_s", UINT64_C(18446744073709551615), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(1));
338 CHECK(bkend.call_with_return("env", "gt_s", UINT64_C(9223372036854775808), UINT64_C(9223372036854775807))->to_ui32() == UINT32_C(0));
339 CHECK(bkend.call_with_return("env", "gt_s", UINT64_C(9223372036854775807), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(1));
340 CHECK(bkend.call_with_return("env", "gt_u", UINT64_C(0), UINT64_C(0))->to_ui32() == UINT32_C(0));
341 CHECK(bkend.call_with_return("env", "gt_u", UINT64_C(1), UINT64_C(1))->to_ui32() == UINT32_C(0));
342 CHECK(bkend.call_with_return("env", "gt_u", UINT64_C(18446744073709551615), UINT64_C(1))->to_ui32() == UINT32_C(1));
343 CHECK(bkend.call_with_return("env", "gt_u", UINT64_C(9223372036854775808), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(0));
344 CHECK(bkend.call_with_return("env", "gt_u", UINT64_C(9223372036854775807), UINT64_C(9223372036854775807))->to_ui32() == UINT32_C(0));
345 CHECK(bkend.call_with_return("env", "gt_u", UINT64_C(18446744073709551615), UINT64_C(18446744073709551615))->to_ui32() == UINT32_C(0));
346 CHECK(bkend.call_with_return("env", "gt_u", UINT64_C(1), UINT64_C(0))->to_ui32() == UINT32_C(1));
347 CHECK(bkend.call_with_return("env", "gt_u", UINT64_C(0), UINT64_C(1))->to_ui32() == UINT32_C(0));
348 CHECK(bkend.call_with_return("env", "gt_u", UINT64_C(9223372036854775808), UINT64_C(0))->to_ui32() == UINT32_C(1));
349 CHECK(bkend.call_with_return("env", "gt_u", UINT64_C(0), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(0));
350 CHECK(bkend.call_with_return("env", "gt_u", UINT64_C(9223372036854775808), UINT64_C(18446744073709551615))->to_ui32() == UINT32_C(0));
351 CHECK(bkend.call_with_return("env", "gt_u", UINT64_C(18446744073709551615), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(1));
352 CHECK(bkend.call_with_return("env", "gt_u", UINT64_C(9223372036854775808), UINT64_C(9223372036854775807))->to_ui32() == UINT32_C(1));
353 CHECK(bkend.call_with_return("env", "gt_u", UINT64_C(9223372036854775807), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(0));
354 CHECK(bkend.call_with_return("env", "ge_s", UINT64_C(0), UINT64_C(0))->to_ui32() == UINT32_C(1));
355 CHECK(bkend.call_with_return("env", "ge_s", UINT64_C(1), UINT64_C(1))->to_ui32() == UINT32_C(1));
356 CHECK(bkend.call_with_return("env", "ge_s", UINT64_C(18446744073709551615), UINT64_C(1))->to_ui32() == UINT32_C(0));
357 CHECK(bkend.call_with_return("env", "ge_s", UINT64_C(9223372036854775808), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(1));
358 CHECK(bkend.call_with_return("env", "ge_s", UINT64_C(9223372036854775807), UINT64_C(9223372036854775807))->to_ui32() == UINT32_C(1));
359 CHECK(bkend.call_with_return("env", "ge_s", UINT64_C(18446744073709551615), UINT64_C(18446744073709551615))->to_ui32() == UINT32_C(1));
360 CHECK(bkend.call_with_return("env", "ge_s", UINT64_C(1), UINT64_C(0))->to_ui32() == UINT32_C(1));
361 CHECK(bkend.call_with_return("env", "ge_s", UINT64_C(0), UINT64_C(1))->to_ui32() == UINT32_C(0));
362 CHECK(bkend.call_with_return("env", "ge_s", UINT64_C(9223372036854775808), UINT64_C(0))->to_ui32() == UINT32_C(0));
363 CHECK(bkend.call_with_return("env", "ge_s", UINT64_C(0), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(1));
364 CHECK(bkend.call_with_return("env", "ge_s", UINT64_C(9223372036854775808), UINT64_C(18446744073709551615))->to_ui32() == UINT32_C(0));
365 CHECK(bkend.call_with_return("env", "ge_s", UINT64_C(18446744073709551615), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(1));
366 CHECK(bkend.call_with_return("env", "ge_s", UINT64_C(9223372036854775808), UINT64_C(9223372036854775807))->to_ui32() == UINT32_C(0));
367 CHECK(bkend.call_with_return("env", "ge_s", UINT64_C(9223372036854775807), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(1));
368 CHECK(bkend.call_with_return("env", "ge_u", UINT64_C(0), UINT64_C(0))->to_ui32() == UINT32_C(1));
369 CHECK(bkend.call_with_return("env", "ge_u", UINT64_C(1), UINT64_C(1))->to_ui32() == UINT32_C(1));
370 CHECK(bkend.call_with_return("env", "ge_u", UINT64_C(18446744073709551615), UINT64_C(1))->to_ui32() == UINT32_C(1));
371 CHECK(bkend.call_with_return("env", "ge_u", UINT64_C(9223372036854775808), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(1));
372 CHECK(bkend.call_with_return("env", "ge_u", UINT64_C(9223372036854775807), UINT64_C(9223372036854775807))->to_ui32() == UINT32_C(1));
373 CHECK(bkend.call_with_return("env", "ge_u", UINT64_C(18446744073709551615), UINT64_C(18446744073709551615))->to_ui32() == UINT32_C(1));
374 CHECK(bkend.call_with_return("env", "ge_u", UINT64_C(1), UINT64_C(0))->to_ui32() == UINT32_C(1));
375 CHECK(bkend.call_with_return("env", "ge_u", UINT64_C(0), UINT64_C(1))->to_ui32() == UINT32_C(0));
376 CHECK(bkend.call_with_return("env", "ge_u", UINT64_C(9223372036854775808), UINT64_C(0))->to_ui32() == UINT32_C(1));
377 CHECK(bkend.call_with_return("env", "ge_u", UINT64_C(0), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(0));
378 CHECK(bkend.call_with_return("env", "ge_u", UINT64_C(9223372036854775808), UINT64_C(18446744073709551615))->to_ui32() == UINT32_C(0));
379 CHECK(bkend.call_with_return("env", "ge_u", UINT64_C(18446744073709551615), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(1));
380 CHECK(bkend.call_with_return("env", "ge_u", UINT64_C(9223372036854775808), UINT64_C(9223372036854775807))->to_ui32() == UINT32_C(1));
381 CHECK(bkend.call_with_return("env", "ge_u", UINT64_C(9223372036854775807), UINT64_C(9223372036854775808))->to_ui32() == UINT32_C(0));
382}
383
384BACKEND_TEST_CASE( "Testing wasm <i64_1_wasm>", "[i64_1_wasm_tests]" ) {
386 auto code = read_wasm( std::string(wasm_directory) + "i64.1.wasm");
387 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
388}
389
390BACKEND_TEST_CASE( "Testing wasm <i64_10_wasm>", "[i64_10_wasm_tests]" ) {
392 auto code = read_wasm( std::string(wasm_directory) + "i64.10.wasm");
393 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
394}
395
396BACKEND_TEST_CASE( "Testing wasm <i64_11_wasm>", "[i64_11_wasm_tests]" ) {
398 auto code = read_wasm( std::string(wasm_directory) + "i64.11.wasm");
399 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
400}
401
402BACKEND_TEST_CASE( "Testing wasm <i64_12_wasm>", "[i64_12_wasm_tests]" ) {
404 auto code = read_wasm( std::string(wasm_directory) + "i64.12.wasm");
405 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
406}
407
408BACKEND_TEST_CASE( "Testing wasm <i64_13_wasm>", "[i64_13_wasm_tests]" ) {
410 auto code = read_wasm( std::string(wasm_directory) + "i64.13.wasm");
411 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
412}
413
414BACKEND_TEST_CASE( "Testing wasm <i64_14_wasm>", "[i64_14_wasm_tests]" ) {
416 auto code = read_wasm( std::string(wasm_directory) + "i64.14.wasm");
417 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
418}
419
420BACKEND_TEST_CASE( "Testing wasm <i64_15_wasm>", "[i64_15_wasm_tests]" ) {
422 auto code = read_wasm( std::string(wasm_directory) + "i64.15.wasm");
423 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
424}
425
426BACKEND_TEST_CASE( "Testing wasm <i64_16_wasm>", "[i64_16_wasm_tests]" ) {
428 auto code = read_wasm( std::string(wasm_directory) + "i64.16.wasm");
429 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
430}
431
432BACKEND_TEST_CASE( "Testing wasm <i64_17_wasm>", "[i64_17_wasm_tests]" ) {
434 auto code = read_wasm( std::string(wasm_directory) + "i64.17.wasm");
435 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
436}
437
438BACKEND_TEST_CASE( "Testing wasm <i64_18_wasm>", "[i64_18_wasm_tests]" ) {
440 auto code = read_wasm( std::string(wasm_directory) + "i64.18.wasm");
441 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
442}
443
444BACKEND_TEST_CASE( "Testing wasm <i64_19_wasm>", "[i64_19_wasm_tests]" ) {
446 auto code = read_wasm( std::string(wasm_directory) + "i64.19.wasm");
447 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
448}
449
450BACKEND_TEST_CASE( "Testing wasm <i64_2_wasm>", "[i64_2_wasm_tests]" ) {
452 auto code = read_wasm( std::string(wasm_directory) + "i64.2.wasm");
453 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
454}
455
456BACKEND_TEST_CASE( "Testing wasm <i64_20_wasm>", "[i64_20_wasm_tests]" ) {
458 auto code = read_wasm( std::string(wasm_directory) + "i64.20.wasm");
459 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
460}
461
462BACKEND_TEST_CASE( "Testing wasm <i64_21_wasm>", "[i64_21_wasm_tests]" ) {
464 auto code = read_wasm( std::string(wasm_directory) + "i64.21.wasm");
465 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
466}
467
468BACKEND_TEST_CASE( "Testing wasm <i64_22_wasm>", "[i64_22_wasm_tests]" ) {
470 auto code = read_wasm( std::string(wasm_directory) + "i64.22.wasm");
471 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
472}
473
474BACKEND_TEST_CASE( "Testing wasm <i64_23_wasm>", "[i64_23_wasm_tests]" ) {
476 auto code = read_wasm( std::string(wasm_directory) + "i64.23.wasm");
477 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
478}
479
480BACKEND_TEST_CASE( "Testing wasm <i64_24_wasm>", "[i64_24_wasm_tests]" ) {
482 auto code = read_wasm( std::string(wasm_directory) + "i64.24.wasm");
483 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
484}
485
486BACKEND_TEST_CASE( "Testing wasm <i64_25_wasm>", "[i64_25_wasm_tests]" ) {
488 auto code = read_wasm( std::string(wasm_directory) + "i64.25.wasm");
489 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
490}
491
492BACKEND_TEST_CASE( "Testing wasm <i64_26_wasm>", "[i64_26_wasm_tests]" ) {
494 auto code = read_wasm( std::string(wasm_directory) + "i64.26.wasm");
495 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
496}
497
498BACKEND_TEST_CASE( "Testing wasm <i64_27_wasm>", "[i64_27_wasm_tests]" ) {
500 auto code = read_wasm( std::string(wasm_directory) + "i64.27.wasm");
501 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
502}
503
504BACKEND_TEST_CASE( "Testing wasm <i64_28_wasm>", "[i64_28_wasm_tests]" ) {
506 auto code = read_wasm( std::string(wasm_directory) + "i64.28.wasm");
507 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
508}
509
510BACKEND_TEST_CASE( "Testing wasm <i64_29_wasm>", "[i64_29_wasm_tests]" ) {
512 auto code = read_wasm( std::string(wasm_directory) + "i64.29.wasm");
513 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
514}
515
516BACKEND_TEST_CASE( "Testing wasm <i64_3_wasm>", "[i64_3_wasm_tests]" ) {
518 auto code = read_wasm( std::string(wasm_directory) + "i64.3.wasm");
519 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
520}
521
522BACKEND_TEST_CASE( "Testing wasm <i64_4_wasm>", "[i64_4_wasm_tests]" ) {
524 auto code = read_wasm( std::string(wasm_directory) + "i64.4.wasm");
525 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
526}
527
528BACKEND_TEST_CASE( "Testing wasm <i64_5_wasm>", "[i64_5_wasm_tests]" ) {
530 auto code = read_wasm( std::string(wasm_directory) + "i64.5.wasm");
531 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
532}
533
534BACKEND_TEST_CASE( "Testing wasm <i64_6_wasm>", "[i64_6_wasm_tests]" ) {
536 auto code = read_wasm( std::string(wasm_directory) + "i64.6.wasm");
537 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
538}
539
540BACKEND_TEST_CASE( "Testing wasm <i64_7_wasm>", "[i64_7_wasm_tests]" ) {
542 auto code = read_wasm( std::string(wasm_directory) + "i64.7.wasm");
543 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
544}
545
546BACKEND_TEST_CASE( "Testing wasm <i64_8_wasm>", "[i64_8_wasm_tests]" ) {
548 auto code = read_wasm( std::string(wasm_directory) + "i64.8.wasm");
549 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
550}
551
552BACKEND_TEST_CASE( "Testing wasm <i64_9_wasm>", "[i64_9_wasm_tests]" ) {
554 auto code = read_wasm( std::string(wasm_directory) + "i64.9.wasm");
555 CHECK_THROWS_AS(backend_t(code, nullptr), std::exception);
556}
557
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
wasm_allocator wa
Definition main.cpp:10
#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