File tree Expand file tree Collapse file tree 3 files changed +56
-3
lines changed Expand file tree Collapse file tree 3 files changed +56
-3
lines changed Original file line number Diff line number Diff line change 1+
2+ int lshift() {
3+ return (1 << 0) == 1;
4+ }
5+
6+ int rshift() {
7+ return (1 >> 0) == 1;
8+ }
9+
10+ int lshift_var(int i) {
11+ return (1 << i) == 1;
12+ }
13+
14+ int rshift_var(int i) {
15+ return (1 >> i) == 1;
16+ }
17+
18+ int main(int x) {
19+ if (x == 0) {
20+ return lshift();
21+ } elseif (x == 1) {
22+ return rshift();
23+ } elseif (x == 2) {
24+ return lshift_var(0);
25+ } elseif (x == 3) {
26+ return rshift_var(0);
27+ } elseif (x == 4) {
28+ return lshift_var(1);
29+ } else {
30+ return rshift_var(1);
31+ }
32+ }
33+
34+ int is_claimed(int index) method_id(11) {
35+ int claim_bit_index = index % 256;
36+ int mask = 1 << claim_bit_index;
37+ return (255 & mask) == mask;
38+ }
39+
40+
41+ {-
42+ method_id | in | out
43+ TESTCASE | 0 | 0 | -1
44+ TESTCASE | 0 | 1 | -1
45+ TESTCASE | 0 | 2 | -1
46+ TESTCASE | 0 | 3 | -1
47+ TESTCASE | 0 | 4 | 0
48+ TESTCASE | 0 | 5 | 0
49+ TESTCASE | 11 | 0 | -1
50+ TESTCASE | 11 | 1 | -1
51+ TESTCASE | 11 | 256 | -1
52+ TESTCASE | 11 | 8 | 0
53+ -}
Original file line number Diff line number Diff line change @@ -264,7 +264,7 @@ int emulate_lshift(int a, int b) {
264264 }
265265 int t = ((b & VarDescr::_NonZero) ? VarDescr::_Even : 0 );
266266 t |= b & VarDescr::_Finite;
267- return emulate_mul (a, VarDescr::_Int | VarDescr::_Pos | VarDescr::_NonZero | VarDescr::_Even | t);
267+ return emulate_mul (a, VarDescr::_Int | VarDescr::_Pos | VarDescr::_NonZero | t);
268268}
269269
270270int emulate_div (int a, int b) {
@@ -310,7 +310,7 @@ int emulate_rshift(int a, int b) {
310310 }
311311 int t = ((b & VarDescr::_NonZero) ? VarDescr::_Even : 0 );
312312 t |= b & VarDescr::_Finite;
313- return emulate_div (a, VarDescr::_Int | VarDescr::_Pos | VarDescr::_NonZero | VarDescr::_Even | t);
313+ return emulate_div (a, VarDescr::_Int | VarDescr::_Pos | VarDescr::_NonZero | t);
314314}
315315
316316int emulate_mod (int a, int b, int round_mode = -1 ) {
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ extern std::string generated_from;
4545
4646constexpr int optimize_depth = 20 ;
4747
48- const std::string func_version{" 0.4.4 " };
48+ const std::string func_version{" 0.4.5 " };
4949
5050enum Keyword {
5151 _Eof = -1 ,
You can’t perform that action at this time.
0 commit comments