Skip to content

Commit 6a3773c

Browse files
committed
Add a regression test that drives the left shift behaviour in the new SMT backend
1 parent 412d040 commit 6a3773c

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
int main()
2+
{
3+
int starting_val = 1;
4+
int shifting_places;
5+
__CPROVER_assume(shifting_places > 0);
6+
__CPROVER_assume(shifting_places < 32);
7+
int result = starting_val << shifting_places;
8+
9+
__CPROVER_assert(result > 1, "Shifted result should be greater than one");
10+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
shift_left.c
3+
--incremental-smt2-solver 'z3 --smt2 -in' --slice-formula
4+
\[main\.assertion\.1\] line \d Shifted result should be greater than one: FAILURE
5+
^EXIT=10$
6+
^SIGNAL=0$
7+
--
8+
--

0 commit comments

Comments
 (0)