File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -124,12 +124,17 @@ TEST_CASE("binary eval switch", "[core][analyses][interval]")
124
124
constant_interval_exprt five = interval_of (5 );
125
125
constant_interval_exprt eight = interval_of (8 );
126
126
127
+ // Here we test only single element intervals, more robust testing of each
128
+ // opertion can be found in the method unit tests (e.g.
129
+ // unit/util/interval/add.cpp)
130
+
127
131
SECTION (" Numeric operations" )
128
132
{
129
133
REQUIRE (five.eval (ID_plus, eight) == interval_of (13 ));
130
134
REQUIRE (five.eval (ID_minus, eight) == interval_of (-3 ));
131
135
REQUIRE (five.eval (ID_mult, eight) == interval_of (40 ));
132
136
REQUIRE (five.eval (ID_div, eight) == interval_of (0 ));
137
+ // Note modulo is implemented very imprecisely
133
138
REQUIRE (five.eval (ID_mod, eight) == interval_from_to (0 , 5 ));
134
139
REQUIRE (five.eval (ID_shl, two) == interval_of (20 /* 5 << 2 */ ));
135
140
REQUIRE (five.eval (ID_ashr, two) == interval_of (1 /* 5 >> 2 */ ));
You can’t perform that action at this time.
0 commit comments