File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
unit/solvers/smt2_incremental Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -586,6 +586,22 @@ TEST_CASE(
586
586
smt_term_four_32bit));
587
587
}
588
588
589
+ SECTION (" Subtraction of pointer from integer" )
590
+ {
591
+ // 2 - (*int32_t)a -- Semantically void expression, need to make sure
592
+ // we throw in this case.
593
+ const cbmc_invariants_should_throwt invariants_throw;
594
+
595
+ const auto pointer_arith_expr = minus_exprt{two_bvint, pointer_a};
596
+
597
+ REQUIRE_THROWS_MATCHES (
598
+ test.convert (pointer_arith_expr),
599
+ invariant_failedt,
600
+ invariant_failure_containing (
601
+ " minus expressions of pointer and integer expect lhs to be the pointer" ));
602
+ }
603
+
604
+
589
605
SECTION (" Subtraction of two pointer arguments" )
590
606
{
591
607
// (int32_t *)a - (int32_t *)b
You can’t perform that action at this time.
0 commit comments